Hello to all,
I setup a Heltec 32 Kit to run as a station.
I try to reconnect Wifi after a lost of link with router AP.
So I tried to use the functions:
WiFi.setAutoReconnect(true); //* Set whether module will attempt to reconnect to an access point in case it is disconnected
and
WiFi.reconnect()
Reconnect the station. This is done by disconnecting from the access point an then initiating connection back to the same AP.
But this feature don’t running from my side.
To reconnect, I just re-use my initial setup made at starting:
WiFi.mode(WIFI_STA); //* Station Mode
WiFi.setAutoConnect(true); //* Configure module to automatically connect on power on to the last used access point
WiFi.setAutoReconnect(true); //* Set whether module will attempt to reconnect to an access point in case it is disconnected
WiFi.setHostname(_HOSTNAME); //* Give an unique name of the hardware
WiFi.begin(_SSID, _PASSWORD); //* Launch Wifi
This solution running, but from my side, I think, it’s not very “clean”.
I read severals topic about this reconnect subject, but from my side I don’t found a “right” solution.
Do you have an idea, to use reconnect feature in right way ?
Best Regards.
Christophe.