Page 1 of 1

Problem with MQTT after Sleep

Posted: 04 Jan 2019, 22:52
by trikidiki
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.

Re: Problem with MQTT after Sleep

Posted: 04 Jan 2019, 22:57
by grovkillen
You should probably try a later version.

Re: Problem with MQTT after Sleep

Posted: 05 Jan 2019, 01:42
by trikidiki
Thanks for the suggestion. It's all working now.

I assumed it was me doing something wrong.