WiFi issue

Posted on
  • very new to Espruino (missed something?), trying to get ESP8266 working (ESP-12E and F). I can install FW (espruino_1v93_esp8266_4mb_combined) fine, and it starts ok.
    Wifi connects first ok, wifi.save() and it gets back after reset. All great so far.

    Then I upload some code (simple MQTT testing), save(), upload some changes, save(), reset to see it still works and after a few attempts the wifi is gone. It goes to a state, where it doesn't auto-connect (state:off) and if I try to re-connect using the same (copy-paste) wifi.connect() as originally is says bad_password. When this happens I haven't found any other way to recover than re-flash FW with full flash erase. Then it again works for a while.
    Something gets corrupted? (Did already try another ESP)

    Any idea what's happening? Anyone having similar issue?

    Oh, the code I'm trying does not touch wifi (except wifi.getDetails() as debug print), it attempts MQTT connection every 30s and runs some LED animation.
    Feels like a few cycles of upload,save(), reset makes this happen. Problem does not dissappear if I do reset() followed by save() (empty code) and re-start ESP.

  • update: seems it's not related to save() or any of the test code. I can see this by just setting up wifi (after FW flashing with flash erase), saving it, reset->still ok and then just resetting the ESP a few times (rst-button) and testing status with

    var wifi = require("Wifi");
    wifi.getDetails();
    

    First attempt was ok, then reset and I got status off, wifi.connect() gives bad password.

  • I think I may have noticed this happening too - but with the 512kB firmware in my case (so it's presumably not specifically related to the 4M image)

  • I did alot of try and error on my esp8266, and I found out that this little snippet works for me.

      var boola;
      function lan() {
        wlan.connect(logon.ssid, {password: logon.pass}, function (s) {
          boola = true;
          if(s==='bad password') {
            if(debug)console.log('restart lan');
            lan();
          }
        });
    
  • I wonder if wlan.save() is a bit broken? I can get it to work perfectly by manually connecting at power-on - it's just if I expect wlan.save() to automatically do it for me.

  • I experienced many wifi connection problems with the wifi AP at home. At work, no problem. I suspect that ESP8266 may have problems connecting to certain channels or AP.
    A friend of mine got exactly the same problem with its home wifi AP. We both worked with ESP01. Maybe there is a new silicon revision now?
    ps: a colleague told me that this problem could potentially be seen if the quartz oscillator of the chip is slightly de-rated. A little temperature increase and the center frequency of the module is misaligned with wifi channels. I did not verify this assumption but this seems to make sense in some ways.

  • Thanks for all the info.

    Bad wifi connection should not be the issue here, since I've used the same module for months with C-code (but the reasoning makes sense, cheap oscillators are often.. cheap).

    Late yesterday I decided to try another FW file just in case. I took the "cutting edge" one (travis/master, 1v93 4m.tgz). There was no combined file, so I used latest esptool.py and the instructions in the README. Up till now I've not had any issues with the same module at the same location with the same code! Does not yet proove anything, but I've been able to do tens of modifications and resets without any more issues. Maybe it breaks as I hit post...

    By the way, originally I used nodemcu-pyflasher and the combined image for the job.

    I'll play with this a few days more to see if it really works now.

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

WiFi issue

Posted by Avatar for kisse66 @kisse66

Actions