Updated Sonoff RF Bridge 433 (markdown)

Michael Ingraham 2019-02-28 08:43:46 -05:00
parent 4e90aa0d7b
commit 928cecc781
1 changed files with 26 additions and 27 deletions

@ -1,5 +1,3 @@
* [Itead Product Page](http://sonoff.itead.cc/en/products/appliances/sonoff-rf-bridge-433) * [Itead Product Page](http://sonoff.itead.cc/en/products/appliances/sonoff-rf-bridge-433)
* [Itead Shop](https://www.itead.cc/sonoff-rf-bridge-433.html) * [Itead Shop](https://www.itead.cc/sonoff-rf-bridge-433.html)
* [Itead Wiki](https://www.itead.cc/wiki/Sonoff_RF_Bridge_433) * [Itead Wiki](https://www.itead.cc/wiki/Sonoff_RF_Bridge_433)
@ -40,13 +38,13 @@ After programming make sure to move the switch away from the 5-pin header to res
## Operation ## Operation
During normal operation the serial interface is used at 19200 baud to communicate with the RF microcontroller. It is therefore wise to disable serial logging (``seriallog 0``). During normal operation the serial interface is used at 19200 baud to communicate with the RF microcontroller. It is therefore wise to disable serial logging ([`SerialLog 0`](Commands#seriallog)).
The bridge is able to learn up to 16 different remote control commands of fixed code 433 MHz frequency as provided by PT2260, PT2262, PT2264 and EV1527 Transmitters. I was not able to recognize the latest Klik Aan Klik Uit (KaKu) remote control signals but some people managed to use the fixed code KaKu devices like PAR-1000 receiver and PAT-103 transmitter. The bridge is able to learn up to 16 different remote control commands of fixed code 433 MHz frequency as provided by PT2260, PT2262, PT2264 and EV1527 Transmitters. I was not able to recognize the latest Klik Aan Klik Uit (KaKu) remote control signals but some people managed to use the fixed code KaKu devices like PAR-1000 receiver and PAT-103 transmitter.
Tasmota provides default remote control commands to all 16 keys so you can start using the bridge with a Sonoff 4CH Pro or Sonoff RF device without having the bridge to learn remote control commands. Tasmota provides default remote control commands to all 16 keys so you can start using the bridge with a Sonoff 4CH Pro or Sonoff RF device without having the bridge have to learn remote control commands.
See [Supported Commands](https://github.com/arendst/Sonoff-Tasmota/wiki/Commands#sonoff-rf-bridge-433) for available specific Sonoff RF Bridge 433 commands. See [Supported Commands](Commands#sonoff-rf-bridge-433) for available Sonoff RF Bridge 433 specific commands.
**IMPORTANT:** In the Module configuration GPIO4 and GPIO5 must be left as **00 None** **IMPORTANT:** In the Module configuration GPIO4 and GPIO5 must be left as **00 None**
@ -86,45 +84,46 @@ There, enter rfraw 177 and push the buttons on your remote. Repeat each button 2
This will give you a so called B1 code of your button, which needs to be converted to a B0 code (see below). This will give you a so called B1 code of your button, which needs to be converted to a B0 code (see below).
### Sending of Commands with custom Firmware ### Sending of Commands with custom Firmware
The commands learned with the hacked (Portisch-)Firmware **cannot ** be stored in the webinterface. Instead, they must be sent via MQTT: The commands learned with the hacked (Portisch-)Firmware **cannot ** be stored in the web interface. Instead, they must be sent via MQTT:
`mqtt=">[broker:cmnd/sonoff-8E8329/Backlog:command:ON:RfRaw AAB0210314016703F924180101011001100110010101100110011001010110010101100255; RfRaw 0],` openHAB example: `mqtt=">[broker:cmnd/sonoff-8E8329/Backlog:command:ON:RfRaw AAB0210314016703F924180101011001100110010101100110011001010110010101100255; RfRaw 0],`
Refer to [this](https://github.com/arendst/Sonoff-Tasmota/issues/3973) issue for further information Refer to [this issue](https://github.com/arendst/Sonoff-Tasmota/issues/3973) for further information
### Interactive B1 to B0 tool ### Interactive B1 to B0 tool
Here ([link](https://github.com/henfri/bitbuckedconverter/blob/master/BitBucketConverter)) an interactive tool was developed to learn Commands/Codes. An [interactive tool](https://github.com/henfri/bitbuckedconverter/blob/master/BitBucketConverter) was developed to learn Commands/Codes.
Process: Process:
-Run rfraw 177 in your SonOff console -Push all your remote (each Button 2-3 times) -Run rfraw 177 in your SonOff console -Push all your remote (each Button 2-3 times)
-Save everything from the console that happened after rfraw 177 to a file, e.g. console.txt -Save everything from the console that happened after rfraw 177 to a file, e.g. console.txt
a) Run bitbuckedconverter.py -f console.txt a) Run bitbuckedconverter.py -f console.txt
- Each line of console.txt will be converted into a B0 string and displayed
b) Run bitbuckedconverter.py -f console.txt -e b) Run bitbuckedconverter.py -f console.txt -e
- Each line of console.txt will be converted into a B0 string and send to the Bridge.
In case of a) each line of console.txt will be converted into a B0 string and displayed
In case of b) each line of console.txt will be converted into a B0 string and send to the Bridge.
Then: Then:
* if the device reacted as expeced, you can enter a name of the button (e.g. "light") * If the device reacted as expected, you can enter a name of the button (e.g. "light")
* else enter nothing to try the next * Else enter nothing to try the next
* repeat this until all lines have been tried * 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) * 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 * In the end you can test all of these codes
### B1 to B0 helping tool ### B1 to B0 helping tool
(if you prefer the non interactive version) (if you prefer the non interactive version)
After learning how bit bucket works from here [#23](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' command in Tasmota from the received 'B1' sniffing message (rename file from 'BitBucketConverter.txt' to 'BitBucketConverter.py'. 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'.
[Python Script](https://github.com/Portisch/RF-Bridge-EFM8BB1/files/2374903/BitBucketConverter.txt) [Python Script](https://github.com/Portisch/RF-Bridge-EFM8BB1/files/2374903/BitBucketConverter.txt)
In the command line give the 'B1' message string and the retries value (in decimal): In the command line give the 'B1' message string and the retries value (in decimal):
i.e. BitBucketConverter.py "AA B1 04 07EB 0157 00FD 3EBC 010101010101101001010101101010100103 55" 20 e.g., BitBucketConverter.py "AA B1 04 07EB 0157 00FD 3EBC 010101010101101001010101101010100103 55" 20
Command Line : "AA B1 04 07EB 0157 00FD 3EBC 010101010101101001010101101010100103 55" 20 Command Line : "AA B1 04 07EB 0157 00FD 3EBC 010101010101101001010101101010100103 55" 20
Result: 'RfRaw AAB01C041407EB015700FD3EBC01010101010110100101010110101010010355' Result: 'RfRaw AAB01C041407EB015700FD3EBC01010101010110100101010110101010010355'
### 'Raw sniffing' procedure. ### 'Raw sniffing' procedure.
With Portisch suggestions I did the following: As suggested by the Portisch firmware, perform the following:
In Tasmota console I sent
In the Tasmota console, send
*** ***
22:58:44 CMD: **RfRaw AAB155** 22:58:44 CMD: **RfRaw AAB155**
*** ***
@ -139,7 +138,7 @@ The second one tells that the EFM8BB1 RF chip new firmware accepts the command a
22:58:44 MQT: gvf/cega/bridge1/tele/RESULT = **{"RfRaw":{"Data":"AAA055"}}** 22:58:44 MQT: gvf/cega/bridge1/tele/RESULT = **{"RfRaw":{"Data":"AAA055"}}**
*** ***
After that I kept pushing one of the buttons in the remote. After that keep pushing one of the buttons on the remote.
*** ***
22:58:44 MQT: gvf/cega/bridge1/tele/RESULT = {"RfRaw":{"Data":"AAA055"}} 22:58:44 MQT: gvf/cega/bridge1/tele/RESULT = {"RfRaw":{"Data":"AAA055"}}
@ -185,17 +184,17 @@ After that I kept pushing one of the buttons in the remote.
22:58:59 MQT: gvf/cega/bridge1/tele/RESULT = {"RfRaw":{"Data":"AA B1 03 07F4 0123 37D2 010101010101101001010101101010100102 55"}} 22:58:59 MQT: gvf/cega/bridge1/tele/RESULT = {"RfRaw":{"Data":"AA B1 03 07F4 0123 37D2 010101010101101001010101101010100102 55"}}
*** ***
I received a sequence of messages. All starting 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 I discarded 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 I discarded the first message (it contains 4 buckets, whereas the rest have only 3 buckets). In the example, discard the first message (it contains 4 buckets, whereas the rest have only 3 buckets).
I then examined the values on the buckets in order to choose the message where more buckets where 'similar'. 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.