• Hi +Gordon, hi all.

    I am have a Espruino WiFi 1.1 running frimware 1v99. I just trying to connect to a wifi home network and it is working when the board it is pluged to the computer, but when I disconnect it and plug it to a battery of 3.7volts using pin + and - the wifi connection fail.

    The code is unther the onInit fuction as the quick start example.

    Does anybody had this fail before?

  • Sat 2018.10.06

    Hello @JuanCar. There are many 'onInit' functions and 'quick start' examples.

    'The code is unther the onInit fuction as the quick start example'

    Would you please post the http: link as seen in the browser so we are able to follow along.


    'but when I disconnect it and plug it to a battery of 3.7volts using pin + and - the wifi connection fail.'

    Do we know if this is a software issue or a hardware one?

    ref: http://www.espruino.com/WiFi

    What is the voltage measured at the 3.3v pin adjacent to the VUSB + pin? This will show if the battery has sufficient voltage to allow the on-board regulator to function correctly.

    Is the Espruino Wifi being recognized by other devices such as your PC or phone? Do they detect by name in their list of available recognized devices?

    Was the code saved save() to the device before disconnect?

  • Hi Robin, thanks a lot for your fast support.

    I found the problem after deep reading of the manuals. My problem was to use setDeepSleep(1) before finish the wifi connection. I had this code:

    var WIFI_NAME = "";
    var WIFI_OPTIONS = { password : "" };
    
    var wifi;
    
    function onInit() {
      wifi = require("Wifi");
      wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) {
        if (err) {
         LED1.on() //Red
          return;
        }
        LED2.on(); //Green
      });
      setDeepSleep(1);
    }
    

    If I write setDeepSleep(1) just after LED2.on() everything is working. I would not say it is a bug frimware, it is a bad programming.

    I came acrros with this solution when I read setDeepSleep does not work with USB PC connection.

    Thanks a lot for your help!

  • Great, glad you got it sorted!

    Unfortunately the issue is that on STM32, setDeepSleep doesn't allow the Serial port to keep working - so any communications from the WiFi will get ignored.

    Deep Sleep is less of an issue with WiFi on since the WiFi module draws so much more power than the STM32 does.

    Realistically the best thing to do is to only enable deep sleep when the WiFi is off, and to disable it when it is on.

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

WiFi connection does not work with a battery on Espruino WiFi.

Posted by Avatar for JuanCar @JuanCar

Actions