ESP32 doesn't stay online

Unfortunately not. With Unifi I’m able to block and unblock certain devices. This way the client needs to reconnect after it gets unblocked. I think this is the same as before with Apple TC where I restarted it and forced the reconnect this way. BTW I refreshed the ESP32 for this (also erased flash) So the following happens:

Connected ESP8266 → blocking ESP8266 → unblocking → reconnects instantly

Connected ESP32 → blocking ESP32 → unblocking → stays offline → unplug/replug device → reconnects instantly

@1technophile So now I think this means this is not an issue of my network any more, this must be an issue of the omg device.

I’m working on changing completely the connexion management. I will keep you updated.

1 Like

Hi All,

I’m completely new to ESP32, so have some patience with me :-).
I flashed a ESP32 with the binary (BLE) using the flash download tool. After flashing the ESP creates the setup network. Logging in works and enables the setup. So entering the network credentials is initially successful. The ESP reconnects and I see it appearing in my router. Ping also works. However after a while (within the minute) the ESP32 disconnects from the network. The OpenMQTTnetwork pops up again and, after connecting, the setup screen appears. Network settings are empty.
I tried another program, and the ESP32 stays connected (flashed with Arduino IDE).
I have a Ubiquiti Unify AP and a Netgear router behind it. Ubiquiti is mentioned in this thread as a cause.

So question: is this related to the problem in this thread or am I doing something wrong.

Thx,

Ralph

Hey all.

I have the same problem.
I have the esp32 with the ble firmware version 0.93.
My access point is a Ubiquiti long range and behind it is an Asus router. I have given a static ip to the esp32 in my router software., but still it will disconnect sometimes. Then the esp32 is making a ap itself and if I login to this, the config is empty. If I fill it out again, then it will connect again for a while before it disconnects.

Don’t have any problems with any other devices on my network and never had any problems. Only this openmqttgateway on the esp32 is causing problems.

Kind regards Simon

Hi,

It seems that there is an issue with these Ubiquiti AP, could you connect the esp32 to a serial monitor and get the serial output before it resets?

I have found this:

Could you try with :
esp32_platform = espressif32@1.8.0

here:

I restarted the AP today and then I saw that the esp32 was not able to re-connect (see below) even if the AP is up running and fully functional serving other clients

I have not tried with esp32_platform = espressif32@1.8.0 yet. Is this still recommended? I’m running v 0.9.3

See below, this goes on forever, a hard reset is needed

Could you indicate the model of AP used ?

You can try with 1.8.0 to see if it helps.

The AP is a dedicated RPi I configured as an AP to make it easier to test the esp32 reconnection ability (without having to turn my main AP on/off during testing)

https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md

Using the Raspberry Pi as an access point to share an internet connection (bridge)

Thanks i would be interested by your feedback with 1.8.0

Yes, running now with 1.8.0 since yesterday

So it happened again, it seems not to be related to platform version then

While it is looping round and round, it seems it does not even try to connect to the AP. I have verified the AP is fully operational and when connecting other devices (esp32, iphone, macbook etc) it works perfectly. I also have a second esp32 openmqttgateway (without the BLE scanning) connected to the same AP and this works without similar problems, it does so far not lose connection with the AP

Anything you want me to check before I kill and restart the esp32?

Thanks for the feedback,
Could you indicate please the configuration of this openmqttgateway?

No, you can restart it. My main blocking point there is the fact that I’m not reproducing the issue on my environment

This is the configuration for the esp32, see below
Do you have some idea why/where it is staying in that loop and why it is not trying to break out and look for the AP?

Kind regards, Walter

platformio.ini
image
User_config.h


config_BT.h

How to reproduce

The ESP32 is running as expected, white list set since 2 days, still fine

Now turning off the wifi in the AP

Some minutes later after turning wifi on in AP

ESP32 not able to recover connection. The AP is fully operational, verified with other wifi connected clients

Thanks for these details, let me try to reproduce it

Hi again.
I changed to a Asus access point instead of my ubiquiti ap. It lasted for about a week. So much longer but it still reset and then unable to connect to ap again before I login and reapply my login details.
It seems to forget the login details, as it says no ap set. And I have to type everything in again.

Sadly I’m leaving for a couple of months now, so I can’t get any logs or anything as of now.

I’m on version 0.9.3 with ble scanning.

Kind regards Simon

Thanks for these infos, i will have the opportunity to test a different router in the following weeks and let you know.

Hello Florian,

I’ve tested, for the last three weeks, the same ESP32 previously used for MiFlora (which had the bad habit of disconnecting after a day or so) with ESPHome and it got to 100% availability, despite the fact that ESPHome adds some overheads in regard of the native HA integration (at least when I compared 2 ESP8266 with ESPHome and OMG with only an analog sensor, the one with ESPHome took about 1-1.5 second more to update with sensor value).

Sometimes is also the router fault (in each room I’m using sensors with ESP8266 flashed with OMG and DTH+LDR and they are usually working fine for 3-5 weeks in a row; however, all of a sudden, one or two ESP8266s start resetting the wifi connection while the others are working fine).

Hi Petrica,

Was it uploaded with v0.9.3 or a previous version ? [quote=“PetricaM, post:79, topic:570”]
they are usually working fine for 3-5 weeks in a row; however, all of a sudden, one or two ESP8266s start resetting the wifi connection while the others are working fine
[/quote]

Maybe I should add a macro to avoid the automatic reseting, or store on flash memory the fact that the esp connected one to avoid that.