xoseperez / espurna

Home automation firmware for ESP8266-based devices
http://tinkerman.cat
GNU General Public License v3.0
3k stars 638 forks source link

Sonoff RF Bridge with direct hack mode does not send all learnt codes properly #2423

Open aguedob opened 3 years ago

aguedob commented 3 years ago

Bug description Certain RF codes learnt by Sonoff RF Bridge are not sent properly. Learnt codes starting with C001... are transmitted properly but codes starting with C002... not.

Steps to reproduce Learn a code starting by C002xxx and toggle switch button. The RF signal was already tested with a Sonoff RF bridge without the hack using another firmware.

Expected behavior Code to be sent and recognised by the target device.

Device information Both codes seems to be sent, but only C001019218FCACFE is recognised:

[293323] [RELAY] #0 scheduled OFF in 0 ms
[293332] [RELAY] #0 set to OFF
[293333] [RF] Enqueuing MESSAGE 'C00200001805E94D' 1 time(s)
[294335] [RELAY] Relay mask: 0b0
[297059] [WEBSOCKET] Requested action: relay
[297060] [RELAY] #0 scheduled ON in 0 ms
[297068] [RELAY] #0 set to ON
[297071] [RF] Enqueuing MESSAGE 'C00200001805E94D' 1 time(s)
-ERROR: Command line buffer overflow
[298073] [RELAY] Relay mask: 0b1
[302105] [WEBSOCKET] Requested action: relay
[302106] [RELAY] #1 scheduled ON in 0 ms
[302120] [RELAY] #1 set to ON
[302121] [RF] Enqueuing MESSAGE 'C001019218FCACFE' 1 time(s)
[303123] [RELAY] Relay mask: 0b11
[303368] [WEBSOCKET] Requested action: relay
[303369] [RELAY] #1 scheduled OFF in 0 ms
[303374] [RELAY] #1 set to OFF

Note: Not sure if it's relevant, but Command line buffer overflow message appears randomly while toggling the switch with the affected code learnt.

mcspr commented 3 years ago

Another thing that came to mind - what about 'times' setting / parameter for the code?

https://github.com/xoseperez/espurna/commit/52a244db6e9fe4ad373b580ed4e504c0d84d6afd Just to test some things, going into the terminal on one device:

rfb.send C00200001805E94D,4
[212884] [RF] Enqueuing MESSAGE 'C00200001805E94D,4' 4 time(s)

And receiving on the other:

[143624] [RF] Received code: C00202831805E94D
[144128] [RF] Received code: C00202881805E94D
[144643] [RF] Received code: C00202891805E94D
[145147] [RF] Received code: C002028B1805E94D

(same fw version obviously)