merbanan / rtl_433

Program to decode radio transmissions from devices on the ISM bands (and other frequencies)
GNU General Public License v2.0
5.91k stars 1.3k forks source link

Add ability to coalesce repeated transmissions (without CRC, into a "checksummed" message) #2957

Open gdt opened 1 month ago

gdt commented 1 month ago

Many protocols have a checksum or CRC and thus when it decodes we can be reasonably sure it was an actual transmission and not noise. In theory, we more or less default-enable decoders that have this property and decline to default-enable those that do not, to prevent lots of bad output from just running rtl_433 without arguments.

Many devices send transmissions multiple times in a burst. It is not clear if this is intended to be FEC, where each bit can be voted, or if it is intended to cause reception if any transmission is not clobbered by something else. We have a ticket to suppress duplicates, #2640.

Surely some devices that transmit multiple packets lack a checksum or CRC (and thus can't be default-on). One could write code to accumulate these and emit a decode if there are multiple matching transmissions. It would then have a new MIC type repeated, and those decodes could be default-on.

It is unclear if this should become the only mode for such devices, or if their should be two decoders, repeats only default on, and singles default off. IMHO if the device always repeats, it makes sense to only output repeated detects, unless some debug/test flag is on. I would then see a non-repeat as equivalent to a failed checksum. But I suspect others will see it differently.

zuckschwerdt commented 1 month ago

Decoders regularly use bitbuffer_find_repeated_row() or bitbuffer_find_repeated_prefix() and where a nominal repeat-count is known usually demand N/2+1 matches (the "majority").

It could complicated to do this in some general way as the nominal repeat-count is a wide range from 2 to ~20.

One possible problem using repeats as "good data" indicator is false positive "decodes": if a slicer can extract a repeated regular bit pattern (and not necessarily the original/intended one) we could get rows of seemingly good, identical data. This prominently shows with buffers full of just 0's or 1's (e.g. if all bits seem short or long for some PWM timings).