Re-order & #6865

Michael Ingraham 2019-11-08 20:49:22 -05:00
parent b05bc03a47
commit 0b7befe53a
1 changed files with 42 additions and 37 deletions

@ -1,36 +1,35 @@
## Overview
The Sonoff RF Bridge has two separate chips to handle the Wi-Fi (ESP8285) and RF (EFM8BB1) communications respectively. It is used to send and receive codes with 433.9MHz frequency RF devices. Codes received from RF devices such as remote controls is passed to the onboard ESP8285 via the serial interface. The code data is relayed via MQTT. Similarly, the Bridge receives commands over Wi-Fi and sends the encoded data to the RF chip to control an RF device. Thus, the Sonoff RF Bridge "bridges" communications between RF and Wi-Fi.
In addition to the ESP8266, the bridge has an *RF chip* (433MHz) for which there is a custom firmware commonly referred to as 'Portisch'. The original Sonoff RF firmware is limited to mostly just Sonoff RF devices (a single 24-bit RF protocol). By updating the firmware on the RF chip (EFM8BB1 MCU), new features and types of devices become usable. Tasmota supports the original Sonoff RF firmware and [Portisch firmware](https://github.com/Portisch/RF-Bridge-EFM8BB1).
## Flash Tasmota
Please [see](How-to-Flash-the-RF-Bridge) for flashing details and the [Hardware Preparation](Hardware-Preparation) article for general flashing instructions.
The RF upgrade requires wiring the bridge and then flashing the firmware via Tasmota Web UI ([details below](#rf-firmware-upgrade)).
## Serial Connection
Please see the [Hardware Preparation](https://github.com/arendst/Tasmota/wiki/Hardware-Preparation) page for general instructions.
As always, you need to access the serial interface. The **four serial pins** (3V3, RX, TX, GND) connected to the ESP8285 are available on the 5-pin header just next to the switch as can be seen in the image.
Access the serial interface available on the 5-pin header next to the switch as can be seen in the image.
![](https://github.com/arendst/arendst.github.io/blob/master/media/sonoff_bridge_2.jpg?raw=true)
Move the switch towards the 5-pin header, keep the button on the edge pressed and connect the serial-to-USB adapter.
To flash the ESP8285, first move the switch position towards the 5-pin header.
After programming make sure to move the switch away from the 5-pin header to restore connection to the RF microcontroller. Select device Sonoff Bridge in configuration page!!!
Connect the serial-to-USB adapter and press the button on the edge while powering the device in order to put the ESP8285 into programming mode in order to upload the Tasmota firmware.
After flashing the ESP8285, be sure to move the switch position away from the 5-pin header to restore the connection to the RF microcontroller.
Configure the device as usual and select module `Sonoff Bridge (25)`. During normal operation the serial interface is used at 19200 baud to communicate with the RF microcontroller. Therefore serial logging ([`SerialLog 0`](Commands#seriallog)) must be disabled.
**IMPORTANT:** In the Module configuration GPIO4 and GPIO5 must be left as **`00 None`** On R2 versions of the Sonoff RF Bridge, a hardware modification is required in order to use these GPIO.
### Video tutorial by alsolh
[![](http://img.youtube.com/vi/XixXbg2T4Ns/0.jpg)](http://www.youtube.com/watch?v=XixXbg2T4Ns "")
## RF Firmware
The RF chip has its own firmware. The device is shipped with Itead firmware which supports a limited set of RF devices limited to mostly just Sonoff devices (a single 24-bit RF protocol). Some later versions of the factory firmware will only relay received RF data once the transmitting device stops. This is fine for remote controls or devices such as door sensors. But for devices such as smoke detectors, this behavior is not acceptable.
## 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`](https://github.com/arendst/Tasmota/wiki/Commands#seriallog)).
Custom firmware is available for the RF chip which is commonly referred to as 'Portisch'. By updating the firmware on the RF chip, new types of devices and new features become usable. It also relays the RF data when the data is received rather than waiting until the transmitter stops.
The bridge is able to learn up to 16 different remote control commands of fixed code at 433 MHz frequency as provided by PT2260, PT2262, PT2264 and EV1527 transmitters. It 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 supports the original Sonoff RF firmware and the [Portisch firmware](https://github.com/Portisch/RF-Bridge-EFM8BB1).
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.
### RF Firmware Upgrade
The RF upgrade requires wiring the bridge and then flashing the firmware via the Tasmota web UI.
See [RF Commands](https://github.com/arendst/Tasmota/wiki/Commands#sonoff-rf-bridge) for Sonoff RF Bridge 433 specific commands.
**IMPORTANT:** In the Module configuration GPIO4 and GPIO5 must be left as **`00 None`**
## RF Firmware Upgrade
**Attention ⚠️️⚠️️⚠️️ There are 2 versions of the `Sonoff RF Bridge 433`: the `R1` and the `R2 V1.0`.
**R1**
@ -39,37 +38,44 @@ See [RF Commands](https://github.com/arendst/Tasmota/wiki/Commands#sonoff-rf-bri
**R2 V1.0** RF firmware flashing:
<img src="https://github.com/arendst/arendst.github.io/raw/master/media/sonoff_bridge_rffw_upgrade.png" width="300">
### Hardware Preparation - _R2 Board only_
#### Hardware Preparation
_This section applies only to the R2 revision of the Sonoff RF Bridge_
<img src="https://user-images.githubusercontent.com/34340210/53682776-39f49700-3cc7-11e9-9184-4cecf2a3a4c3.png" width="250" align="right" />
Apply this modification **_only_** if you intend to use USB for powering the device during flash process or if you want to use GPIO4 or GPIO5 for other purposes with the RF Bridge.
The R2 revision boards connect the GPIO4 and GPIO5 pins to the USB data lines of the power connector. Compliant USB chargers/power supplies are expected to short the two pins together, which is no good. These lines are not used by the original firmware, nor by Tasmota. The traces toward the USB power connector need to be cut to avoid interference by the USB wiring. Removing these connections does not interfere with the normal Bridge functionality.
The R2 revision boards connect the GPIO4 and GPIO5 pins to the USB data lines of the power connector. Compliant USB chargers/power supplies are expected to short the two pins together, which is a problem. These lines are not used by the original firmware, nor by Tasmota. The traces toward the USB power connector need to be cut to avoid interference by the USB wiring. Removing these connections does not interfere with the normal Bridge functionality.
### Flashing Portisch RF Firmware
#### Flashing RF Firmware
1. Make sure you have previously flashed a Tasmota binary built with `RF_FLASH`. Refer to the [builds table](Builds) for pre-compiled binaries which include this feature. Otherwise the "Magic byte is not 0xE9" error will occur.
2. Set the module type to `Sonoff Bridge (25)`
3. This step will be different depending on your `Sonoff RF Bridge 433` hardware version. You will have to connect two wires:
1. For `R1`: Connect `GPIO4 to C2Ck` and `GPIO5 to C2D`.
2. For `R2`: Connect `GPIO4 to C2D` and `GPIO5 to C2Ck`.
(:warning: The text on the R2 PCB silkscreen is switched. Therefore this is the same wiring as on the R1)
4. Switch the ON/OFF switch on the board to 'OFF' to switch off the RF.
3. Connect two wires (this will be different depending on the `Sonoff RF Bridge 433` hardware version):
- For `R1`: Connect `GPIO4 to C2Ck` and `GPIO5 to C2D`.
- For `R2`: Connect `GPIO4 to C2D` and `GPIO5 to C2Ck`.
(:warning: The text on the R2 PCB silkscreen is switched. Therefore this is the same wiring as on the R1)
4. Switch the ON/OFF switch on the board to 'OFF' to turn off the RF.
5. Power up the bridge via the 3.3V & GND pins. (See below if you need to power the device through the USB power port)
6. Go to the Web UI **Firmware Upgrade** > **Upgrade by File Upload** (introduced in v6.0.0a)
7. Download the Portisch Firmware: <br>(Downloading them from the GitHub web site does **not** work since it will download the GitHub preview/content of the file)
1. Download the entire contents of the [Tasmota GitHub project](https://github.com/arendst/Tasmota/tree/master/) project via the green `Clone or Download` button to ensure that the firmware hex files are downloaded properly. The firmware files are located in the `./tools/fw_efm8bb1/` folder. **Select the newest available hex file. Otherwise you may get `error "Magic byte is not 0xE9"`**.
2. As an alternative use wget/curl or PowerShell to download the raw file (https://github.com/arendst/Tasmota/tree/master/tools/fw_efm8bb1) directly. **Select the newest available hex file. Otherwise you may get `error "Magic byte is not 0xE9"`**.
6. Obtain the Portisch firmware file:
(Clicking on the file link on the GitHub web site does **not** work since this will download the GitHub preview/content of the file rather than the raw file contents)
- Download the entire contents of the [Tasmota GitHub project](https://github.com/arendst/Tasmota/tree/master/) project via the green `Clone or Download` button to ensure that the firmware hex files are downloaded properly. The firmware files are located in the `./tools/fw_efm8bb1/` folder. **Select the newest available hex file. Otherwise you may get `error "Magic byte is not 0xE9"`**.
- As an alternative use wget/curl to download the raw file (https://github.com/arendst/Tasmota/tree/master/tools/fw_efm8bb1) directly. **Select the newest available hex file. Otherwise you may get `error "Magic byte is not 0xE9"`**.
PowerShell example:
```
wget https://github.com/arendst/Tasmota/raw/master/tools/fw_efm8bb1/RF-Bridge-EFM8BB1-XXXXXXXX.hex -OutFile .\RF-Bridge-EFM8BB1-XXXXXXXX.hex
```
8. In the file selection dialog, navigate to the folder on your computer where you saved the hex file.
9. Hit **Start Upgrade**. The flashing should complete within 60 seconds. Device will restart after upgrade completes.
7. Go to the Web UI **Firmware Upgrade** > **Upgrade by File Upload** (introduced in v6.0.0a)
8. In the file selection dialog, navigate to the folder on your computer where you saved the hex file from step 6.
9. Click **Start Upgrade**. The flashing should complete within 60 seconds. Device will restart after upgrade completes.
10. Disconnect wiring and put the ON/OFF switch on the board back to 'ON' to enable the RF again.
# Operation
The Sonoff RF Bridge is able to learn up to 16 different fixed code remote control commands as provided by PT2260, PT2262, PT2264 and EV1527 transmitters. It 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 have to learn remote control commands.
See [Sonoff RF Bridge Commands](Commands#sonoff-rf-bridge).
## Portisch Firmware Specific Usage
These sections only apply to the custom Portisch firmware.
@ -88,7 +94,6 @@ cmnd/sonoffRFBridge/Backlog RfRaw AAB0210314016703F92418010101100110011001010110
```
Refer to [issue #3973](https://github.com/arendst/Tasmota/issues/3973) for further information.
### 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.
@ -183,5 +188,5 @@ After learning how bitbucket works from the [Portisch wiki](https://github.com/
* [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 Wiki](https://www.itead.cc/wiki/Sonoff_RF_Bridge_433)
* [How to Flash the RF Bridge](https://github.com/arendst/Tasmota/wiki/How-to-Flash-the-RF-Bridge)
* [How to Flash the RF Bridge](How-to-Flash-the-RF-Bridge)
* [RF Bridge 433 R2 Information](https://github.com/arendst/Tasmota/issues/1916)