sui77 / rc-switch

Arduino lib to operate 433/315Mhz devices like power outlet sockets.
1.89k stars 653 forks source link

Recevier improvements - setReceiveUsingProtocolTiming() and setReceiveUnknownProtocol() #418

Open pierzogad opened 3 years ago

pierzogad commented 3 years ago

This library is using initial synchronisation pulse to determine base delay value used for decoding data. Some cheap transmitters use slightly shorter synchronisation pulse and, as a result, system is unable to recognize the data sent.

Setting setReceiveUsingProtocolTiming(true) tells library to use standard delay for protocol (e.g. 350 microseconds for protocol 1) to decode input. This makes receiver more robust - able to receive data that otherwise was ignored.

This is used as debugging aid only. When system is unable to recognize any valid protocol it produces no output. It is difficult to tell is system didn't receive any data or was unable to decode it. With setReceiveUnknownProtocol(true) you can see the dump of timers even if no valid protocol was recognized. The ReceiveDemo_Advanced example was updated to use it.