ESPEasy deep sleep and MQTT

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Theguywhobea
Normal user
Posts: 1
Joined: 31 Jan 2020, 22:01

ESPEasy deep sleep and MQTT

#1 Post by Theguywhobea » 31 Jan 2020, 22:06

Hi everyone, new here.

I have a few NodeMCU compatible ESP8266 boards with a BME280 sensor on them, and a 100k resistor between A0 and battery +. Trying to run these on battery power as long as possible so I have it using deep sleep for 900 seconds, the sleep wake time is set to 10 seconds. The problem I am having is that the board goes to sleep fine and wakes fine, however it doesn't always push it's values to my MQTT broker on each wake cycle.

The weirdest part is that some wake cycles it will send the temp and humidity but not battery level, or vice versa. I don't understand why it wouldn't wake and write its values, especially since I can always get it to right new values every time I press the reset button manually.

Anyone here real good at these sleep wake cycles that knows what could be the reason? Should I set my interval on my devices to less than 10 seconds so I always get a scan in the wake timer window?

TD-er
Core team member
Posts: 2121
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPEasy deep sleep and MQTT

#2 Post by TD-er » 03 Feb 2020, 15:16

Well you will always have some fluctuation in how long it takes to get a WiFi connection.
Maybe you should try with a longer "awake time" and then put the ESP back to sleep from the rules.

Also please have a look at the controller settings.
Especially at the queue length + minimal send interval.

A while ago (some months ago) the code for the controllers was checking whether a successful wifi connection is made. As long as there wasn't any, the controllers were not given samples to send as they were simply not capable of doing anything with it.
But now we have the controller queues so it makes sense to at least hand the samples over to the controller queue so then it only differs whether all items in the queue can be sent out before the unit goes to sleep again.

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests