I want understand the PubSubClient library

I'll try and provide the brief version. I'm working with what is essentially this hardware. I'm publishing the temperatures via MQTT to a broker I have running locally on a Raspberry Pi.

I testing 2 different examples and looking to modify them.

Example 1 uses the ESPAsync TCP library.

Example 2 uses the PubSub client library.

Both examples work out of the box. But I need deep sleep mode both to help prevent the DH11 from getting heat soaked, and to maximize battery life of the device.

I've managed to get example 1 working via a bad hack that contains a race condition waiting to happen (but hasn't manifested yet on my hardware).

So I'm looking into example 2 to see about modifying it. Before just hacking on the code, I was trying to read up on the PubSub client library to see if it has any similar 'gotchyas' I should be aware of before I start hacking at things.

Touch here for the full post on the Arduino Apprentices tumblr

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s