From 07df1aadbef63536a1a017241097c0018c0fa27e Mon Sep 17 00:00:00 2001 From: Michael Ingraham <34340210+meingraham@users.noreply.github.com> Date: Wed, 31 Jul 2019 13:15:47 -0400 Subject: [PATCH] Updated Sonoff RF Bridge 433 (markdown) --- Sonoff-RF-Bridge-433.md | 139 +++++++++++++++++++++------------------- 1 file changed, 72 insertions(+), 67 deletions(-) diff --git a/Sonoff-RF-Bridge-433.md b/Sonoff-RF-Bridge-433.md index f5b6aa9d..70424511 100644 --- a/Sonoff-RF-Bridge-433.md +++ b/Sonoff-RF-Bridge-433.md @@ -79,90 +79,95 @@ cmnd/sonoffRFBridge/Backlog RfRaw AAB0210314016703F92418010101100110011001010110 Refer to [issue #3973](https://github.com/arendst/Sonoff-Tasmota/issues/3973) for further information. -### Interactive B1 to B0 tool -An [interactive tool](https://github.com/henfri/bitbuckedconverter/blob/master/BitBucketConverter) was developed to learn Commands/Codes. -Process: -1. Run `rfraw 177` in your SonOff console -2. Push all your remote (each Button 2-3 times) -3. Save everything from the console that happened after `rfraw 177` to a file, e.g. console.txt -4. Run bitbuckedconverter.py -f console.txt - - Each line of console.txt will be converted into a B0 string and displayed -5. Run bitbuckedconverter.py -f console.txt -e - - Each line of console.txt will be converted into a B0 string and sent to the Bridge +### B1 to B0 Conversion Tools +After learning how bitbucket works from the [Portisch wiki](https://github.com/Portisch/RF-Bridge-EFM8BB1/issues/23), use one of these tools to help convert received `B1` sniffing messages to the right 'B0' format to send in the ['RfRaw'](Commands#rfraw) command. -Then: -* If the device reacted as expected, you can enter a name of the button (e.g., "light") -* Else enter nothing to try the next -* Repeat this until all lines have been tried -* The tool will create a list of buttons and their B0 codes that have worked (i.e. for which you have specified a name) -* In the end you can test all of these codes +- [**Online**](http://bbconv.hrbl.pl/) + Process: + 1. Enter `rfraw 177` in the Sonoff Bridge web UI Console + 2. Press a function (each Button 2-3 times) on your remote control + 3. Copy the JSON payload output from the Console and paste it in the online converter and click `Convert` + e.g., `{"RfRaw":{"Data":"AA B1 03 07F9 0124 37DC 010101010101101001010101101010100102 55"}}` + 4. The utility will return the resulting B0 string to use in setting up commands in the RF Bridge + e.g., `AA B0 1A 03 08 07F9 0124 37DC 010101010101101001010101101010100102 55` -### B1 to B0 helping tool -_(if you prefer the non interactive version)_ +- [**CLI**](https://github.com/Portisch/RF-Bridge-EFM8BB1/files/2374903/BitBucketConverter.txt) (rename file from `BitBucketConverter.txt` to `BitBucketConverter.py`) + In the command line give the `B1` message string and the retries value (in decimal): + e.g., `BitBucketConverter.py "AA B1 04 07EB 0157 00FD 3EBC 010101010101101001010101101010100103 55" 20` -After learning how bitbucket works from [here](https://github.com/Portisch/RF-Bridge-EFM8BB1/issues/23), this is a python script to help calculate the right 'B0' message to send using ['RfRaw'](Commands#rfraw) command in Tasmota from the received 'B1' sniffing message (rename file from 'BitBucketConverter.txt' to 'BitBucketConverter.py'. + Command Line : `"AA B1 04 07EB 0157 00FD 3EBC 010101010101101001010101101010100103 55" 20` + Result: `RfRaw AAB01C041407EB015700FD3EBC01010101010110100101010110101010010355` -[Python Script](https://github.com/Portisch/RF-Bridge-EFM8BB1/files/2374903/BitBucketConverter.txt) +- [**Batch**](https://github.com/henfri/bitbuckedconverter/blob/master/BitBucketConverter) + Process: + 1. Enter `rfraw 177` in the Sonoff Bridge web UI Console + 2. Press each function (each Button 2-3 times) on your remote control + 3. Save everything from the console that happened after `rfraw 177` to a text file + 4. Run bitbuckedconverter.py -f console.txt + - Each line of console.txt will be converted into a B0 string and displayed + 5. Run bitbuckedconverter.py -f console.txt -e + - Each line of console.txt will be converted into a B0 string and sent to the Bridge -In the command line give the 'B1' message string and the retries value (in decimal): -e.g., `BitBucketConverter.py "AA B1 04 07EB 0157 00FD 3EBC 010101010101101001010101101010100103 55" 20` + Then: + * If the device reacted as expected, you can enter a name of the button (e.g., "light") + * Else enter nothing to try the next + * Repeat this until all lines have been tried + * The tool will create a list of buttons and their B0 codes that have worked (i.e. for which you have specified a name) + * In the end you can test all of these codes -Command Line : `"AA B1 04 07EB 0157 00FD 3EBC 010101010101101001010101101010100103 55" 20` -Result: `RfRaw AAB01C041407EB015700FD3EBC01010101010110100101010110101010010355` +- **"Raw sniffing"** + As suggested by the Portisch firmware, perform the following: -### 'Raw sniffing' procedure. -As suggested by the Portisch firmware, perform the following: + In the web UI Console, send + `RfRaw AAB155` -In the Tasmota console, send -`RfRaw AAB155` + This will result in two consecutive messages: + 1. The first one tells you that you are using one of the new firmware commands + `22:58:44 MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":"ON"}` -This will result in two consecutive messages: -1. The first one tells you that you are using one of the new firmware commands - `22:58:44 MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":"ON"}` + 2. The second one tells that the EFM8BB1 RF chip new firmware accepts the command and enters raw sniffing mode ('A0' means 'ACK') + `22:58:44 MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AAA055"}}` -2. The second one tells that the EFM8BB1 RF chip new firmware accepts the command and enters raw sniffing mode ('A0' means 'ACK') - `22:58:44 MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AAA055"}}` + After that keep pushing one of the buttons on the remote. + ``` + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AAA055"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 04 07F0 0128 00F2 3822 010101010101101001010101101010100103 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F9 0124 37DC 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F9 0124 37DC 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F4 0126 37D2 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F5 0127 37D2 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F7 0125 37DC 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F9 0125 37D2 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F4 0123 37C8 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F9 0124 37D2 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07FC 011E 37D2 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F8 0125 37D2 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F8 0124 37D2 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F9 0125 37D2 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F8 0122 37C8 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F1 012D 37D2 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F4 0123 37C8 010101010101101001010101101010100102 55"}}` + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F8 0128 37C8 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F9 0124 37D2 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F4 0124 37C8 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F9 0124 37C8 010101010101101001010101101010100102 55"}} + MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F4 0123 37D2 010101010101101001010101101010100102 55"}} + ``` -After that keep pushing one of the buttons on the remote. -``` -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AAA055"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 04 07F0 0128 00F2 3822 010101010101101001010101101010100103 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F9 0124 37DC 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F9 0124 37DC 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F4 0126 37D2 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F5 0127 37D2 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F7 0125 37DC 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F9 0125 37D2 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F4 0123 37C8 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F9 0124 37D2 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07FC 011E 37D2 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F8 0125 37D2 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F8 0124 37D2 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F9 0125 37D2 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F8 0122 37C8 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F1 012D 37D2 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F4 0123 37C8 010101010101101001010101101010100102 55"}}` -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F8 0128 37C8 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F9 0124 37D2 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F4 0124 37C8 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F9 0124 37C8 010101010101101001010101101010100102 55"}} -MQT: tele/sonoffRFbridge/RESULT = {"RfRaw":{"Data":"AA B1 03 07F4 0123 37D2 010101010101101001010101101010100102 55"}} -``` + Notice that this sequence of messages all start with 'AA' then 'B1' and the last byte '55' -Notice that this sequence of messages all start with 'AA' then 'B1' and the last byte '55' + The reason for pushing the remote button for several seconds is to get enough 'AA B1 ...... 55' sequences to select the best one to be transmitted back. -The reason for pushing the remote button for several seconds is to get enough 'AA B1 ...... 55' sequences to select the best one to be transmitted back. + Then discard the sequences with 'data values' not equal. -Then discard the sequences with 'data values' not equal. + In the example 'data values' are the **`010101010101101001010101101010100102`** string. -In the example 'data values' are the **`010101010101101001010101101010100102`** string. + Notice that before that 'data values' string there are several 2 byte values (they are called 'buckets'); they are time values in microseconds. The number of 'buckets' is indicated in a previous byte (in the example a 3 or a 4). -Notice that before that 'data values' string there are several 2 byte values (they are called 'buckets'); they are time values in microseconds. The number of 'buckets' is indicated in a previous byte (in the example a 3 or a 4). + In the example, discard the first message (it contains 4 buckets, whereas the rest have only 3 buckets). + Examine the values on the buckets in order to choose the message where more buckets are 'similar'. -In the example, discard the first message (it contains 4 buckets, whereas the rest have only 3 buckets). -Examine the values on the buckets in order to choose the message where more buckets are 'similar'. - -For example messages with '_**37D2**_' in the third bucket are good candidates. Messages with '_**0124**_' in the second bucket are also good candidates. First bucket values are very similar; '_**07F8**_' can be a good one. + For example messages with '_**37D2**_' in the third bucket are good candidates. Messages with '_**0124**_' in the second bucket are also good candidates. First bucket values are very similar; '_**07F8**_' can be a good one. ## Official Sources * [Itead Product Page](http://sonoff.itead.cc/en/products/appliances/sonoff-rf-bridge-433)