Hi everybody,
First, thanks for the lot of contributions which helped me !
Please, I've got (perhaps a stupid) question :
I use ESP to read an DHT22 sensor and publish values onto MQTT topics (standalone mosquitto broquer)
My lan config uses a dhcp.
And I want to use deep sleep to make some tries for a battery supplyed hardware.
I know that after "awaking", the ESP restart from zero and execute void setup() (which also contains the esp_deep_sleep_start())
My question is : are the endless connectig and deconnecting (to dhcp and MQTT broque) requests dangerous for the mqtt broker or the dhcp of my box (I'm affraid, perhaps of some overflow somewher) ?
And second question : is this method of connecting every minutes for some seconds a "normal" usage of the deep sleep functionnality ?
Many thanks
Eric
ESP-32 Deep Sleep MQTT
-
- Posts: 1706
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: ESP-32 Deep Sleep MQTT
Not a problem at all.
If you want to be extra nice, you can cleanly disconnect from the MQTT broker before turning off WiFi/going to sleep. Then the broker can immediately release/reuse the resources associated with your connection instad of waiting for a timeout on a keep-alive which never arrives.
Yes, that's a common/normal scenario and probably as energy-efficient as it gets if you have to use WiFi. (Depends on the wake-up interval. If you shorten it, at some point it becomes more efficient to stay up in modem-sleep instead of wasting seconds of WiFi power to reconnect to the AP each time.)And second question : is this method of connecting every minutes for some seconds a "normal" usage of the deep sleep functionnality ?
Re: ESP-32 Deep Sleep MQTT
Thank you very much ...
This answer was verry clear and that helped me a lot !
This answer was verry clear and that helped me a lot !
Who is online
Users browsing this forum: Google [Bot] and 106 guests