ESP8266 Wifi reliability
Posted: Wed Aug 28, 2019 2:21 pm
I'm running multiple esp8266 nodes in my house, some have a very stable wifi (or just not much traffic) while most of them reconnect every few minutes. Even the node 3 meters away from the wifi router reconnects up to 10 times per day despite the RSSI of -50dB. The node further away with a RSSI of -80 dB reconnects almost every 2 minutes (ping interval 1.5 minutes).
This really got onto my nerves so I looked for a solution. I won't mention everything I tried but the solution that seems to work:
The wifi has different sleep modes and the default is SLEEP_MODEM. You can change the mode to SLEEP_NONE with:
This will increase the power consumption a bit but on a non-battery powered device I don't care. https://bbs.espressif.com/viewtopic.php ... modem#p485 I didn't measure it myself.
Since I changed this more than 24 hours ago, the node with RSSI -80dB has only reconnect twice and one time was a reconnect every other device also did so doesn't really count.
So the difference is really impressive: From reconnecting every ~2 minutes it now only reconnects 1-2 times a day!
This function was of course implemented a long time ago but I couldn't find any information on the forum about it so I thought I'd share this in case someone else has trouble with his wifi reliability too. (I only found this function after searching for the reconnect error, going through the arduino implementation of sleep_type and then looking for it in micropyhton source )
This really got onto my nerves so I looked for a solution. I won't mention everything I tried but the solution that seems to work:
The wifi has different sleep modes and the default is SLEEP_MODEM. You can change the mode to SLEEP_NONE with:
Code: Select all
import esp
esp.sleep_type(esp.SLEEP_NONE)
Since I changed this more than 24 hours ago, the node with RSSI -80dB has only reconnect twice and one time was a reconnect every other device also did so doesn't really count.
So the difference is really impressive: From reconnecting every ~2 minutes it now only reconnects 1-2 times a day!
This function was of course implemented a long time ago but I couldn't find any information on the forum about it so I thought I'd share this in case someone else has trouble with his wifi reliability too. (I only found this function after searching for the reconnect error, going through the arduino implementation of sleep_type and then looking for it in micropyhton source )