-->
Page 1 of 1

ESP8266 and Arduino IDE - Automatic Reconnect

PostPosted: Mon Aug 21, 2017 8:43 pm
by cnunes
I'm trying to write my first program using arduino IDE. I apologize if the question is too silly. Is it necessary to check if the esp8266 lost the connection and try to reconnect or does the firmware attempt to reconnect automatically?

Re: ESP8266 and Arduino IDE - Automatic Reconnect

PostPosted: Tue Aug 22, 2017 3:55 pm
by QuickFix
cnunes wrote:I apologize if the question is too silly.

Don't worry, this is the "** Newbie Corner **" where there are no silly questions. ;)

You have to do everything yourself in code: connect, disconnect and re-connect when a connection is dropped.

Re: ESP8266 and Arduino IDE - Automatic Reconnect

PostPosted: Tue Aug 22, 2017 4:09 pm
by rudy
I believe the default is for the board to reconnect when a connection is dropped. That is why the code to connect can be put in the setup routine.

https://github.com/esp8266/Arduino/issues/2735

Problem manually handling WiFi reconnect

I'm trying to handle WiFi auto/reconnects in WIFI-STA mode but having troubles.
Setting WiFi.setAutoConnect ( true ) to auto connect on power up works just fine.

Setting WiFi.setAutoReconnect ( false ) on the other hand have issues. ...

Re: ESP8266 and Arduino IDE - Automatic Reconnect

PostPosted: Tue Aug 22, 2017 4:16 pm
by QuickFix
If that indeed is the case, I stand corrected. :idea:
(Thanks rudy, I'll keep that in mind, next time I'm having connect/reconnect issues)