Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checksum? #1

Closed
vonnieda opened this issue Nov 25, 2020 · 9 comments
Closed

Checksum? #1

vonnieda opened this issue Nov 25, 2020 · 9 comments

Comments

@vonnieda
Copy link

Hi @akirjavainen - do you have any ideas of what the checksum algorithm might be? I'm trying to figure it out because I would like to be able to generate new commands without having to record them from a remote. If you have any guesses it might help me figure it out. Thanks!

@akirjavainen
Copy link
Owner

Hi! Honestly, I haven't even tried guessing how it's calculated or what it is. I've only had two remotes from A-OK and that is too less data to work with. It also relies on the fact if my interpretation of the tri-bit transmission is the same that the manufacturer is using (short HIGH = 0, long HIGH = 1). If you do make progress with this, I'd be very interested to know!

@vonnieda
Copy link
Author

vonnieda commented Nov 27, 2020

I have some information to add! :)

I have 10 remotes. 8 are single channel, 1 is 6 channel, and 1 is 16 channel. Here are pictures:

IMG_8941
IMG_8942

The multi channel remotes both have an "all call" mode, where the command is sent to all the channels. You select it by using the right or left buttons to go past the end of the channel numbers. On the 6 channel remote all 6 LEDs light up, and on the 16 channel remote it says "CC".

Using a Sonoff RF Bridge with Tasmota and Portisch installed I captured every command from every remote and every channel:

remote_sniffing.log

And here is a log of my parsed output from that file, using your description of the protocol:

# We start with the single channel remotes. For each one I send Up, Down, Stop, Program.
Bits 10100011011000111100010010101011000000010000000000001011110111101 (65), ID 146c789560200, Command 11 (UP), Checksum 27, Suffix 6
Bits 10100011011000111100010010101011000000010000000000100100111101111 (65), ID 146c789560200, Command 36 (AFTER), Checksum 30, Suffix 7
Bits 10100011011000111100010010101011000000010000000001000011000101101 (65), ID 146c789560200, Command 67 (DOWN), Checksum 2, Suffix 6
Bits 10100011011000111100010010101011000000010000000011000011100101101 (65), ID 146c789560201, Command 67 (DOWN), Checksum 18, Suffix 6
Bits 10100011011000111100010010101011000000010000000000100011111101101 (65), ID 146c789560200, Command 35 (STOP), Checksum 30, Suffix 6
Bits 10100011011000111100010010101011000000010000000001011010001011011 (65), ID 146c789560200, Command 90 (UNKNOWN), Checksum 5, Suffix 5
Bits 10100011011000111100010010101011000000010000000001010011001001101 (65), ID 146c789560200, Command 83 (PROGRAM), Checksum 4, Suffix 6
Bits 10100011011001100001111101110010000000010000000000001011000000111 (65), ID 146cc3ee40200, Command 11 (UP), Checksum 0, Suffix 3
Bits 10100011011001100001111101110010000000010000000001000011001110111 (65), ID 146cc3ee40200, Command 67 (DOWN), Checksum 7, Suffix 3
Bits 10100011011001100001111101110010000000010000000000100011000110111 (65), ID 146cc3ee40200, Command 35 (STOP), Checksum 3, Suffix 3
Bits 10100011011001100001111101110010000000010000000001010011010010111 (65), ID 146cc3ee40200, Command 83 (PROGRAM), Checksum 9, Suffix 3
Bits 10100011011000111010111001110110000000010000000000001011100100111 (65), ID 146c75cec0200, Command 11 (UP), Checksum 18, Suffix 3
Bits 10100011011000111010111001110110000000010000000000100100101011001 (65), ID 146c75cec0200, Command 36 (AFTER), Checksum 21, Suffix 4
Bits 10100011011000111010111001110110000000010000000000100011101010111 (65), ID 146c75cec0200, Command 35 (STOP), Checksum 21, Suffix 3
Bits 10100011011000111010111001110110000000010000000001010011110110111 (65), ID 146c75cec0200, Command 83 (PROGRAM), Checksum 27, Suffix 3
Bits 10100011011000111010111001110110000000010000000001000011110010111 (65), ID 146c75cec0200, Command 67 (DOWN), Checksum 25, Suffix 3
Bits 10100011011001100011100111011010000000010000000000100100100111101 (65), ID 146cc73b40200, Command 36 (AFTER), Checksum 19, Suffix 6
Bits 10100011011001100011100111011010000000010000000000001011100001011 (65), ID 146cc73b40200, Command 11 (UP), Checksum 16, Suffix 5
Bits 10100011011001100011100111011010000000010000000001000011101111011 (65), ID 146cc73b40200, Command 67 (DOWN), Checksum 23, Suffix 5
Bits 10100011011001100011100111011010000000010000000000100011100111011 (65), ID 146cc73b40200, Command 35 (STOP), Checksum 19, Suffix 5
Bits 10100011011001100011100111011010000000010000000001011010110101001 (65), ID 146cc73b40200, Command 90 (UNKNOWN), Checksum 26, Suffix 4
Bits 10100011011001100011100111011010000000010000000001010011110011011 (65), ID 146cc73b40200, Command 83 (PROGRAM), Checksum 25, Suffix 5
Bits 10100011011001100011010011110010000000010000000000001011100110001 (65), ID 146cc69e40200, Command 11 (UP), Checksum 19, Suffix 0
Bits 10100011011001100011010011110010000000010000000000100100101100011 (65), ID 146cc69e40200, Command 36 (AFTER), Checksum 22, Suffix 1
Bits 10100011011001100011010011110010000000010000000001000011110100001 (65), ID 146cc69e40200, Command 67 (DOWN), Checksum 26, Suffix 0
Bits 10100011011001100011010011110010000000010000000000100011101100001 (65), ID 146cc69e40200, Command 35 (STOP), Checksum 22, Suffix 0
Bits 10100011011001100011010011110010000000010000000001010011111000001 (65), ID 146cc69e40200, Command 83 (PROGRAM), Checksum 28, Suffix 0
Bits 10100011011000111101001101000100000000010000000000001011100001101 (65), ID 146c7a6880200, Command 11 (UP), Checksum 16, Suffix 6
Bits 10100011011000111101001101000100000000010000000000100100100111111 (65), ID 146c7a6880200, Command 36 (AFTER), Checksum 19, Suffix 7
Bits 10100011011000111101001101000100000000010000000001000011101111101 (65), ID 146c7a6880200, Command 67 (DOWN), Checksum 23, Suffix 6
Bits 10100011011000111101001101000100000000010000000000100011100111101 (65), ID 146c7a6880200, Command 35 (STOP), Checksum 19, Suffix 6
Bits 10100011011000111101001101000100000000010000000001010011110011101 (65), ID 146c7a6880200, Command 83 (PROGRAM), Checksum 25, Suffix 6
Bits 10100011011001100111000110010010000000010000000000001011011101011 (65), ID 146cce3240200, Command 11 (UP), Checksum 14, Suffix 5
Bits 10100011011001100111000110010010000000010000000001000011101011011 (65), ID 146cce3240200, Command 67 (DOWN), Checksum 21, Suffix 5
Bits 10100011011001100111000110010010000000010000000000100100100011101 (65), ID 146cce3240200, Command 36 (AFTER), Checksum 17, Suffix 6
Bits 10100011011001100111000110010010000000010000000010001011111101011 (65), ID 146cce3240201, Command 11 (UP), Checksum 30, Suffix 5
Bits 10100011011001100111000110010010000000010000000001010101101111111 (65), ID 146cce3240200, Command 85 (UNKNOWN), Checksum 23, Suffix 7
Bits 10100011011001100111000110010010000000010000000011000011001011011 (65), ID 146cce3240201, Command 67 (DOWN), Checksum 5, Suffix 5
Bits 10100011011001100111000110010010000000010000000001010011101111011 (65), ID 146cce3240200, Command 83 (PROGRAM), Checksum 23, Suffix 5
Bits 10100011010101010000110001100001000000010000000000001011110011101 (65), ID 146aa18c20200, Command 11 (UP), Checksum 25, Suffix 6
Bits 10100011010101010000110001100001000000010000000000100100111001111 (65), ID 146aa18c20200, Command 36 (AFTER), Checksum 28, Suffix 7
Bits 10100011010101010000110001100001000000010000000001000011000001101 (65), ID 146aa18c20200, Command 67 (DOWN), Checksum 0, Suffix 6
Bits 10100011010101010000110001100001000000010000000000100011111001101 (65), ID 146aa18c20200, Command 35 (STOP), Checksum 28, Suffix 6
Bits 10100011010101010000110001100001000000010000000001010011000101101 (65), ID 146aa18c20200, Command 83 (PROGRAM), Checksum 2, Suffix 6
Bits 10100011010101011101110000000001000001000000000000100100010110101 (65), ID 146abb8020800, Command 36 (AFTER), Checksum 11, Suffix 2
Bits 10100011010101011101110000000001000001000000000000001011010000011 (65), ID 146abb8020800, Command 11 (UP), Checksum 8, Suffix 1
Bits 10100011010101011101110000000001000001000000000001000011011110011 (65), ID 146abb8020800, Command 67 (DOWN), Checksum 15, Suffix 1
Bits 10100011010101011101110000000001000001000000000000100011010110011 (65), ID 146abb8020800, Command 35 (STOP), Checksum 11, Suffix 1
Bits 10100011010101011101110000000001000001000000000001010011100010011 (65), ID 146abb8020800, Command 83 (PROGRAM), Checksum 17, Suffix 1
Bits 10100011010101011101110000000001000000010000000000001011001111101 (65), ID 146abb8020200, Command 11 (UP), Checksum 7, Suffix 6
Bits 10100011010101011101110000000001000000010000000000100100010101111 (65), ID 146abb8020200, Command 36 (AFTER), Checksum 10, Suffix 7
Bits 10100011010101011101110000000001000000010000000001000011011101101 (65), ID 146abb8020200, Command 67 (DOWN), Checksum 14, Suffix 6
Bits 10100011010101011101110000000001000000010000000000100011010101101 (65), ID 146abb8020200, Command 35 (STOP), Checksum 10, Suffix 6
Bits 10100011010101011101110000000001000000010000000001010011100001101 (65), ID 146abb8020200, Command 83 (PROGRAM), Checksum 16, Suffix 6
Bits 10100011010101011101110000000001000000100000000000001011001111111 (65), ID 146abb8020400, Command 11 (UP), Checksum 7, Suffix 7
Bits 10100011010101011101110000000001000000100000000000100100010110001 (65), ID 146abb8020400, Command 36 (AFTER), Checksum 11, Suffix 0
Bits 10100011010101011101110000000001000000100000000000100011010101111 (65), ID 146abb8020400, Command 35 (STOP), Checksum 10, Suffix 7
# Started using the 6 channel remote here. I pressed up, down, stop, program for 
# each channel starting with 1 and going through 6, then selected the "all" option
# and did the same for it. There are some repeats due to copy and paste, but it
# ends with what is described above.
Bits 10100011010101011101110000000001000000100000000001010011100001111 (65), ID 146abb8020400, Command 83 (PROGRAM), Checksum 16, Suffix 7
Bits 10100011010101011101110000000001000010000000000000001011010001011 (65), ID 146abb8021000, Command 11 (UP), Checksum 8, Suffix 5
Bits 10100011010101011101110000000001000010000000000000100100010111101 (65), ID 146abb8021000, Command 36 (AFTER), Checksum 11, Suffix 6
Bits 10100011010101011101110000000001000010000000000001000011011111011 (65), ID 146abb8021000, Command 67 (DOWN), Checksum 15, Suffix 5
Bits 10100011010101011101110000000001000010000000000000100011010111011 (65), ID 146abb8021000, Command 35 (STOP), Checksum 11, Suffix 5
Bits 10100011010101011101110000000001000010000000000001010011100011011 (65), ID 146abb8021000, Command 83 (PROGRAM), Checksum 17, Suffix 5
Bits 10100011010101011101110000000001000100000000000000001011010011011 (65), ID 146abb8022000, Command 11 (UP), Checksum 9, Suffix 5
Bits 10100011010101011101110000000001000100000000000000100100011001101 (65), ID 146abb8022000, Command 36 (AFTER), Checksum 12, Suffix 6
Bits 10100011010101011101110000000001000100000000000001000011100001011 (65), ID 146abb8022000, Command 67 (DOWN), Checksum 16, Suffix 5
Bits 10100011010101011101110000000001000100000000000000100011011001011 (65), ID 146abb8022000, Command 35 (STOP), Checksum 12, Suffix 5
Bits 10100011010101011101110000000001000100000000000001011010100111001 (65), ID 146abb8022000, Command 90 (UNKNOWN), Checksum 19, Suffix 4
Bits 10100011010101011101110000000001000100000000000001010000100100101 (65), ID 146abb8022000, Command 80 (UNKNOWN), Checksum 18, Suffix 2
Bits 10100011010101011101110000000001000100000000000001010011100101011 (65), ID 146abb8022000, Command 83 (PROGRAM), Checksum 18, Suffix 5
Bits 10100011010101011101110000000001001000000000000000001011010111011 (65), ID 146abb8024000, Command 11 (UP), Checksum 11, Suffix 5
Bits 10100011010101011101110000000001001000000000000000100100011101101 (65), ID 146abb8024000, Command 36 (AFTER), Checksum 14, Suffix 6
Bits 10100011010101011101110000000001001000000000000001000011100101011 (65), ID 146abb8024000, Command 67 (DOWN), Checksum 18, Suffix 5
Bits 10100011010101011101110000000001001000000000000000100011011101011 (65), ID 146abb8024000, Command 35 (STOP), Checksum 14, Suffix 5
Bits 10100011010101011101110000000001001000000000000001010011101001011 (65), ID 146abb8024000, Command 83 (PROGRAM), Checksum 20, Suffix 5
Bits 10100011010101011101110000000001001111110000000000100100100101011 (65), ID 146abb8027e00, Command 36 (AFTER), Checksum 18, Suffix 5
Bits 10100011010101011101110000000001001111110000000000001011011111001 (65), ID 146abb8027e00, Command 11 (UP), Checksum 15, Suffix 4
Bits 10100011010101011101110000000001001111110000000001000011101101001 (65), ID 146abb8027e00, Command 67 (DOWN), Checksum 22, Suffix 4
Bits 10100011010101011101110000000001001111110000000000100011100101001 (65), ID 146abb8027e00, Command 35 (STOP), Checksum 18, Suffix 4
Bits 10100011010101011101110000000001001111110000000001010011110001001 (65), ID 146abb8027e00, Command 83 (PROGRAM), Checksum 24, Suffix 4
# Going to try the "all" on the 16 channel now, as I think there is a pattern indicating
# the ID is actually two ID fields.
Bits 10100011011100100001001011001110111111111111111100100011011100111 (65), ID 146e4259dfffe, Command 35 (STOP), Checksum 14, Suffix 3
Bits 10100011011100100001001011001110111111111111111101011010101010101 (65), ID 146e4259dfffe, Command 90 (UNKNOWN), Checksum 21, Suffix 2
# Here starts the 16 channel remote, one channel at a time, up, down, stop, program.
Bits 10100011011100100001001011001110000000010000000000001011010111101 (65), ID 146e4259c0200, Command 11 (UP), Checksum 11, Suffix 6
Bits 10100011011100100001001011001110000000010000000000100100011101111 (65), ID 146e4259c0200, Command 36 (AFTER), Checksum 14, Suffix 7
Bits 10100011011100100001001011001110000000010000000001000011100101101 (65), ID 146e4259c0200, Command 67 (DOWN), Checksum 18, Suffix 6
Bits 10100011011100100001001011001110000000010000000000100011011101101 (65), ID 146e4259c0200, Command 35 (STOP), Checksum 14, Suffix 6
Bits 10100011011100100001001011001110000000010000000001010011101001101 (65), ID 146e4259c0200, Command 83 (PROGRAM), Checksum 20, Suffix 6
Bits 10100011011100100001001011001110000000100000000000001011010111111 (65), ID 146e4259c0400, Command 11 (UP), Checksum 11, Suffix 7
Bits 10100011011100100001001011001110000000100000000001000011100101111 (65), ID 146e4259c0400, Command 67 (DOWN), Checksum 18, Suffix 7
Bits 10100011011100100001001011001110000000100000000000100011011101111 (65), ID 146e4259c0400, Command 35 (STOP), Checksum 14, Suffix 7
Bits 10100011011100100001001011001110000000100000000001010011101001111 (65), ID 146e4259c0400, Command 83 (PROGRAM), Checksum 20, Suffix 7
Bits 10100011011100100001001011001110000001000000000000001011011000011 (65), ID 146e4259c0800, Command 11 (UP), Checksum 12, Suffix 1
Bits 10100011011100100001001011001110000001000000000001000011100110011 (65), ID 146e4259c0800, Command 67 (DOWN), Checksum 19, Suffix 1
Bits 10100011011100100001001011001110000001000000000000100011011110011 (65), ID 146e4259c0800, Command 35 (STOP), Checksum 15, Suffix 1
Bits 10100011011100100001001011001110000001000000000001010011101010011 (65), ID 146e4259c0800, Command 83 (PROGRAM), Checksum 21, Suffix 1
Bits 10100011011100100001001011001110000010000000000000001011011001011 (65), ID 146e4259c1000, Command 11 (UP), Checksum 12, Suffix 5
Bits 10100011011100100001001011001110000010000000000001000011100111011 (65), ID 146e4259c1000, Command 67 (DOWN), Checksum 19, Suffix 5
Bits 10100011011100100001001011001110000010000000000000100011011111011 (65), ID 146e4259c1000, Command 35 (STOP), Checksum 15, Suffix 5
Bits 10100011011100100001001011001110000010000000000001010011101011011 (65), ID 146e4259c1000, Command 83 (PROGRAM), Checksum 21, Suffix 5
Bits 10100011011100100001001011001110000100000000000000001011011011011 (65), ID 146e4259c2000, Command 11 (UP), Checksum 13, Suffix 5
Bits 10100011011100100001001011001110000100000000000001000011101001011 (65), ID 146e4259c2000, Command 67 (DOWN), Checksum 20, Suffix 5
Bits 10100011011100100001001011001110000100000000000000100011100001011 (65), ID 146e4259c2000, Command 35 (STOP), Checksum 16, Suffix 5
Bits 10100011011100100001001011001110001000000000000000001011011111011 (65), ID 146e4259c4000, Command 11 (UP), Checksum 15, Suffix 5
Bits 10100011011100100001001011001110001000000000000001000011101101011 (65), ID 146e4259c4000, Command 67 (DOWN), Checksum 22, Suffix 5
Bits 10100011011100100001001011001110001000000000000000100011100101011 (65), ID 146e4259c4000, Command 35 (STOP), Checksum 18, Suffix 5
Bits 10100011011100100001001011001110001000000000000001010011110001011 (65), ID 146e4259c4000, Command 83 (PROGRAM), Checksum 24, Suffix 5
Bits 10100011011100100001001011001110010000000000000000001011100111011 (65), ID 146e4259c8000, Command 11 (UP), Checksum 19, Suffix 5
Bits 10100011011100100001001011001110010000000000000001000011110101011 (65), ID 146e4259c8000, Command 67 (DOWN), Checksum 26, Suffix 5
Bits 10100011011100100001001011001110010000000000000000100011101101011 (65), ID 146e4259c8000, Command 35 (STOP), Checksum 22, Suffix 5
Bits 10100011011100100001001011001110010000000000000001010011111001011 (65), ID 146e4259c8000, Command 83 (PROGRAM), Checksum 28, Suffix 5
Bits 10100011011100100001001011001110100000000000000000001011110111011 (65), ID 146e4259d0000, Command 11 (UP), Checksum 27, Suffix 5
Bits 10100011011100100001001011001110100000000000000000100100111101101 (65), ID 146e4259d0000, Command 36 (AFTER), Checksum 30, Suffix 6
Bits 10100011011100100001001011001110100000000000000001000011000101011 (65), ID 146e4259d0000, Command 67 (DOWN), Checksum 2, Suffix 5
Bits 10100011011100100001001011001110100000000000000000100011111101011 (65), ID 146e4259d0000, Command 35 (STOP), Checksum 30, Suffix 5
Bits 10100011011100100001001011001110100000000000000001010011001001011 (65), ID 146e4259d0000, Command 83 (PROGRAM), Checksum 4, Suffix 5
# Copied output here so it doesn't scroll off, so there may be repeats below. All part of the same
# sequence.
Bits 10100011011100100001001011001110000000000000000100001011010111101 (65), ID 146e4259c0002, Command 11 (UP), Checksum 11, Suffix 6
Bits 10100011011100100001001011001110000000000000000100100100011101111 (65), ID 146e4259c0002, Command 36 (AFTER), Checksum 14, Suffix 7
Bits 10100011011100100001001011001110000000000000000101000011100101101 (65), ID 146e4259c0002, Command 67 (DOWN), Checksum 18, Suffix 6
Bits 10100011011100100001001011001110000000000000000100100011011101101 (65), ID 146e4259c0002, Command 35 (STOP), Checksum 14, Suffix 6
Bits 10100011011100100001001011001110000000000000000101010011101001101 (65), ID 146e4259c0002, Command 83 (PROGRAM), Checksum 20, Suffix 6
Bits 10100011011100100001001011001110000000000000001000001011010111111 (65), ID 146e4259c0004, Command 11 (UP), Checksum 11, Suffix 7
Bits 10100011011100100001001011001110000000000000001000100100011110001 (65), ID 146e4259c0004, Command 36 (AFTER), Checksum 15, Suffix 0
Bits 10100011011100100001001011001110000000000000001000100011011101111 (65), ID 146e4259c0004, Command 35 (STOP), Checksum 14, Suffix 7
Bits 10100011011100100001001011001110000000000000001001010011101001111 (65), ID 146e4259c0004, Command 83 (PROGRAM), Checksum 20, Suffix 7
Bits 10100011011100100001001011001110000000000000010000001011011000011 (65), ID 146e4259c0008, Command 11 (UP), Checksum 12, Suffix 1
Bits 10100011011100100001001011001110000000000000010001000011100110011 (65), ID 146e4259c0008, Command 67 (DOWN), Checksum 19, Suffix 1
Bits 10100011011100100001001011001110000000000000010000100011011110011 (65), ID 146e4259c0008, Command 35 (STOP), Checksum 15, Suffix 1
Bits 10100011011100100001001011001110000000000000010001010011101010011 (65), ID 146e4259c0008, Command 83 (PROGRAM), Checksum 21, Suffix 1
Bits 10100011011100100001001011001110000000000000100000100011011111011 (65), ID 146e4259c0010, Command 35 (STOP), Checksum 15, Suffix 5
Bits 10100011011100100001001011001110000000000000100000001011011001011 (65), ID 146e4259c0010, Command 11 (UP), Checksum 12, Suffix 5
Bits 10100011011100100001001011001110000000000000100001000011100111011 (65), ID 146e4259c0010, Command 67 (DOWN), Checksum 19, Suffix 5
Bits 10100011011100100001001011001110000000000000100000100100011111101 (65), ID 146e4259c0010, Command 36 (AFTER), Checksum 15, Suffix 6
Bits 10100011011100100001001011001110000000000000100001010011101011011 (65), ID 146e4259c0010, Command 83 (PROGRAM), Checksum 21, Suffix 5
Bits 10100011011100100001001011001110000000000001000000001011011011011 (65), ID 146e4259c0020, Command 11 (UP), Checksum 13, Suffix 5
Bits 10100011011100100001001011001110000000000001000001000011101001011 (65), ID 146e4259c0020, Command 67 (DOWN), Checksum 20, Suffix 5
Bits 10100011011100100001001011001110000000000001000000100011100001011 (65), ID 146e4259c0020, Command 35 (STOP), Checksum 16, Suffix 5
Bits 10100011011100100001001011001110000000000001000001010011101101011 (65), ID 146e4259c0020, Command 83 (PROGRAM), Checksum 22, Suffix 5
Bits 10100011011100100001001011001110000000000010000000001011011111011 (65), ID 146e4259c0040, Command 11 (UP), Checksum 15, Suffix 5
Bits 10100011011100100001001011001110000000000010000000100011100101011 (65), ID 146e4259c0040, Command 35 (STOP), Checksum 18, Suffix 5
Bits 10100011011100100001001011001110000000000010000001010011110001011 (65), ID 146e4259c0040, Command 83 (PROGRAM), Checksum 24, Suffix 5
Bits 10100011011100100001001011001110000000000100000000001011100111011 (65), ID 146e4259c0080, Command 11 (UP), Checksum 19, Suffix 5
Bits 10100011011100100001001011001110000000000100000001000011110101011 (65), ID 146e4259c0080, Command 67 (DOWN), Checksum 26, Suffix 5
Bits 10100011011100100001001011001110000000000100000000100011101101011 (65), ID 146e4259c0080, Command 35 (STOP), Checksum 22, Suffix 5
Bits 10100011011100100001001011001110000000000100000001010011111001011 (65), ID 146e4259c0080, Command 83 (PROGRAM), Checksum 28, Suffix 5
Bits 10100011011100100001001011001110000000001000000000001011110111011 (65), ID 146e4259c0100, Command 11 (UP), Checksum 27, Suffix 5
Bits 10100011011100100001001011001110000000001000000000100100111101101 (65), ID 146e4259c0100, Command 36 (AFTER), Checksum 30, Suffix 6
Bits 10100011011100100001001011001110000000001000000001000011000101011 (65), ID 146e4259c0100, Command 67 (DOWN), Checksum 2, Suffix 5
Bits 10100011011100100001001011001110000000001000000000100011111101011 (65), ID 146e4259c0100, Command 35 (STOP), Checksum 30, Suffix 5
Bits 10100011011100100001001011001110000000001000000001010011001001011 (65), ID 146e4259c0100, Command 83 (PROGRAM), Checksum 4, Suffix 5
Bits 10100011011100100001001011001110111111111111111100001011010110111 (65), ID 146e4259dfffe, Command 11 (UP), Checksum 11, Suffix 3
Bits 10100011011100100001001011001110111111111111111100100100011101001 (65), ID 146e4259dfffe, Command 36 (AFTER), Checksum 14, Suffix 4
Bits 10100011011100100001001011001110111111111111111101000011100100111 (65), ID 146e4259dfffe, Command 67 (DOWN), Checksum 18, Suffix 3
# Note, this last bit is the 16 channel "all call" program command. I had a really hard time getting
# it to record, and there are a lot of these shorter commands. Not sure if it's Protisch messing up
# or if those commands are really being sent. May need to open it up and use the logic analyzer.
Bits 10100011011100100001001011001110000100000000000001010011101101011 (65), ID 146e4259c2000, Command 83 (PROGRAM), Checksum 22, Suffix 5
Bits 10100011011100100001001011001110111111111111111101010011101000111 (65), ID 146e4259dfffe, Command 83 (PROGRAM), Checksum 20, Suffix 3

A few things of interest:

  • The all call packets seem to have a bunch of bits set near the end of the ID. It makes me wonder if the ID is in two parts; like "remote ID" and "channel ID" or something like that.
  • There are several different packets with the same checksum. This should help us decode it.
  • Many of the remotes have a long hex string on the back. I suspect this is the unique ID but it doesn't match the decoded data. This makes me think the tri-state understanding might be incorrect. I am going to try some different ideas to see if I can make it match.

I'm going to keep working on this, but I thought I would share the data in case you want to try too :)

Thanks,
Jason

@vonnieda
Copy link
Author

Forgot to add, here is how you interpret the B1 command in the raw log.

@vonnieda
Copy link
Author

Got it all figured out :)

It's 64 bits of data, with a trailing 1 making it 65 bits transmitted. The packet format is:

[Start][ID][Address][Command][Checksum][1]

  • Start: 8 bits unsigned, always 0xa3, hardcoded.
  • ID: 24 bits unsigned, unique per remote.
  • Address: 16 bits unsigned. This is a bit field so a remote can have up to 16 channels, or you can send multiple bits as 1 to trigger multiple channels at once.
  • Command: 8 bits unsigned, basically the same as you found re: up/down/stop/program.
  • Checksum: 8 bits unsigned, 8 bit sum of ID, Address, and Command.

Here is the log I sent previously, now decoded using this algorithm:

# We start with the single channel remotes. For each one I send Up, Down, Stop, Program.
Bits 10100011011000111100010010101011000000010000000000001011110111101 (65), Header a3, ID 63c4ab, Address 100, Command 11 (UP), Checksum de (de / GOOD)
Bits 10100011011000111100010010101011000000010000000000100100111101111 (65), Header a3, ID 63c4ab, Address 100, Command 36 (AFTER), Checksum f7 (f7 / GOOD)
Bits 10100011011000111100010010101011000000010000000001000011000101101 (65), Header a3, ID 63c4ab, Address 100, Command 67 (DOWN), Checksum 16 (16 / GOOD)
Bits 10100011011000111100010010101011000000010000000011000011100101101 (65), Header a3, ID 63c4ab, Address 100, Command 195 (UNKNOWN), Checksum 96 (96 / GOOD)
Bits 10100011011000111100010010101011000000010000000000100011111101101 (65), Header a3, ID 63c4ab, Address 100, Command 35 (STOP), Checksum f6 (f6 / GOOD)
Bits 10100011011000111100010010101011000000010000000001011010001011011 (65), Header a3, ID 63c4ab, Address 100, Command 90 (UNKNOWN), Checksum 2d (2d / GOOD)
Bits 10100011011000111100010010101011000000010000000001010011001001101 (65), Header a3, ID 63c4ab, Address 100, Command 83 (PROGRAM), Checksum 26 (26 / GOOD)
Bits 10100011011001100001111101110010000000010000000000001011000000111 (65), Header a3, ID 661f72, Address 100, Command 11 (UP), Checksum 3 (3 / GOOD)
Bits 10100011011001100001111101110010000000010000000001000011001110111 (65), Header a3, ID 661f72, Address 100, Command 67 (DOWN), Checksum 3b (3b / GOOD)
Bits 10100011011001100001111101110010000000010000000000100011000110111 (65), Header a3, ID 661f72, Address 100, Command 35 (STOP), Checksum 1b (1b / GOOD)
Bits 10100011011001100001111101110010000000010000000001010011010010111 (65), Header a3, ID 661f72, Address 100, Command 83 (PROGRAM), Checksum 4b (4b / GOOD)
Bits 10100011011000111010111001110110000000010000000000001011100100111 (65), Header a3, ID 63ae76, Address 100, Command 11 (UP), Checksum 93 (93 / GOOD)
Bits 10100011011000111010111001110110000000010000000000100100101011001 (65), Header a3, ID 63ae76, Address 100, Command 36 (AFTER), Checksum ac (ac / GOOD)
Bits 10100011011000111010111001110110000000010000000000100011101010111 (65), Header a3, ID 63ae76, Address 100, Command 35 (STOP), Checksum ab (ab / GOOD)
Bits 10100011011000111010111001110110000000010000000001010011110110111 (65), Header a3, ID 63ae76, Address 100, Command 83 (PROGRAM), Checksum db (db / GOOD)
Bits 10100011011000111010111001110110000000010000000001000011110010111 (65), Header a3, ID 63ae76, Address 100, Command 67 (DOWN), Checksum cb (cb / GOOD)
Bits 10100011011001100011100111011010000000010000000000100100100111101 (65), Header a3, ID 6639da, Address 100, Command 36 (AFTER), Checksum 9e (9e / GOOD)
Bits 10100011011001100011100111011010000000010000000000001011100001011 (65), Header a3, ID 6639da, Address 100, Command 11 (UP), Checksum 85 (85 / GOOD)
Bits 10100011011001100011100111011010000000010000000001000011101111011 (65), Header a3, ID 6639da, Address 100, Command 67 (DOWN), Checksum bd (bd / GOOD)
Bits 10100011011001100011100111011010000000010000000000100011100111011 (65), Header a3, ID 6639da, Address 100, Command 35 (STOP), Checksum 9d (9d / GOOD)
Bits 10100011011001100011100111011010000000010000000001011010110101001 (65), Header a3, ID 6639da, Address 100, Command 90 (UNKNOWN), Checksum d4 (d4 / GOOD)
Bits 10100011011001100011100111011010000000010000000001010011110011011 (65), Header a3, ID 6639da, Address 100, Command 83 (PROGRAM), Checksum cd (cd / GOOD)
Bits 10100011011001100011010011110010000000010000000000001011100110001 (65), Header a3, ID 6634f2, Address 100, Command 11 (UP), Checksum 98 (98 / GOOD)
Bits 10100011011001100011010011110010000000010000000000100100101100011 (65), Header a3, ID 6634f2, Address 100, Command 36 (AFTER), Checksum b1 (b1 / GOOD)
Bits 10100011011001100011010011110010000000010000000001000011110100001 (65), Header a3, ID 6634f2, Address 100, Command 67 (DOWN), Checksum d0 (d0 / GOOD)
Bits 10100011011001100011010011110010000000010000000000100011101100001 (65), Header a3, ID 6634f2, Address 100, Command 35 (STOP), Checksum b0 (b0 / GOOD)
Bits 10100011011001100011010011110010000000010000000001010011111000001 (65), Header a3, ID 6634f2, Address 100, Command 83 (PROGRAM), Checksum e0 (e0 / GOOD)
Bits 10100011011000111101001101000100000000010000000000001011100001101 (65), Header a3, ID 63d344, Address 100, Command 11 (UP), Checksum 86 (86 / GOOD)
Bits 10100011011000111101001101000100000000010000000000100100100111111 (65), Header a3, ID 63d344, Address 100, Command 36 (AFTER), Checksum 9f (9f / GOOD)
Bits 10100011011000111101001101000100000000010000000001000011101111101 (65), Header a3, ID 63d344, Address 100, Command 67 (DOWN), Checksum be (be / GOOD)
Bits 10100011011000111101001101000100000000010000000000100011100111101 (65), Header a3, ID 63d344, Address 100, Command 35 (STOP), Checksum 9e (9e / GOOD)
Bits 10100011011000111101001101000100000000010000000001010011110011101 (65), Header a3, ID 63d344, Address 100, Command 83 (PROGRAM), Checksum ce (ce / GOOD)
Bits 10100011011001100111000110010010000000010000000000001011011101011 (65), Header a3, ID 667192, Address 100, Command 11 (UP), Checksum 75 (75 / GOOD)
Bits 10100011011001100111000110010010000000010000000001000011101011011 (65), Header a3, ID 667192, Address 100, Command 67 (DOWN), Checksum ad (ad / GOOD)
Bits 10100011011001100111000110010010000000010000000000100100100011101 (65), Header a3, ID 667192, Address 100, Command 36 (AFTER), Checksum 8e (8e / GOOD)
Bits 10100011011001100111000110010010000000010000000010001011111101011 (65), Header a3, ID 667192, Address 100, Command 139 (UNKNOWN), Checksum f5 (f5 / GOOD)
Bits 10100011011001100111000110010010000000010000000001010101101111111 (65), Header a3, ID 667192, Address 100, Command 85 (UNKNOWN), Checksum bf (bf / GOOD)
Bits 10100011011001100111000110010010000000010000000011000011001011011 (65), Header a3, ID 667192, Address 100, Command 195 (UNKNOWN), Checksum 2d (2d / GOOD)
Bits 10100011011001100111000110010010000000010000000001010011101111011 (65), Header a3, ID 667192, Address 100, Command 83 (PROGRAM), Checksum bd (bd / GOOD)
Bits 10100011010101010000110001100001000000010000000000001011110011101 (65), Header a3, ID 550c61, Address 100, Command 11 (UP), Checksum ce (ce / GOOD)
Bits 10100011010101010000110001100001000000010000000000100100111001111 (65), Header a3, ID 550c61, Address 100, Command 36 (AFTER), Checksum e7 (e7 / GOOD)
Bits 10100011010101010000110001100001000000010000000001000011000001101 (65), Header a3, ID 550c61, Address 100, Command 67 (DOWN), Checksum 6 (6 / GOOD)
Bits 10100011010101010000110001100001000000010000000000100011111001101 (65), Header a3, ID 550c61, Address 100, Command 35 (STOP), Checksum e6 (e6 / GOOD)
Bits 10100011010101010000110001100001000000010000000001010011000101101 (65), Header a3, ID 550c61, Address 100, Command 83 (PROGRAM), Checksum 16 (16 / GOOD)
Bits 10100011010101011101110000000001000001000000000000100100010110101 (65), Header a3, ID 55dc01, Address 400, Command 36 (AFTER), Checksum 5a (5a / GOOD)
Bits 10100011010101011101110000000001000001000000000000001011010000011 (65), Header a3, ID 55dc01, Address 400, Command 11 (UP), Checksum 41 (41 / GOOD)
Bits 10100011010101011101110000000001000001000000000001000011011110011 (65), Header a3, ID 55dc01, Address 400, Command 67 (DOWN), Checksum 79 (79 / GOOD)
Bits 10100011010101011101110000000001000001000000000000100011010110011 (65), Header a3, ID 55dc01, Address 400, Command 35 (STOP), Checksum 59 (59 / GOOD)
Bits 10100011010101011101110000000001000001000000000001010011100010011 (65), Header a3, ID 55dc01, Address 400, Command 83 (PROGRAM), Checksum 89 (89 / GOOD)
Bits 10100011010101011101110000000001000000010000000000001011001111101 (65), Header a3, ID 55dc01, Address 100, Command 11 (UP), Checksum 3e (3e / GOOD)
Bits 10100011010101011101110000000001000000010000000000100100010101111 (65), Header a3, ID 55dc01, Address 100, Command 36 (AFTER), Checksum 57 (57 / GOOD)
Bits 10100011010101011101110000000001000000010000000001000011011101101 (65), Header a3, ID 55dc01, Address 100, Command 67 (DOWN), Checksum 76 (76 / GOOD)
Bits 10100011010101011101110000000001000000010000000000100011010101101 (65), Header a3, ID 55dc01, Address 100, Command 35 (STOP), Checksum 56 (56 / GOOD)
Bits 10100011010101011101110000000001000000010000000001010011100001101 (65), Header a3, ID 55dc01, Address 100, Command 83 (PROGRAM), Checksum 86 (86 / GOOD)
Bits 10100011010101011101110000000001000000100000000000001011001111111 (65), Header a3, ID 55dc01, Address 200, Command 11 (UP), Checksum 3f (3f / GOOD)
Bits 10100011010101011101110000000001000000100000000000100100010110001 (65), Header a3, ID 55dc01, Address 200, Command 36 (AFTER), Checksum 58 (58 / GOOD)
Bits 10100011010101011101110000000001000000100000000000100011010101111 (65), Header a3, ID 55dc01, Address 200, Command 35 (STOP), Checksum 57 (57 / GOOD)
# Started using the 6 channel remote here. I pressed up, down, stop, program for 
# each channel starting with 1 and going through 6, then selected the "all" option
# and did the same for it. There are some repeats due to copy and paste, but it
# ends with what is described above.
Bits 10100011010101011101110000000001000000100000000001010011100001111 (65), Header a3, ID 55dc01, Address 200, Command 83 (PROGRAM), Checksum 87 (87 / GOOD)
Bits 10100011010101011101110000000001000010000000000000001011010001011 (65), Header a3, ID 55dc01, Address 800, Command 11 (UP), Checksum 45 (45 / GOOD)
Bits 10100011010101011101110000000001000010000000000000100100010111101 (65), Header a3, ID 55dc01, Address 800, Command 36 (AFTER), Checksum 5e (5e / GOOD)
Bits 10100011010101011101110000000001000010000000000001000011011111011 (65), Header a3, ID 55dc01, Address 800, Command 67 (DOWN), Checksum 7d (7d / GOOD)
Bits 10100011010101011101110000000001000010000000000000100011010111011 (65), Header a3, ID 55dc01, Address 800, Command 35 (STOP), Checksum 5d (5d / GOOD)
Bits 10100011010101011101110000000001000010000000000001010011100011011 (65), Header a3, ID 55dc01, Address 800, Command 83 (PROGRAM), Checksum 8d (8d / GOOD)
Bits 10100011010101011101110000000001000100000000000000001011010011011 (65), Header a3, ID 55dc01, Address 1000, Command 11 (UP), Checksum 4d (4d / GOOD)
Bits 10100011010101011101110000000001000100000000000000100100011001101 (65), Header a3, ID 55dc01, Address 1000, Command 36 (AFTER), Checksum 66 (66 / GOOD)
Bits 10100011010101011101110000000001000100000000000001000011100001011 (65), Header a3, ID 55dc01, Address 1000, Command 67 (DOWN), Checksum 85 (85 / GOOD)
Bits 10100011010101011101110000000001000100000000000000100011011001011 (65), Header a3, ID 55dc01, Address 1000, Command 35 (STOP), Checksum 65 (65 / GOOD)
Bits 10100011010101011101110000000001000100000000000001011010100111001 (65), Header a3, ID 55dc01, Address 1000, Command 90 (UNKNOWN), Checksum 9c (9c / GOOD)
Bits 10100011010101011101110000000001000100000000000001010000100100101 (65), Header a3, ID 55dc01, Address 1000, Command 80 (UNKNOWN), Checksum 92 (92 / GOOD)
Bits 10100011010101011101110000000001000100000000000001010011100101011 (65), Header a3, ID 55dc01, Address 1000, Command 83 (PROGRAM), Checksum 95 (95 / GOOD)
Bits 10100011010101011101110000000001001000000000000000001011010111011 (65), Header a3, ID 55dc01, Address 2000, Command 11 (UP), Checksum 5d (5d / GOOD)
Bits 10100011010101011101110000000001001000000000000000100100011101101 (65), Header a3, ID 55dc01, Address 2000, Command 36 (AFTER), Checksum 76 (76 / GOOD)
Bits 10100011010101011101110000000001001000000000000001000011100101011 (65), Header a3, ID 55dc01, Address 2000, Command 67 (DOWN), Checksum 95 (95 / GOOD)
Bits 10100011010101011101110000000001001000000000000000100011011101011 (65), Header a3, ID 55dc01, Address 2000, Command 35 (STOP), Checksum 75 (75 / GOOD)
Bits 10100011010101011101110000000001001000000000000001010011101001011 (65), Header a3, ID 55dc01, Address 2000, Command 83 (PROGRAM), Checksum a5 (a5 / GOOD)
Bits 10100011010101011101110000000001001111110000000000100100100101011 (65), Header a3, ID 55dc01, Address 3f00, Command 36 (AFTER), Checksum 95 (95 / GOOD)
Bits 10100011010101011101110000000001001111110000000000001011011111001 (65), Header a3, ID 55dc01, Address 3f00, Command 11 (UP), Checksum 7c (7c / GOOD)
Bits 10100011010101011101110000000001001111110000000001000011101101001 (65), Header a3, ID 55dc01, Address 3f00, Command 67 (DOWN), Checksum b4 (b4 / GOOD)
Bits 10100011010101011101110000000001001111110000000000100011100101001 (65), Header a3, ID 55dc01, Address 3f00, Command 35 (STOP), Checksum 94 (94 / GOOD)
Bits 10100011010101011101110000000001001111110000000001010011110001001 (65), Header a3, ID 55dc01, Address 3f00, Command 83 (PROGRAM), Checksum c4 (c4 / GOOD)
# Going to try the "all" on the 16 channel now, as I think there is a pattern indicating
# the ID is actually two ID fields.
Bits 10100011011100100001001011001110111111111111111100100011011100111 (65), Header a3, ID 7212ce, Address ffff, Command 35 (STOP), Checksum 73 (73 / GOOD)
Bits 10100011011100100001001011001110111111111111111101011010101010101 (65), Header a3, ID 7212ce, Address ffff, Command 90 (UNKNOWN), Checksum aa (aa / GOOD)
# Here starts the 16 channel remote, one channel at a time, up, down, stop, program.
Bits 10100011011100100001001011001110000000010000000000001011010111101 (65), Header a3, ID 7212ce, Address 100, Command 11 (UP), Checksum 5e (5e / GOOD)
Bits 10100011011100100001001011001110000000010000000000100100011101111 (65), Header a3, ID 7212ce, Address 100, Command 36 (AFTER), Checksum 77 (77 / GOOD)
Bits 10100011011100100001001011001110000000010000000001000011100101101 (65), Header a3, ID 7212ce, Address 100, Command 67 (DOWN), Checksum 96 (96 / GOOD)
Bits 10100011011100100001001011001110000000010000000000100011011101101 (65), Header a3, ID 7212ce, Address 100, Command 35 (STOP), Checksum 76 (76 / GOOD)
Bits 10100011011100100001001011001110000000010000000001010011101001101 (65), Header a3, ID 7212ce, Address 100, Command 83 (PROGRAM), Checksum a6 (a6 / GOOD)
Bits 10100011011100100001001011001110000000100000000000001011010111111 (65), Header a3, ID 7212ce, Address 200, Command 11 (UP), Checksum 5f (5f / GOOD)
Bits 10100011011100100001001011001110000000100000000001000011100101111 (65), Header a3, ID 7212ce, Address 200, Command 67 (DOWN), Checksum 97 (97 / GOOD)
Bits 10100011011100100001001011001110000000100000000000100011011101111 (65), Header a3, ID 7212ce, Address 200, Command 35 (STOP), Checksum 77 (77 / GOOD)
Bits 10100011011100100001001011001110000000100000000001010011101001111 (65), Header a3, ID 7212ce, Address 200, Command 83 (PROGRAM), Checksum a7 (a7 / GOOD)
Bits 10100011011100100001001011001110000001000000000000001011011000011 (65), Header a3, ID 7212ce, Address 400, Command 11 (UP), Checksum 61 (61 / GOOD)
Bits 10100011011100100001001011001110000001000000000001000011100110011 (65), Header a3, ID 7212ce, Address 400, Command 67 (DOWN), Checksum 99 (99 / GOOD)
Bits 10100011011100100001001011001110000001000000000000100011011110011 (65), Header a3, ID 7212ce, Address 400, Command 35 (STOP), Checksum 79 (79 / GOOD)
Bits 10100011011100100001001011001110000001000000000001010011101010011 (65), Header a3, ID 7212ce, Address 400, Command 83 (PROGRAM), Checksum a9 (a9 / GOOD)
Bits 10100011011100100001001011001110000010000000000000001011011001011 (65), Header a3, ID 7212ce, Address 800, Command 11 (UP), Checksum 65 (65 / GOOD)
Bits 10100011011100100001001011001110000010000000000001000011100111011 (65), Header a3, ID 7212ce, Address 800, Command 67 (DOWN), Checksum 9d (9d / GOOD)
Bits 10100011011100100001001011001110000010000000000000100011011111011 (65), Header a3, ID 7212ce, Address 800, Command 35 (STOP), Checksum 7d (7d / GOOD)
Bits 10100011011100100001001011001110000010000000000001010011101011011 (65), Header a3, ID 7212ce, Address 800, Command 83 (PROGRAM), Checksum ad (ad / GOOD)
Bits 10100011011100100001001011001110000100000000000000001011011011011 (65), Header a3, ID 7212ce, Address 1000, Command 11 (UP), Checksum 6d (6d / GOOD)
Bits 10100011011100100001001011001110000100000000000001000011101001011 (65), Header a3, ID 7212ce, Address 1000, Command 67 (DOWN), Checksum a5 (a5 / GOOD)
Bits 10100011011100100001001011001110000100000000000000100011100001011 (65), Header a3, ID 7212ce, Address 1000, Command 35 (STOP), Checksum 85 (85 / GOOD)
Bits 10100011011100100001001011001110001000000000000000001011011111011 (65), Header a3, ID 7212ce, Address 2000, Command 11 (UP), Checksum 7d (7d / GOOD)
Bits 10100011011100100001001011001110001000000000000001000011101101011 (65), Header a3, ID 7212ce, Address 2000, Command 67 (DOWN), Checksum b5 (b5 / GOOD)
Bits 10100011011100100001001011001110001000000000000000100011100101011 (65), Header a3, ID 7212ce, Address 2000, Command 35 (STOP), Checksum 95 (95 / GOOD)
Bits 10100011011100100001001011001110001000000000000001010011110001011 (65), Header a3, ID 7212ce, Address 2000, Command 83 (PROGRAM), Checksum c5 (c5 / GOOD)
Bits 10100011011100100001001011001110010000000000000000001011100111011 (65), Header a3, ID 7212ce, Address 4000, Command 11 (UP), Checksum 9d (9d / GOOD)
Bits 10100011011100100001001011001110010000000000000001000011110101011 (65), Header a3, ID 7212ce, Address 4000, Command 67 (DOWN), Checksum d5 (d5 / GOOD)
Bits 10100011011100100001001011001110010000000000000000100011101101011 (65), Header a3, ID 7212ce, Address 4000, Command 35 (STOP), Checksum b5 (b5 / GOOD)
Bits 10100011011100100001001011001110010000000000000001010011111001011 (65), Header a3, ID 7212ce, Address 4000, Command 83 (PROGRAM), Checksum e5 (e5 / GOOD)
Bits 10100011011100100001001011001110100000000000000000001011110111011 (65), Header a3, ID 7212ce, Address 8000, Command 11 (UP), Checksum dd (dd / GOOD)
Bits 10100011011100100001001011001110100000000000000000100100111101101 (65), Header a3, ID 7212ce, Address 8000, Command 36 (AFTER), Checksum f6 (f6 / GOOD)
Bits 10100011011100100001001011001110100000000000000001000011000101011 (65), Header a3, ID 7212ce, Address 8000, Command 67 (DOWN), Checksum 15 (15 / GOOD)
Bits 10100011011100100001001011001110100000000000000000100011111101011 (65), Header a3, ID 7212ce, Address 8000, Command 35 (STOP), Checksum f5 (f5 / GOOD)
Bits 10100011011100100001001011001110100000000000000001010011001001011 (65), Header a3, ID 7212ce, Address 8000, Command 83 (PROGRAM), Checksum 25 (25 / GOOD)
# Copied output here so it doesn't scroll off, so there may be repeats below. All part of the same
# sequence.
Bits 10100011011100100001001011001110000000000000000100001011010111101 (65), Header a3, ID 7212ce, Address 1, Command 11 (UP), Checksum 5e (5e / GOOD)
Bits 10100011011100100001001011001110000000000000000100100100011101111 (65), Header a3, ID 7212ce, Address 1, Command 36 (AFTER), Checksum 77 (77 / GOOD)
Bits 10100011011100100001001011001110000000000000000101000011100101101 (65), Header a3, ID 7212ce, Address 1, Command 67 (DOWN), Checksum 96 (96 / GOOD)
Bits 10100011011100100001001011001110000000000000000100100011011101101 (65), Header a3, ID 7212ce, Address 1, Command 35 (STOP), Checksum 76 (76 / GOOD)
Bits 10100011011100100001001011001110000000000000000101010011101001101 (65), Header a3, ID 7212ce, Address 1, Command 83 (PROGRAM), Checksum a6 (a6 / GOOD)
Bits 10100011011100100001001011001110000000000000001000001011010111111 (65), Header a3, ID 7212ce, Address 2, Command 11 (UP), Checksum 5f (5f / GOOD)
Bits 10100011011100100001001011001110000000000000001000100100011110001 (65), Header a3, ID 7212ce, Address 2, Command 36 (AFTER), Checksum 78 (78 / GOOD)
Bits 10100011011100100001001011001110000000000000001000100011011101111 (65), Header a3, ID 7212ce, Address 2, Command 35 (STOP), Checksum 77 (77 / GOOD)
Bits 10100011011100100001001011001110000000000000001001010011101001111 (65), Header a3, ID 7212ce, Address 2, Command 83 (PROGRAM), Checksum a7 (a7 / GOOD)
Bits 10100011011100100001001011001110000000000000010000001011011000011 (65), Header a3, ID 7212ce, Address 4, Command 11 (UP), Checksum 61 (61 / GOOD)
Bits 10100011011100100001001011001110000000000000010001000011100110011 (65), Header a3, ID 7212ce, Address 4, Command 67 (DOWN), Checksum 99 (99 / GOOD)
Bits 10100011011100100001001011001110000000000000010000100011011110011 (65), Header a3, ID 7212ce, Address 4, Command 35 (STOP), Checksum 79 (79 / GOOD)
Bits 10100011011100100001001011001110000000000000010001010011101010011 (65), Header a3, ID 7212ce, Address 4, Command 83 (PROGRAM), Checksum a9 (a9 / GOOD)
Bits 10100011011100100001001011001110000000000000100000100011011111011 (65), Header a3, ID 7212ce, Address 8, Command 35 (STOP), Checksum 7d (7d / GOOD)
Bits 10100011011100100001001011001110000000000000100000001011011001011 (65), Header a3, ID 7212ce, Address 8, Command 11 (UP), Checksum 65 (65 / GOOD)
Bits 10100011011100100001001011001110000000000000100001000011100111011 (65), Header a3, ID 7212ce, Address 8, Command 67 (DOWN), Checksum 9d (9d / GOOD)
Bits 10100011011100100001001011001110000000000000100000100100011111101 (65), Header a3, ID 7212ce, Address 8, Command 36 (AFTER), Checksum 7e (7e / GOOD)
Bits 10100011011100100001001011001110000000000000100001010011101011011 (65), Header a3, ID 7212ce, Address 8, Command 83 (PROGRAM), Checksum ad (ad / GOOD)
Bits 10100011011100100001001011001110000000000001000000001011011011011 (65), Header a3, ID 7212ce, Address 10, Command 11 (UP), Checksum 6d (6d / GOOD)
Bits 10100011011100100001001011001110000000000001000001000011101001011 (65), Header a3, ID 7212ce, Address 10, Command 67 (DOWN), Checksum a5 (a5 / GOOD)
Bits 10100011011100100001001011001110000000000001000000100011100001011 (65), Header a3, ID 7212ce, Address 10, Command 35 (STOP), Checksum 85 (85 / GOOD)
Bits 10100011011100100001001011001110000000000001000001010011101101011 (65), Header a3, ID 7212ce, Address 10, Command 83 (PROGRAM), Checksum b5 (b5 / GOOD)
Bits 10100011011100100001001011001110000000000010000000001011011111011 (65), Header a3, ID 7212ce, Address 20, Command 11 (UP), Checksum 7d (7d / GOOD)
Bits 10100011011100100001001011001110000000000010000000100011100101011 (65), Header a3, ID 7212ce, Address 20, Command 35 (STOP), Checksum 95 (95 / GOOD)
Bits 10100011011100100001001011001110000000000010000001010011110001011 (65), Header a3, ID 7212ce, Address 20, Command 83 (PROGRAM), Checksum c5 (c5 / GOOD)
Bits 10100011011100100001001011001110000000000100000000001011100111011 (65), Header a3, ID 7212ce, Address 40, Command 11 (UP), Checksum 9d (9d / GOOD)
Bits 10100011011100100001001011001110000000000100000001000011110101011 (65), Header a3, ID 7212ce, Address 40, Command 67 (DOWN), Checksum d5 (d5 / GOOD)
Bits 10100011011100100001001011001110000000000100000000100011101101011 (65), Header a3, ID 7212ce, Address 40, Command 35 (STOP), Checksum b5 (b5 / GOOD)
Bits 10100011011100100001001011001110000000000100000001010011111001011 (65), Header a3, ID 7212ce, Address 40, Command 83 (PROGRAM), Checksum e5 (e5 / GOOD)
Bits 10100011011100100001001011001110000000001000000000001011110111011 (65), Header a3, ID 7212ce, Address 80, Command 11 (UP), Checksum dd (dd / GOOD)
Bits 10100011011100100001001011001110000000001000000000100100111101101 (65), Header a3, ID 7212ce, Address 80, Command 36 (AFTER), Checksum f6 (f6 / GOOD)
Bits 10100011011100100001001011001110000000001000000001000011000101011 (65), Header a3, ID 7212ce, Address 80, Command 67 (DOWN), Checksum 15 (15 / GOOD)
Bits 10100011011100100001001011001110000000001000000000100011111101011 (65), Header a3, ID 7212ce, Address 80, Command 35 (STOP), Checksum f5 (f5 / GOOD)
Bits 10100011011100100001001011001110000000001000000001010011001001011 (65), Header a3, ID 7212ce, Address 80, Command 83 (PROGRAM), Checksum 25 (25 / GOOD)
Bits 10100011011100100001001011001110111111111111111100001011010110111 (65), Header a3, ID 7212ce, Address ffff, Command 11 (UP), Checksum 5b (5b / GOOD)
Bits 10100011011100100001001011001110111111111111111100100100011101001 (65), Header a3, ID 7212ce, Address ffff, Command 36 (AFTER), Checksum 74 (74 / GOOD)
Bits 10100011011100100001001011001110111111111111111101000011100100111 (65), Header a3, ID 7212ce, Address ffff, Command 67 (DOWN), Checksum 93 (93 / GOOD)
# Note, this last bit is the 16 channel "all call" program command. I had a really hard time getting
# it to record, and there are a lot of these shorter commands. Not sure if it's Protisch messing up
# or if those commands are really being sent. May need to open it up and use the logic analyzer.
Bits 10100011011100100001001011001110000100000000000001010011101101011 (65), Header a3, ID 7212ce, Address 1000, Command 83 (PROGRAM), Checksum b5 (b5 / GOOD)
Bits 10100011011100100001001011001110111111111111111101010011101000111 (65), Header a3, ID 7212ce, Address ffff, Command 83 (PROGRAM), Checksum a3 (a3 / GOOD)

@akirjavainen
Copy link
Owner

Whoa, hats off to you, sir, that was fast! Just got back to my e-mail today and the solution was already there. :)

I'll include the protocol description in the next commit, with compliments to you. Cheers!

@vonnieda
Copy link
Author

Thanks @akirjavainen, it was a very fun project!

@manutenfruits
Copy link

Sorry to reopen this, I am trying to use this information to craft my own B0 commands in Porstich firmware to control my blinds.

@vonnieda How did you go from B1 output to the binary string representing the command?

So far I was able to use Porstich advanced sniffing feature to repeat the same command from the remote, which works 50% of the times. Every sniff I get is different so I was hoping to do the reverse, craft my own remote with unique id, create each command using the information on this issue, and then convert that into a raw command for Porstich.

@vonnieda
Copy link
Author

@vonnieda How did you go from B1 output to the binary string representing the command?

For a long winded and unfinished explanation, see all the stuff below. I started typing up a full breakdown of how all this works, but I got tired and decided to just post the code instead :)

Take a look at the attached code, and if there's anything that's not clear from the code or the explanation below let me know and I'll fill in the gaps.

You can run the code at https://replit.com/@vonnieda/AzureRoundSystemintegrator#Main.java

Here's the code:

public class AOKRemoteGen {
    static int COMMAND_UP = 11;
    static int COMMAND_DOWN = 67;
    static int COMMAND_STOP = 35;
    static int COMMAND_PROGRAM = 83;
    
    public static void main(String[] args) throws Exception {
        
        /**
         * The remoteId is the unique ID of the remote. This can probably be any 24 bit number.
         * This is what gets stored in the blinds motor when you program a remote to it.
         */
        int remoteId = 0x7212ce;
        
        /**
         * The channel number to send: 1 - 16. To send the "All" channel, change the createCommand
         * call below to pass 0xffff - or all 16 bits sent. 
         */
        int channel = 1;
        
        /**
         * The command to send. See commands at top of file.
         */
        int command = COMMAND_UP;
        
        /**
         * Generate the raw buffer of bytes based on the parameters. This buffer can then be
         * formatted as either a B0 or B1 command.
         */
        byte[] buffer = createCommand(remoteId, 1 << (channel - 1), command);
        
        /**
         * Format the buffer as a B0.
         */
        String b0 = formatB0OrB1(buffer, true);
        
        /**
         * Format the buffer as a B1.
         */
        String b1 = formatB0OrB1(buffer, false);
        
        /**
         * Print both out for funsies. 
         */
        System.out.println(b0);
        System.out.println(b1);
    }

    public static byte calculateChecksum(int id, int address, int command) {
        int checksum = (id & 0xff) + (id >> 8 & 0xff) + (id >> 16 & 0xff) + (address & 0xff) + (address >> 8 & 0xff) + command;
        checksum &= 0xff;
        return (byte) checksum;
    }
    
    public static String formatBit(int bucketIndex, boolean bit) {
        return String.format("%X", (bucketIndex & 0x07) | (bit ? 0x08 : 0x00));
    }
    
    public static String formatB0OrB1(byte[] buffer, boolean b0) throws Exception {
        int[] buckets = new int[] {
                0x134C, // 4940
                0x0262, // 610
                0x0118, // 280
                0x1356, // 4950
        };
        StringBuffer sb = new StringBuffer();
        sb.append("RfRaw ");
        sb.append("AA");
        sb.append(" ");
        if (b0) {
            sb.append("B0");
        }
        else {
            sb.append("B1");
        }
        sb.append(" ");
        if (b0) {
            // Command Length
            sb.append(String.format("%02x", 1 + 1 + (2 * buckets.length) + (buffer.length * 8) + 1 + 1));
            sb.append(" ");
        }
        // Bucket Count
        sb.append(String.format("%02X", buckets.length));
        if (b0) {
            // Repeats
            sb.append("08");
        }
        // Buckets
        for (int i = 0; i < buckets.length; i++) {
            sb.append(String.format("%04X", buckets[i]));
        }
        // AGC and following low.
        sb.append(formatBit(3, false));
        sb.append(formatBit(0, true));
        sb.append(formatBit(1, false));
        for (int i = 0; i < buffer.length; i++) {
            // Each hex byte is 2 bits from the two nibbles. The bottom 3 bits of the nibble
            // is the bucket number and the top bit is the value.
            for (int j = 7; j >= 0; j--) {
                boolean bit = ((buffer[i] >> j) & 0x01) != 0;
                if (bit) {
                    sb.append(formatBit(1, true));
                    sb.append(formatBit(2, false));
                }
                else {
                    sb.append(formatBit(2, true));
                    sb.append(formatBit(1, false));
                }
            }
        }
        // Trailing 1
        sb.append(formatBit(1, true));
        sb.append(" ");
        sb.append("55");

        return sb.toString();
    }
    
    public static byte[] createCommand(int id, int address, int command) throws Exception {
        byte[] buffer = new byte[8];
        buffer[0] = (byte) 0xa3;
        buffer[1] = (byte) (id >> 16 & 0xff);
        buffer[2] = (byte) (id >> 8 & 0xff);
        buffer[3] = (byte) (id >> 0 & 0xff);
        buffer[4] = (byte) (address >> 8 & 0xff);
        buffer[5] = (byte) (address >> 0 & 0xff);
        buffer[6] = (byte) command;
        buffer[7] = calculateChecksum(id, address, command);
        return buffer;
    }
}

And here's the output:

RfRaw AA B0 4c 0408134C02620118135638192A192A1A1A19292A1929292A1A192A1A1A1A192A1A192A19292A1A1929292A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A192A1A1A1A192A19292A192A192929292A19 55
RfRaw AA B1 04134C02620118135638192A192A1A1A19292A1929292A1A192A1A1A1A192A1A192A19292A1A1929292A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A192A1A1A1A192A19292A192A192929292A19 55

And here's the long winded explainer:


See this: https://github.com/Portisch/RF-Bridge-EFM8BB1/wiki/0xB1

These commands are essentially a set of instructions sent to Portisch that tell it at a low level when to twiddle the radio output.

Using that information, take this as an example:

AA B1 04 1432 0262 012C 14B4 38192A192A1A1A19292A19292A1A1A192929292A1A1A192A1A192A192A192A19292A1A1A1A1A1A1A192A1A1A1A1A1A1A1A1A1A1A1A192A192929292A192929292A19 55

AA: uart sync init
B1: uart command
04: number of buckets: buckets are basically lengths of time in microseconds to have the radio either on or off.
1432: first bucket length in hex: 5170uS
0262: second bucket length in hex: 610uS
012c: third bucket length in hex: 300uS
14b4: fourth bucket length in hex: 5300uS

The rest, starting with the 38192A are the raw data to send. Each byte represents one bit of data and is specified using a two bit coding.

The first and last bucket are synchronization related and aren't really used in data transfer. I think they are probably actually the same, but maybe Portisch didn't have the resolution to recognize it. Bucket 4 is called AGC or "automatic gain control" and is basically a way to wake up the receiver and let it know something is coming. This is sent at the beginning of the packet. Bucket 1 is sent at the end to signal the end of the packet.

Buckets 2 and 3 are the ones we are most interested in. They are what is used to transmit the actual bits of data.

So, to transmit a 1 bit the radio turns on for the number of microseconds in bucket 2 (610) and then low for the number of microseconds in bucket 3 (300). To transmit a 0 it's the opposite: high for 300 then low for 610.

Something to keep in mind is that we're mixing two different systems here. There is the way Portisch represents radio data, which is this bucket and packet system, and the way the actual remotes look at the data, which is just periods of on and off on the radio - this is where OOK comes from - On Off Keying.

So, finally we can decode the data from Portisch. Each byte represents one high/low pair and each nybble of each byte represents one of the two high/low bits. The highest bit of the nybble is the bit, and the bottom three bits are the bucket.

So, starting with 38, which is in hex, we take bottom three bits of the first nybble 3, which are 011 on binary, or 3 in decimal. This is our bucket number - bucket 4 (or 3 if you are counting from 0). And the high bit of 3 is 0 so that's our value.

So, the 3 in 38 means: Turn the radio off (0) for 5300uS (bucket 4)
The 8 means: Turn the radio on (1) for 5170uS (bucket 1)

That's our first byte parsed, and the first bit sent. This is the AGC or wakeup.

Next is 19:
1: Send 0 using bucket 2.
9: Send 1 using bucket 2.

Next is 2A, let's look at it a different way:

0x2A -> 0010 1010
        ^---------- first bit
         ^^^------- first bucket
             ^----- second bit
              ^^^-- second bucket

@manutenfruits
Copy link

Thank you so much! I could not find anywhere documentation that explained what the buckets were supposed to be (maybe it's just part of encoding RF signals). The code is immensely helpful, I'll give it try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants