OPEnSLab-OSU / SlideSentinel

⛰️Low-cost landslide monitoring system with centimeter-level precision
https://github.com/OPEnSLab-OSU/SlideSentinel/blob/feature/photoHosting/Documentation/Photos/Diagrams/AGU%20Slide%20Sentinel%202019%20FINAL%20.png
4 stars 4 forks source link

Base will acknowledge a transmission while flagging it as a retry. #56

Closed AleksVidmantas closed 1 year ago

AleksVidmantas commented 1 year ago

This takes place on fullrewritetest at the current date.

AleksVidmantas commented 1 year ago

FOR REFERENCE: justin....@gmail.com 4:35 PM (8 minutes ago) to radiohead-arduino Hi,

I added a fix a while ago for what sounds like this exact issue. You can set RH_ENABLE_EXPLICIT_RETRY_DEDUP in RHReliableDatagram.h to 1 to enable my fix that checks an explicit retry bit so the server will know not to dedupe the latest message containing the same seen ID as before (since every time your client device starts up, it resets the ID to zero -- essentially always sending an ID of zero).

You can see what it is doing by search for the usage of RH_ENABLE_EXPLICIT_RETRY_DEDUP in RHReliableDatagram.cpp.

Currently you have to manually flip this value in the library itself. A few months ago I proposed a change that would make this configurable via a compiler arg so consumers can change this value without having to make changes to the lib source locally. Mike indicated that he would include this in the next release (this was in March/April of 2022, and the last release was 2022-02-02, so I don't think it has made it in yet). Here is the thread related to making it overridable: https://groups.google.com/u/1/g/radiohead-arduino/c/SyXyJe5vVKo

You should just be able to modify this flag in your local lib source. Just be aware that you will need to do this again if you upgrade the lib. Hope this solves your problem.

AleksVidmantas commented 1 year ago

The issue was that the rover would send 1 message per wake cycle. The rover defaults to message ID 0 when turned on. Supposedly the base stores the ID of the last message. When the rover wakes up, the ID is 0 again matching the base's, causing it to get flagged as a duplicate.

Additionally, setting RH_ENABLE_EXPLICIT_RETRY_DEDUP to 1 helps a lot too by always accepting the 1st message from a message batch even if the IDs match.

Reference: https://groups.google.com/g/radiohead-arduino/c/RrotYzGOuEU/m/kEn7C6SRAQAJ?utm_medium=email&utm_source=footer

NOTE: I believe this only happens if the 1st transmission fails, in addition to all of the above circumstances.