Problem with MQTT after Sleep

Moderators: Voyager, BertB, rtenklooster, Stuntteam, grovkillen, TD-er

Post Reply
Message
Author
trikidiki
Normal user
Posts: 3
Joined: 19 Nov 2018, 00:27

Problem with MQTT after Sleep

#1 Post by trikidiki » 04 Jan 2019, 22:52

I am a cludger, not even a tinkerer so please bear with me.

I have a NodeMCU with a BME280, DS18B20 and BH1750 sensors. I am running 20000 - Mega (core 2_3_0).

I can successfully read the sensors at regular intervals.
The readings are published to a Mosquitto broker running on a Pi 3. The data is then subscribed to by Node-Red which is graphing the data.
All's well.

However I need to run the NodeMCU from batteries and am using Sleep mode. It goes to sleep fine, wakes after the allotted time, reads the sensors and publishes to MQTT but not all the sensors are published. I have connected Syslog to tftpd64running on a Windows laptop which is displaying all the sensor reading in the log. The DS18B20 data is missing and more strangely the Pressure from the BME280 is missing completely, the Temp from the BME280 is missing intermittently, whereas the Humidity is always present. When not in sleep mode the Humidity is reported after the Temp but before the Pressure. The light measurements from the BH1750 are also intermittent. Subscribing to the broker directly on the Pi shows the data is missing so I'm assuming Node-Red is not involved in the problem.

I have tried extending the time the NodeMCU is awake to 1 minute which gives it tons of time to send repeated readings but the symptoms remain the same.

Any help would be appreciated.

User avatar
grovkillen
Normal user
Posts: 3034
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Problem with MQTT after Sleep

#2 Post by grovkillen » 04 Jan 2019, 22:57

You should probably try a later version.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

trikidiki
Normal user
Posts: 3
Joined: 19 Nov 2018, 00:27

Re: Problem with MQTT after Sleep

#3 Post by trikidiki » 05 Jan 2019, 01:42

Thanks for the suggestion. It's all working now.

I assumed it was me doing something wrong.

Cheers

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests