Hi I'm here data - heartbeat pulse

I want to have a remote monitoring unit send out a data stream of some repetitive sort, either pulses or data or some such, and then monitor that that is being received.

if there is garbled data, then a handshake of some sort to make sure there are no problems.

I was thinking that the mini on the remote sends our a pulse every couple seconds, then the uno in the house receives that and they both go merrily on their way.

if the pulse does not come, then the uno would send out a request and the mini would respond. and then they would go back to the mini sending out pulses at intervals.

is there a canned way to do this ? any suggestions ?

I will have power ground and 2 data lines. ideally, only one data line for a 3 wire connection.

Your requirements are too vague. First, you need to decide WHAT the remote unit is sending. Is it data, as in serial data, or pulses?

In addition to what @PaulS said ...

You could add a checksum to your data so the receiving device could verify correct reception.

...R

Robin2:
In addition to what @PaulS said ...

You could add a checksum to your data so the receiving device could verify correct reception.

...R

If the decision is to use a "heartbeat" pulse, adding a checksum to it might be challenging. :slight_smile:

dave-in-nj:
I was thinking that the mini on the remote sends our a pulse every couple seconds, then the uno in the house receives that and they both go merrily on their way.

if the pulse does not come, then the uno would send out a request and the mini would respond. and then they would go back to the mini sending out pulses at intervals.

I don't understand the purpose of the UNO's request. The Mini will be sending out regular messages anyway - it doesn't need a request from the UNO to tell it to do that, and I don't see what effect the UNO's message is intended to have on it. The only situation I can think of where this sort of thing might be called for is where the Mini doesn't know which device(s) it needs to send the messages to, so one (or more?) UNOs would register with it to request that it send them the messages. In that case it might make sense for the UNO to re-register after a timeout, in case the Mini has restarted and lost its registration state.

the term heartbeat pulse is a good description.

there is no other data, just checking that it is there and running.

if the heartbeat is lost, the idea is the UNO sends a request for a response.
when the Micro gets that, it should send a response, then restore the heartbeat pulse.

if the request fails, then the UNO would alert me to go check what happened.

if the heartbeat is lost, the idea is the UNO sends a request for a response.
when the Micro gets that, it should send a response, then restore the heartbeat pulse.

Why would the heartbeat get lost? Typically, that happens because the sender crashed or communications was disrupted. Sending a wake-up call to a crashed/offline computer is a waste of effort.

to accept failure without an attempt to re-establish could make a personal visit a wasted trip.

in one aspect, you are correct, just waiting a minute could have the unit reestablish a good signal.

dave-in-nj:
if the heartbeat is lost, the idea is the UNO sends a request for a response.
when the Micro gets that, it should send a response, then restore the heartbeat pulse.

I still don't understand what difference the UNO's request has made. The Mini is going to keep sending regular messages anyway, isn't it? What problem is the request from the UNO trying to solve?

Also, at what distance and through what medium?

Seems like any form of wireless transmitter/receiver combination with enough range and a periodic data pulse would work. If you are looking for just a "I'm here" pulse, then you can have it just transmit a specific short coded message that would be hard for noise to reproduce. Otherwise it could also contain information (Include a CRC).

The original post mentioned "a stream of data" and "if there is garbled data" - hence my suggestion for a checksum.

PeterH:
I still don't understand what difference the UNO's request has made. The Mini is going to keep sending regular messages anyway, isn't it? What problem is the request from the UNO trying to solve?

If it's a "here I am" transmission (I think it has to have enough data in it so the receiver knows it is coming from the correct device) I agree with @PeterH.

You need to carefully consider the failure modes and appropriate responses. If a remote slave device crashes the master can do nothing to restart it. Perhaps you need to use the watchdog timer in the slave. And maybe also in the master. You will also need to consider how you deal with gaps in transmission (or reception) while a WDT restart takes place.

...R

Don't forget to bounds-check the heartbeat. :wink: