-->
Page 1 of 1

Does connecting in setup() maintain the wifi link?

PostPosted: Fri Dec 30, 2016 1:23 pm
by sprior
Until now I've programmed the ESP8266 in NodeMCU and have appreciated that once you set up the wifi connection at startup, the ESP8266 under NodeMCU seems to reconnect if the wifi is dropped and will continue to re-establish the link without any additional user code to do so.

I've seen lots of example ESP8266 code in the Arduino environment and see that it calls Wifi.connect() in the setup() code which runs once. The code I've seen then doesn't later check whether the connection is still up or do anything to reconnect. Does this mean that the ESP8266 processor itself does everything required to maintain the wifi link without either NodeMCU or Arduino code to check/reconnect? Device loggers which run for weeks/months/years need to allow for wifi glitches and reconnect when possible.

Re: Does connecting in setup() maintain the wifi link?

PostPosted: Sun Jan 01, 2017 2:48 pm
by mrburnette
I think you should probably read some of the comments regarding this:
https://www.google.com/search?q=esp8266+arduino+wifi+disconnect+retry+connect

I have personally not had issues, but I think that it really depends on what you are expecting ...


Ray