See FIX to my problem at the bottom of this answer
Disconnected from computer after applying patch and Ran espaper for 16 hrs on battery, always reconnected 09/3/18 12:06 PM Thanks Marcel
******************** Responded 09/02/2018 4:18 PM Replacd password with XXXXXXX for security
as to the version I'm using... Latest commit 9407952 16 days ago
when I try to use the link you provided I get a 404
"We couldn’t find any repositories matching "
*********************
with my existing code ( NO disconnect added),
note I have added a few more prints and also changed the try loop from 20 to 50 and delay from 500 to 1000ms.
I recompiled the existing code and redownloaded into espaper unit. Connected after 3 tries
+++++++++++++++++++== Monitor output ++++++++++++++ updated at 1:54:02
NOTE. It always seems to connect after a download?
***********set register Start**********
***********set register end**********
Loading config
WIFI_SSID = [William_Lynn]
9
WIFI_PASS = [XXXXXXXX]
9
DISPLAYED_CITY_NAME = [ADA, Mi]
19
OPEN_WEATHER_MAP_APP_ID = [53e79ffdfb91498a8adf0fd05c8525cb]
23
OPEN_WEATHER_MAP_LOCATION_ID = [4993125]
28
OPEN_WEATHER_MAP_LANGUAGE = [en]
25
Loaded config
State: 1
[William_Lynn][XXXXXXXX]...Connected to WiFi
About to call OpenWeatherMap to fetch station's current data...
Getting url: http://api.openweathermap.org/data/2.5/weather?id=4993125&appid=53e79ffdfb91498a8adf0fd05c8525cb&units=imperial&lang=en
[HTTP] GET...
[HTTP] GET... code: 200
start document
Getting url: http://api.openweathermap.org/data/2.5/forecast?id=4993125&appid=53e79ffdfb91498a8adf0fd05c8525cb&units=imperial&lang=en
[HTTP] GET...
[HTTP] GET... code: 200
start document
Waiting for time
DST Rules Updated:
DST Start: Sun Mar 11 02:00:00 2018
DST End: Sun Nov 4 01:00:00 2018
WiFi: 44%
Min temp: 72.019997, max temp: 86.739998
Writing buffer
full init
***********set register Start**********
***********set register end**********
Going to sleep
+++++++++++++ this was original compleated connection, the temp was OK shows as 82F ++++++
################## 1st reconnect was successful at 2:13:23, also temp was OK at 82F #############
################2nd, 3rd and 4th Reconnects were NOT Successful ###############################
NOTE: Only display one unsuccessful reconnect
***********set register Start**********
***********set register end**********
Loading config
WIFI_SSID = [William_Lynn]
9
WIFI_PASS = [XXXXXXXX]
9
DISPLAYED_CITY_NAME = [ADA, Mi]
19
OPEN_WEATHER_MAP_APP_ID = [53e79ffdfb91498a8adf0fd05c8525cb]
23
OPEN_WEATHER_MAP_LOCATION_ID = [4993125]
28
OPEN_WEATHER_MAP_LANGUAGE = [en]
25
Loaded config
State: 1
[William_Lynn][XXXXXXXX]..................................................
Connection Tries i= 51
Could not connect to WiFi
Writing buffer
full init
***********set register Start**********
***********set register end**********
Going to sleep
######### One Successfull reconnect, followed by Several UNSUCCESSFUL attempts.
NOTE: I made your suggested change
( Add your suggested change WiFi.disconnect() after line 120 in main loop.
WORKED. Ran for 10 updates and they ALL worked as expected. No Failures.
Thanks for your help.