Keeps loosing wifi connection

I have a couple of unifi 6(lite/+) access points.
I’ve set up a specific IOT network on 2.4 GHz, which all my iot devices connect to.
Over the last 24 hours, it has lost wifi connection 12 times.
It is so bad, that I’ve gotten emails frequently about the sensor being lost for 24h, and I’ve had to set up a special flow that recycles the power if it can’t be pinged locally.
It’s a NodeMCU in the box. The box is placed outside a window, and there’s an AP behind the window 5 m away, so the Wifi is ok.
The sensor shows:
|WiFi|Signal|-60 dBm|
|WiFi|Kvalitet|80 %|

I don’t see these frequent disconnects with other ESP based systems. I have a lot of wifi switces etc. and they don’t disconnect all the time.

The sensors connected to the NodeMCU are a SDS011 and a BMP280
The PSU is a 5V/2A.

Is the firmware that bad that it will loose wifi that frequently, or what is going on?

Hi,
It happens sometimes and I have never found out why. Change the PSU anyway. Is there a WPS option on your router ? Is there a guest network ? The 2.4 and 5 networks are really splitted with diefferent names ?
I had a sensor 15 meters far from the router through 3 thick walls before and no disconnections.

Yes, the IOT network is a seperate VLAN and WLAN (called xxxIOT), it is 2.4 GHz only.
No WPS on the router (it’s a unifi system).
Yes, there is a seperate guest WLAN, not connected to the IOT WLAN.
I did replace the PSU as the old one didn’t give enough power to keep the display showing proper stuff, but the replacement didn’t change anything.

Can you get the serial logs to see what exactly happens ?

I have something similar.

in 2020 i had the sensor running for some month, when the garden got a remake i unconnected it and stored it in the garage until today, where i wanted to get it up and running again.

I connected it to power and it immediately started running (connecting to the still existing Wifi) all was fine until i found out, that in the meantime i updated my database setup from influxDB 1 to influxDB 2.
After some reading i found out that a firmware update would be needed to get the authentication running for influxDB 2 .

On the next step i updated to the latest Sensor firmware (in the meantime i tried updater 0.3.2 and updater 0.3.4) and the problems started.

I have a very persistent and repeatable behavior:

  1. Power up the device
  2. Device starts in AP Mode as airRohr …
  3. I can login with my smartphone, choose a existing Wifi SSID , setup the Wifi password and store it.
  4. Sensor restarts
  5. Sensor logs in to defined Wifi
  6. I can login over the (normal, Wifi connected network) with my computer and open the Websites of the Sensor.
  7. so far so good, normal behavior as expected
  8. BUT then when it comes to changes in the configuration section what follows by a restart, the sensor looses connection to the Wifi and always restarts in AP mode as airRohr …
  9. I can then repeat the whole process as point 3. and can do this over and over again.

So the configured Wifi with the chosen SSID and Password works always ONLY ONCE, but as soon as it restarts a second time the configured Wifi can’t be connected anymore until i redo the Wifi/SSID Password configuration again (in AP Mode)

This is the output when it starts into the AP mode (simply connect the sensor to power)
###################################################
…ȤlìÉã¬l$øDznÅ3éairRohr: NRZ-2020-133/EN<\r>
<\n>mounting FS…<\r>
<\n>opened config file…<\r>
<\n>parsed json…<\r>
<\n>output debug text to displays…<\r>
<\n>Connecting to DSLGATE24<\r>
<\n>…<\r>
<\n>output debug text to displays…<\r>
<\n>Starting WiFiManager<\r>
<\n>AP ID: airRohr-4678241<\r>
<\n>Password: <\r>
<\n>scan for wifi networks…<\r>
<\n>AP Password is: <\r>
<\n>Starting Webserver… (IP unset)<\r>
<\n>
###################################################

This is the serial output when i entered the Wifi SSID/Password in the AP mode (on Smartphone)
###################################################
ws: config page …<\r>
<\n>output debug text to displays…<\r>
<\n>Saving config…<\r>
<\n>Config written successfully.<\r>
<\n>output debug text to displays…<\r>
<\n>Restart.<\r>
<\n>HáÖÔ…äÿD‚íþairRohr: NRZ-2020-133/EN<\r>
<\n>mounting FS…<\r>
<\n>opened config file…<\r>
<\n>parsed json…<\r>
<\n>output debug text to displays…<\r>
<\n>Connecting to DSLGATE24<\r>
<\n>…SNTP synced: Sun Sep 10 17:03:00 2023<\n><\r>
<\n>twoStageOTAUpdate<\r>
<\n>output debug text to displays…<\r>
<\n>.<\r>
<\n>WiFi connected, IP is: 192.168.2.211<\r>
<\n>Starting Webserver… 192.168.2.211<\r>
<\n><\n>ChipId: 4678241<\r>
<\n><\n>MAC Id: bcddc2476261<\r>
<\n>Read SDS…: 18-11-16(b08e)<\r>
<\n>Stopping SDS011…<\r>
<\n>Read DHT…<\r>
<\n>Send to :<\r>
<\n>sensor.community<\r>
<\n>Madavi.de<\r>
###################################################

This is the serial output when i entered the Configuration connected over real Wifi SSID/Password (working once) and klicked on “Save configuration and Restart”
###################################################
<\n>----<\r>
<\n>Auto-Update active…<\r>
<\n>ws: root …<\r>
<\n>ws: config page …<\r>
<\n>begin webserver_config_body_get …<\r>
<\n>ws: config page …<\r>
<\n>output debug text to displays…<\r>
<\n>Saving config…<\r>
<\n>Config written successfully.<\r>
<\n>output debug text to displays…<\r>
<\n>Restart.<\r>
<\n>?<\b>)<\b><\n>õ@È9ùairRohr: NRZ-2020-133/EN<\r>
<\n>mounting FS…<\r>
<\n>opened config file…<\r>
<\n>parsed json…<\r>
<\n>output debug text to displays…<\r>
<\n>Connecting to DSLGATE24<\r>
<\n>…<\r>
<\n>output debug text to displays…<\r>
<\n>Starting WiFiManager<\r>
<\n>AP ID: airRohr-4678241<\r>
<\n>Password: <\r>
<\n>scan for wifi networks…<\r>
<\n>AP Password is: <\r>
<\n>Starting Webserver… (IP unset)<\r>
<\n>
###################################################
I can redo this steps over an dover again, it’s like the wifi password is not store or is wrong stored after a power/reset cycle.

Any help would be great.
Thanks
Walter

Sidnote:

  1. It has nothing to do with powersupply issues.
    I’ am a electronic hardware guy for decades and know how to supply stuff.
    After running into this issues, for confirming voltage and current, i used a desktop PS with decent cabling to the NodeMCU board (not only a USB cable) . I have done a lot ESP82xx and ESP32 Design knowing how picky the could be when it comes to PS.

2)I looked into the sourcecode and have seen some IF cases depending on the localization settings where the Wifi configuration gets changed, so i already tried different language setups and bin files (de and en) but digged not deeper into this.

  1. My Wifi infrastructure is mainly based on a couple of Unify AP all ovter the house and it seems to be independent on what AP the system tries to connect.
    Even the old firmware worked flawless with the same setup.

Some News:
flashed the latest beta and latest_de.bin and directly flashed the settings from the config tool (over Serial(USB) ) , now i get :

###################################################
<\n>WiFi connected, IP is: 192.168.2.211<\r>
<\n><\n>--------------- CUT HERE FOR EXCEPTION DECODER ---------------<\n><\r>
<\n>Exception (28):<\r>
<\n>epc1=0x4000bdc8 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000<\r>
<\n><\r>
<\n>>>>stack>>><\r>
<\n><\r>
<\n>ctx: cont<\r>
<\n>sp: 3ffffd30 end: 3fffffc0 offset: 0190<\r>
<\n>3ffffec0: 00000003 00000000 3ffef4b0 3fffff10 <\r>
<\n>3ffffed0: 3fffff48 00000050 3fffff10 3ffef27f <\r>
<\n>3ffffee0: 3ffe8939 3ffe8934 3ffef4b0 40218194 <\r>
<\n>3ffffef0: 3ffe892b 3ffe8930 3ffef4b0 4020ab58 <\r>
<\n>3fffff00: 00000040 00000000 feefeffe feefeffe <\r>
<\n>3fffff10: 70747400 000d0000 80200034 402013cc <\r>
<\n>3fffff20: feefeffe feefeffe feefeffe feefeffe <\r>
<\n>3fffff30: feefeffe feefeffe feefeffe feefeffe <\r>
<\n>3fffff40: feefeffe feefeffe 00706300 d302a8c0 <\r>
<\n>3fffff50: 80ef0034 00000000 00000000 feefeffe <\r>
<\n>3fffff60: feefeffe feefeffe feefeffe feefeffe <\r>
<\n>3fffff70: feefeffe 01004544 feef010d feefeffe <\r>
<\n>3fffff80: 3ffeea31 feefeffe feefeffe feefeffe <\r>
<\n>3fffff90: feefeffe feefeffe feefeffe 3ffef6a8 <\r>
<\n>3fffffa0: 3fffdad0 00000000 3ffef668 40223240 <\r>
<\n>3fffffb0: feefeffe feefeffe 3ffe8690 401006c9 <\r>
<\n><<<stack<<<<\r>
<\n><\n>--------------- CUT HERE FOR EXCEPTION DECODER ---------------<\n>¿„܆<\b>ŒâŒæîairRohr: NRZ-2020-133/DE<\r>
<\n>mounting FS…<\r>
<\n>opened config file…<\r>
<\n>parsed json…<\r>
<\n>output debug text to displays…<\r>
<\n>Connecting to DSLGATE24<\r>
###################################################

after some more hours of fiddling around with the problem it seems i found a solution:

The problem is, every time before clicking “Save configuration and Restart” i have to fill in (overwrite the"*********" with the real Password) the Wifi password on the first configuration tab then the Wifi will work as expected.
So there seems to be something wrong with the Wifi Password handling on the configuration Website of the Sensor.

Hi,
According to the log, your esp is panicking it is the reason why it may not record the PW.
You should try to erase everything with the flasher: both firmware ans SPIFFS before reflashing.
Is your password written in normal ASCII characters ?

It is not the firmware but the flasher.
Please use the 0.3.2.

I solved this already by not using the config over Serial (USB)
and yes, all password consist of default ascii chars.

No, as i wrote , i already tried 0.3.2 and the way up.
It was always the same.
But as you can read, i found the problem, it was the website structure combined with the automatic password fill in from the browser.
As long a i had not overwritten the wifi password before “saving and restart” the browser had filled in a different (wrong, maybe old, stored) password in the background making the Wifi login invalid.