sui77 / rc-switch

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

Sending 40 bits signal incorrectly #353

Closed sleepwalkera closed 4 years ago

sleepwalkera commented 4 years ago

Here is an 40 bits long signal which I have captured. image

Since the original rc-switch library can only handle 32bit signals.I've followed the wiki page "Add_New_Remote_Part_2", modified .cpp & .h files. Added new protocol { 340, { 14, 4 }, { 1, 2 }, { 2, 1 }, false }

Then I send the signal with the code I have decoded by hand to repeat the original signal. mySwitch.send("1001010110101100101101010000010100001111");

But I got a wave form with 8 bits bad and 32 bits correct. image The highest 8 bits should be "10010101", but the signal actually send was "00001111".

Then I tried to flip the highest 8 bits, send "0110101010101100101101010000010100001111", the signal actually send was still "00001111".

Then I tried change the highest 8bits with "00001111","11110000","10101010","01010101". The result is still the same.

Then I tried "0000000000000000000011111111111111111111", the result was "1111111100000000000011111111111111111111". Then I tried "1111111111111111111100000000000000000000", the result was "0000000011111111111100000000000000000000".

Then I tried "0000000000000000000000000000000000000000", "1111111111111111111111111111111111111111", "1010101010101010101010101010101010101010", "0101010101010101010101010101010101010101". The result is finally correct.

Sent with rc-switch Actually sent
1001010110101100101101010000010100001111 0000111110101100101101010000010100001111
0110101010101100101101010000010100001111 0000111110101100101101010000010100001111
0000111110101100101101010000010100001111 0000111110101100101101010000010100001111
1111000010101100101101010000010100001111 0000111110101100101101010000010100001111
1010101010101100101101010000010100001111 0000111110101100101101010000010100001111
0101010110101100101101010000010100001111 0000111110101100101101010000010100001111
0000000000000000000011111111111111111111 1111111100000000000011111111111111111111
1111111111111111111100000000000000000000 0000000011111111111100000000000000000000
0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
1111111111111111111111111111111111111111 1111111111111111111111111111111111111111
1010101010101010101010101010101010101010 1010101010101010101010101010101010101010
0101010101010101010101010101010101010101 0101010101010101010101010101010101010101

Have any one sent 40bits(or more) signal successfully? And did I miss something? Thanks

sleepwalkera commented 4 years ago

Have fixed in openmqttgateway version, closed.