radio transmission integrity check (using transmission time): how to perform?

Two Arduino's are connected for serial transmission using HC12 radio's. Arduino A only transmits, Arduino B only receives data; once every 20 minutes. In the transmitted package is contained the exact minute at which the transmission takes place (using DS3231 module for timekeeping).

What would be the best way for the receiver (which also contains a DS3231 module for timekeeping) to verify that no data package is lost (for example due to battery failure at the transmitter) or that the sent data contains the right minute value (integer)(for example due to transmission signal too low, or transmission corruption)?

Add a field with a sequence number to the data packets. The sequence number will be incremented by the transmitter after every packet. If the receiver does not see the expected number in the packet, it knows that one or more packets are lost.

You possibly want to cater for 'reboots' of the transmitter and receiver; e.g. store the last transmitted / received number in eeprom. Be aware that you can only write a single eeprom cell 100,000 times; without precautions, that means roughly 100,000 / 3 = 33,000 hours = ~3 years.

sterretje:
Add a field with a sequence number to the data packets. The sequence number will be incremented by the transmitter after every packet. If the receiver does not see the expected number in the packet, it knows that one or more packets are lost.

You possibly want to cater for 'reboots' of the transmitter and receiver; e.g. store the last transmitted / received number in eeprom. Be aware that you can only write a single eeprom cell 100,000 times; without precautions, that means roughly 100,000 / 3 = 33,000 hours = ~3 years.

Can the now.minute() value not be used as a sequence number? In case of transmission every 20 minutes for example 19, 39, 59?
I am however not sure how to write an algorithm for that?

If the currently received time is larger than the last received time by more than 20 minutes, you missed a signal.

This is easiest to do if you convert all times to seconds since some arbitrary date (as in Unix time). The Arduino TimeLib.h library is very useful for these operations.

brice3010:
Can the now.minute() value not be used as a sequence number? In case of transmission every 20 minutes for example 19, 39, 59?

What if you have received a message at 06:19, miss 06:39, 06:59 and 07:19 and receive 07:39 again? Your receiver will be very happy and not pick up that it missed a packet.

sterretje:
What if you have received a message at 06:19, miss 06:39, 06:59 and 07:19 and receive 07:39 again? Your receiver will be very happy and not pick up that it missed a packet.

Right!

If your receiver does miss packets, what are you going to do about it?
Since you have bi directional radios, why not use them in this mode, and if you get a corrupted packet, just ask for it again.

mauried:
If your receiver does miss packets, what are you going to do about it?
Since you have bi directional radios, why not use them in this mode, and if you get a corrupted packet, just ask for it again.

Very nice idea. I will work on that.