ESP32 auto sleep?

buster
Posts: 15
Joined: Sun Jan 24, 2021 11:43 am

ESP32 auto sleep?

Postby buster » Wed May 12, 2021 5:50 pm

I have an ESP32 wrover module which seems to "fall asleep" by itself. Probebly it is something else but it looks like this.
The module is connected to wifi and gets sensor data, sends it to a webserver and does this every X seconds. It also has an RGB strip to show some modes (blue light is normal, red light is no wifi, purple is updating etc).

For some reason, the device stops connecting to the server after some amount (random) of time. I have ubiquiti access points and i am still seeing the device connected to the access point, but the wifi experience is 100% constant (normally fluctuating between 90 and 100%), see below.

Image


I can reconnect the device via ubiquiti but nothing happens.

I did build in some code to see if the device has a wifi connection and if it doesnt it will reconnect. If it can't get a wifi connection for 1 hour it will reboot.

The problem is that the device seems to halt all of its running processes. I have connected the device to the computer now but it works perfectly. If i disable wifi it shows the message that wifi is disconnected and keeps trying to reconnect, after wifi comes back again it reconnects and it works again. The other problem is that it can work for a few days and all of a sudden it stops working. I am not sure how to debug this since i can't access it via wifi.

What could cause this problem? Can the ESP32 go into sleepmode at some scenario?
Thanks for helping me with my difficult explanation

buster
Posts: 15
Joined: Sun Jan 24, 2021 11:43 am

Re: ESP32 auto sleep?

Postby buster » Thu May 13, 2021 6:59 am

I just don't want to let it sleep. My question was if the ESP32 goes into sleep by itself without me doing that? Because it feels like the ESP32 goes into kind of a sleep mode with WiFi enabled but not getting a connection.

It could be something else but it feels like that

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 auto sleep?

Postby ESP_Sprite » Thu May 13, 2021 7:22 am

Sorry, that guy was a spambot looking for keywords and trying to copy-paste a response that doesn't look out of place. I've banned it and deleted the reply.

That being said, this is not known behaviour of an ESP32. It would be most useful if you could somehow get the serial log at the time the issue happens, but if it doesn't show the issue when hooked up to a laptop, that may be a problem... Just to check, what do you use as a power supply? In general, a bad PSU can lead to weirdness.

buster
Posts: 15
Joined: Sun Jan 24, 2021 11:43 am

Re: ESP32 auto sleep?

Postby buster » Thu May 13, 2021 1:26 pm

Maybe the ESP32 is damaged?

I am using this PSU: Mean Well IRM-03-3.3
I have connected more than only the EPS32, but tested with a lab power supply, the max current it uses is about 400 / 500 mA

Connecting it to a pc is possbile, but the problem is that it could take many days before the fault happens again and i am not able to keep it running 24/7 for multiple days

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 auto sleep?

Postby ESP_Sprite » Fri May 14, 2021 3:08 am

Yeah, that PSU should do the trick (given that you use wires/traces to the ESP32 that aren't too long). Not sure what else can be wrong... for what it's worth, I have a bunch of ESP32 chips taking to Ubiquity APs as well, and I'm not seeing the thing you're seeing.

Any chance you can get e.g. a Raspberry Pi to log the output of the ESP32?

OT: That is a cute little power supply. Didn't know Meanwell made those. That's going on my list.

buster
Posts: 15
Joined: Sun Jan 24, 2021 11:43 am

Re: ESP32 auto sleep?

Postby buster » Fri May 14, 2021 5:37 am

Any chance you can get e.g. a Raspberry Pi to log the output of the ESP32?

Can you explain how? Via rx/tx?

I think i will be able to do that, i made a pcb so i am not sure if i can get alle the right connections but i may be able to find out how to do so.

What / how do i log to a raspberry pi

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 auto sleep?

Postby ESP_Sprite » Sat May 15, 2021 8:10 am

Easiest way would be to take whatever you use to program the ESP32 and plug it into an USB port on the Raspberry Pi. But you can also use the RX/TX pins, if you're okay with diving into how to enable it.

buster
Posts: 15
Joined: Sun Jan 24, 2021 11:43 am

Re: ESP32 auto sleep?

Postby buster » Mon May 17, 2021 7:05 am

The annoying thing is that the ESP32 is soldered on my PCB so it is difficult to add that module to usb (i don't have usb connectivitiy on my PCB).

I have tested a little more and so far the modules haven't disconnected yet (since last week). If it does disconnect again i will try to figure out how to connect it to a raspberry pi.

Thank you for helping me with this

Who is online

Users browsing this forum: No registered users and 140 guests