Error when connecting to ESP8266 on external power

Posted on
  • Hi

    When connected to my computer everything works fine. I see the green LED flash twice. But when connected to a USB power supply the ESP8266 connect callback gets called with an error object, and the red LED is turned on. Any idea why?

    E.on('init', function() {
      SPI2.setup({baud: 3200000, mosi: B15});
      Serial1.setup(115200, { rx: B7, tx : B6 });
    
      var wifi = require("ESP8266WiFi_0v25").connect(Seri­al1, function(err) {
        if (err) { digitalWrite(LED1, 1); throw err; }
    
        setTimeout(function () {
          digitalWrite(LED2,0);
          setTimeout(function() { digitalWrite(LED2,1); }, 500);
          setTimeout(function() { digitalWrite(LED2,0); }, 1000);
          setTimeout(function() { digitalWrite(LED2,1); }, 1500);
          setTimeout(function() { digitalWrite(LED2,0); }, 2000);
    
          setTimeout(function() { wifiResetConnect(wifi); }, 4000);
        }, 1500);
      });
    });
    

    How do I debug this further?

  • It would be useful to see the circuit diagram. Are the board you are using AND the ESP8266 module both being powered from the USB? It is possible that the USB isn't capable of delivering the sufficient current needed.

  • The Pico is powered off of the USB battery, and the ESP is powered by the Pico. But I think the battery should be powerfull enough. I can't remember the exact specs, but it's at least 1A. I've used it to successfully run my RasPi before.

  • Hi @Tobbe,

    It'll be because when the Pico isn't connected to USB, the 'console' (eg. left side of Web IDE) defaults to Serial1 (on B6/B7), which would then interfere with the ESP8266 also on there.

    Try:

    E.on('init', function() {
      USB.setConsole(); // <---------------------- force USB use even if USB not connected
      SPI2.setup({baud: 3200000, mosi: B15});
      Serial1.setup(115200, { rx: B7, tx : B6 });
      // ....
    
  • Thanks a lot, that seems to have fixed it :) Can't fully verify yet though, since my twitter stream node.js-server doesn't get any twitter messages any more, for some unknown reason :(

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Error when connecting to ESP8266 on external power

Posted by Avatar for Tobbe @Tobbe

Actions