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

When restarting after a power failure, the ESP32 will no longer reconnect to WIFI #757

Open
Ripable0 opened this issue Jan 29, 2024 · 5 comments

Comments

@Ripable0
Copy link

Hello dear Homespan community!

I have the following problem:
After we had a power outage a few days ago, I noticed that my garden gate control, which I implemented with Homespan, no longer worked.
I connected the laptop to the ESP32 to see what was going on. After establishing the connection, I finally saw on the serial monitor that the ESP32 reconnected as if by magic after establishing the USB connection.

I reproduced this phenomenon, it's the same every time.

If the ESP32 has a power interruption, it will no longer establish a WIFI connection. Only when I want to check the Arduino with the serial monitor is a connection established as if nothing had ever happened.

I tried replacing the 5V relay with a 3V relay, but the ESP reaction remains the same.

Has anyone had problems like this?

@HomeSpan
Copy link
Owner

To confirm, if you connect the laptop to the ESP32 it connects fine to HomeKit? But if you unplug the ESP32 from the laptop and power it directly, it stops communicating with HomeKit? I assume you are not moving the ESP32 during this test so it's not the case that the device is going in/out of range.

How are you powering the ESP32 when it is not connected to a laptop? When connected to the Serial port, is the connection direct, or are you using a Serial-to-USB converter?

@frankonski
Copy link
Contributor

Depending how serial monitoring is done, I have seen boards rebooting when the connection is established. So connecting to USB might be simply rebooting the device and you’d lose the reason of the disconnect.

@Ripable0
Copy link
Author

Ripable0 commented Feb 13, 2024

To confirm, if you connect the laptop to the ESP32 it connects fine to HomeKit? But if you unplug the ESP32 from the laptop and power it directly, it stops communicating with HomeKit? I assume you are not moving the ESP32 during this test so it's not the case that the device is going in/out of range.

How are you powering the ESP32 when it is not connected to a laptop? When connected to the Serial port, is the connection direct, or are you using a Serial-to-USB converter?

No if i connect my laptop to the ESP32 it connects and reboots normally. When WIFI connection is established, i can unplug my laptop and from this time on, it runs fine, until the next power outage.

The only problem is the restart of the ESP32 after an power outage. At this time the ESP32 will not connect to wifi as it normally should.

@HomeSpan
Copy link
Owner

Sorry, I'm not following. Can you please explain the details of your setup, the exact chip you are using, how it is all powered, what, if anything changes, if you turn off the power to the chip and then turn it back on, etc. What the symptoms are, etc.

@andywaplinger
Copy link

@HomeSpan @Ripable0 I think this is the problem/solution he's having #131 (comment)

I was having the same issue until I found that thread. In my case, I added bool disableUSBserial = false; at the top of my sketch to quickly enable/disable the serial, then in my setup I have

  if (disableUSBserial == true) {
    pinMode(3,INPUT_PULLUP);
  };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants