don

Click Plus and MQTT

4 posts in this topic

I'm a first time Automation Direct user setting up a Click PLus as a publishing client using MQTT.  I've got a mountain top, solar site with 3 analogs pressures.  Non-mission critical data, just nice to have.  I got the MQTT stuff working and am using aa cloud based Node Red instance (it's on the MQTT broker service) to publish the data as 3 gauges on a web page.   I've got all of that working, but am trying to figure out to determine if the data is stale.  In the winter, we only get 4 or 5 days daylight, so the batteries die and we loose communications daily.  I need to figure out a Node Red flow when the data is stale and flag it on the pressure gauge display.  I'm thinking of having a free running clock in the PLC, and do a compare in Node Red to determine if it gets stuck.  I was just wondering if anyone has any other ideas on how to do it.

Edited by don

Share this post


Link to post
Share on other sites

What I typically do is set up a hearbeat, a flasher. I usually have them anyway for blinking lights at different rates, so I just send that bit as part of a word of flag bits that get sent. Both stations in the link generate and send a heartbeat so both can check the bit to see if it stops blinking. Blink rate should be much slower than your packet rate to make sure you see both states.

Share this post


Link to post
Share on other sites

I'm also looking into Last Will and Testament (LWT) which is part of MQTT protocol.  I think that may do the trick.

Share this post


Link to post
Share on other sites

Super easy solution - the published data triggers a time-out node in Node Red.  The timer is set 2 or 3 times longer than the publish rate.  If it times out, the data is stale and can be flagged as such.  Thanks for the suggestions.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now