Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiFi disconnects after a day #6

Closed
k-janssens opened this issue Mar 16, 2022 · 14 comments
Closed

WiFi disconnects after a day #6

k-janssens opened this issue Mar 16, 2022 · 14 comments
Labels
bug Something isn't working

Comments

@k-janssens
Copy link
Contributor

As title suggests, the WiFi connection stops working after a day or so.
On the EVSE I can see the message "not connected to WiFI", after cycling the power it immediately is back up and running.

There is an AP only a few meters away, rebooting the AP does not work.
Other devices connects without issues with this AP.

@mstegen mstegen added the bug Something isn't working label Mar 16, 2022
@mstegen
Copy link
Member

mstegen commented Mar 16, 2022

Ok, thanks for the bug report.
i'll see if i can improve the Wifi reconnect functionality.

@fluppie
Copy link

fluppie commented Mar 18, 2022

@k-janssens
Copy link
Contributor Author

k-janssens commented Mar 20, 2022

Not sure why but at the moment I didn't have this problem any more for the past few days

Edit: Spoke too soon ... :)

@cvanlith
Copy link

cvanlith commented Apr 5, 2022

I am not sure if this is related, but my router reports as active host name: SMARTEVSE-99999 (99999 = AP #). Nevertheless I can not reach the controller on that name. The controller can be reached on SMARTEVSE-0000 (0000 = serial #).

@deqw
Copy link

deqw commented Apr 9, 2022

See this WiFi disconnects too. Disabling and again enabling WiFi will do. Prefer automatic recovery or not disconnecting at all (or both ;o). Thanks for the good work!

WiFi.setAutoReconnect(true);
WiFi.persistent(true);
Right after connecting to Wi-Fi.
When the connection is lost, it will automatically reconnect.
https://randomnerdtutorials.com/solved-reconnect-esp32-to-wifi/

hliebscher pushed a commit to hliebscher/SmartEVSE-3 that referenced this issue Apr 24, 2022
* Added 3f support

* Added 3f support

* Added 3f support

* Added 3f support

* Index page fix

* Added 3Phase menu item

* Added 3Phase menu item

* Added 3Phase menu item

* Added 3Phase menu item

* Disabled turning on C2 on rest call, needs work

* Mergeback from master

* Mergeback from master

* Obsolete

* Update

Co-authored-by: Koen Serneels <[email protected]>
@Fixh1
Copy link

Fixh1 commented Sep 27, 2022

I allso have the disconnecting wifi-problem. I'll try the :
WiFi.setAutoReconnect(true);
WiFi.persistent(true);
And see if it gives some improvement.

@deqw
Copy link

deqw commented Sep 27, 2022

@Fixh1 The problem was finally solved here: https://github.com/serkri/SmartEVSE-3
So maybe you take a look what was done there to solve this WiFi problem and update the code here too.

@mstegen
Copy link
Member

mstegen commented Sep 27, 2022

I have tried the
WiFi.setAutoReconnect(true);
WiFi.persistent(true);
but it did not work, the controller would not automatically reconnect anymore.

I have not experienced wifi issues myself, so difficult to test.

@Fixh1
Copy link

Fixh1 commented Sep 27, 2022

Hi @deqw,

Is it the disconnect handling that causes the problems, or the websocket part?
The first part is fairly easy, the last part is quit a lot of work...

@Fixh1
Copy link

Fixh1 commented Sep 27, 2022

Hi @mstegen ,

I have experience a lot of problems with the WiFi, so testpossibilities enough :-(
I have build the SmartEVSE into an existing housing made from aluminium, so the Wifi is sometimes very poor.
Is it possible to connect an external antenna to the ESP32-WROOM? I've seen a youtube video where they connected an SMA connector.

@deqw
Copy link

deqw commented Sep 27, 2022

@Fixh1 I think they got rid of the websocket code in that serki fork, so if that is indeed the case it is the handling.
Maybe @k-janssens can shine a light on that.

@Fixh1
Copy link

Fixh1 commented Sep 28, 2022

Yesterday I did a fruitless attemp with this code:

WiFi.onEvent(onWifiEvent);

void onWifiEvent(WiFiEvent_t event) {
switch (event) {
case WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_GOT_IP:
_Serialprintf("Connected to AP: %s\nLocal IP: %s\n", WiFi.SSID().c_str(), WiFi.localIP().toString().c_str());
break;
case WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_CONNECTED:
_Serialprint("Connected or reconnected to WiFi\n");
break;
case WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
if (WIFImode == 1) {
_Serialprint("WiFi Disconnected. Reconnecting...\n");
//WiFi.setAutoReconnect(true); //I know this is very counter-intuitive, you would expect this line in WiFiSetup but this is according to docs
//look at: alanswx/ESPAsyncWiFiManager#92
//but somehow it doesnt work reliably, depending on how the disconnect happened...
WiFi.reconnect(); //this works better!
}
break;
default: break;
}
}

But that did not help. The connection is lost again.
Tonight I'll have a look at the websocket.
I think I will just remove it, and put all the variables in at generation of the page.
See if that stabilizes the connection.
The RSSI was -90, so very poor I think.

@Fixh1
Copy link

Fixh1 commented Sep 28, 2022

The good news is that the thing is still charging the car.
By the way, I got a communication error this morning: The Irms was not received anymore via the ModBus.

@mstegen
Copy link
Member

mstegen commented May 24, 2024

I hope the connection issues were solved. As the current software version is based on Serkri/Dingo35's work, and i have not seen this issue mentioned anymore, i'll close this issue.

@mstegen mstegen closed this as completed May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants