Github Devices Community Docs Blog

Sonoff RF bridge - from Tasmota to OMG

I have a Sonoff RF bridge that was previously flashed with Tasmota (including the RF EFM8BB1 -

to migrate to OMG, I erased the flash multiple times, uploaded various .bin files successfully with NodeMCU. Are these binaries correct for Sonoff RF bridge or can you identify the latest working release?




rfbridge-firmware.bin (from V093)

Got it working and talking to the broker but not receiving RF signals.

is this because I flashed the RF component (EFM8BB1)? Do I have to roll back to all stock firmware and/or use “direct hack” ?

EDIT: completed direct hack successfully. Works perfectly.


great, thanks for the feedback

Just out of curiosity, since I have bypassed the EFM8BB1 it’s now a non issue, but technically, would a Sonoff RF bridge with Portisch on the EFM8BB1 still be functional with the stock OMG release?

Also, why can’t Pilight work on the “stock” Sonoff RF Gateway? is it related to the EFM8BB1 or the way Pilight software/library is built?

Thanks, cheers!

Hello, i have never tested it but I don’t think it will work.

On the sonoff RF bridge you have 2 choices, use the EFM8BB1 as the decoder or the esp8255.
Pilight, rcswitch or newremoteswitch libraries (used by OMG) support the esp8255 but not the EFM8BB1.

Makes sense.

first item would explain why the stock OMG + Portisch wasn’t working.

Thanks for the response on the second item, it justifies the little extra effort I put on the hack


Note also that there is a newcomer since one day so as to support RF weather stations. For the moment it can’t be cumulated with other ones but it is interesting to know this availability.

I’ve carried out the direct hack. and I’ve been trying all day to compile and upload the firmware as i’d like to have the pilight libary to use with some DG-R8H sensors.

but using arduino IDE i get
ESPiLight.cpp:19:10: error: ESPiLight.h: No such file or directory

#include <ESPiLight.h>


compilation terminated.

exit status 1
ESPiLight.h: No such file or directory

and using i get

> > Executing task in folder OpenMQTTGateway-development: C:\Users\leepa\.platformio\penv\Scripts\platformio.exe run <
> Processing rfbridge (platform: espressif8266@2.2.3; board: esp8285; framework: arduino)
> --------------------------------------------------------------------------------------------------------------------------
> Verbose mode can be enabled via `-v, --verbose` option
> PLATFORM: Espressif 8266 2.2.3 > Generic ESP8285 Module
> HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
> PACKAGES: toolchain-xtensa 2.40802.191122 (4.8.2), framework-arduinoespressif8266 2.20502.0 (2.5.2), tool-esptool 1.413.0 
> (4.13), tool-esptoolpy 1.20600.0 (2.6.0)
> Converting main.ino
> C:/Users/leepa/Downloads/OpenMQTTGateway-development/OpenMQTTGateway-development/main/main.ino:37:0: warning: "array_size" redefined [enabled by default]
>  #define array_size 4
>  ^
> C:/Users/leepa/Downloads/OpenMQTTGateway-development/OpenMQTTGateway-development/main/main.ino:32:0: note: this is the location of the previous definition
>  #define array_size 12
>  ^
> LDF: Library Dependency Finder ->
> LDF Modes: Finder ~ chain, Compatibility ~ soft
> Unicode decode error has occurred, please remove invalid (non-ASCII or non-UTF8) characters from C:\Users\leepa\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266HTTPUpdateServer\ file
> Unicode decode error has occurred, please remove invalid (non-ASCII or non-UTF8) characters from C:\Users\leepa\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266HTTPUpdateServer\ file
> LibraryManager: Installing WiFiManager
> UserSideException: Please install Git client from
>   File "C:\Users\leepa\.platformio\penv\lib\site-packages\platformio\builder\", line 151:
>     env.SConscript("$BUILD_SCRIPT")
>   File "C:\Users\leepa\.platformio\packages\tool-scons\script\..\engine\SCons\Script\", line 605:
>     return _SConscript(self.fs, *files, **subst_kw)
>   File "C:\Users\leepa\.platformio\packages\tool-scons\script\..\engine\SCons\Script\", line 286:
>     exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
>   File "C:\Users\leepa\.platformio\platforms\espressif8266\builder\", line 203:
>     target_elf = env.BuildProgram()
>   File "C:\Users\leepa\.platformio\packages\tool-scons\script\..\engine\SCons\", line 224:
>     return self.method(*nargs, **kwargs)
>   File "C:\Users\leepa\.platformio\penv\lib\site-packages\platformio\builder\tools\", line 140:
>     _build_project_deps(env)
>   File "C:\Users\leepa\.platformio\penv\lib\site-packages\platformio\builder\tools\", line 48:
>     project_lib_builder = env.ConfigureProjectLibBuilder()
>   File "C:\Users\leepa\.platformio\packages\tool-scons\script\..\engine\SCons\", line 224:
>     return self.method(*nargs, **kwargs)
>   File "C:\Users\leepa\.platformio\penv\lib\site-packages\platformio\builder\tools\", line 1027:
>     project.install_dependencies()
>   File "C:\Users\leepa\.platformio\penv\lib\site-packages\platformio\builder\tools\", line 859:
>     lm.install(uri)
>   File "C:\Users\leepa\.platformio\penv\lib\site-packages\platformio\managers\", line 301:
>     force=force,
>   File "C:\Users\leepa\.platformio\penv\lib\site-packages\platformio\managers\", line 696:
>     pkg_dir = self._install_from_url(name, url, requirements, track=True)
>   File "C:\Users\leepa\.platformio\penv\lib\site-packages\platformio\managers\", line 483:
>     vcs = VCSClientFactory.newClient(tmp_dir, url)
>   File "C:\Users\leepa\.platformio\penv\lib\site-packages\platformio\", line 46:
>     src_dir, remote_url, tag, silent
>   File "C:\Users\leepa\.platformio\penv\lib\site-packages\platformio\", line 61:
>     self.check_client()
>   File "C:\Users\leepa\.platformio\penv\lib\site-packages\platformio\", line 127:
>     "Please install Git client from"
> =============================================== [FAILED] Took 1.26 seconds ===============================================
> Environment               Status    Duration
> ------------------------  --------  ------------
> rfbridge                  FAILED    00:00:01.265
> esp32dev-all              IGNORED
> esp32dev-rf               IGNORED
> esp32dev-pilight          IGNORED
> esp32dev-weatherstation   IGNORED
> esp32dev-ir               IGNORED
> esp32dev-ble              IGNORED
> esp32-m5stick-ble         IGNORED
> esp32-m5stack-ble         IGNORED
> esp32-m5stick-c-ble       IGNORED
> ttgo-lora32-v1            IGNORED
> nodemcuv2-all             IGNORED
> nodemcuv2-ble             IGNORED
> nodemcuv2-ir              IGNORED
> nodemcuv2-rf              IGNORED
> test-manual-wifi          IGNORED
> rf-wifi-gateway           IGNORED
> nodemcuv2-rf2             IGNORED
> nodemcuv2-pilight         IGNORED
> nodemcuv2-weatherstation  IGNORED
> sonoff-basic              IGNORED
> sonoff-basic-rfr3         IGNORED
> atmega-all                IGNORED
> uno-rf                    IGNORED
> uno-fastled               IGNORED
> ========================================= 1 failed, 0 succeeded in 00:00:01.265 ========================================= 
> The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

there is something basic I’m getting wrong that someone could help with please?

Which bin file did you upload after the direct hack? do you have the pilight library installed?

You need to compile it yourself via platformIO
here are further details, hope this helps.

PS: not sure if the R8H is supported,
R8S works fine here.

Install Visual studio code
Install PlatformIO which runs on top
Install GIT
Download latest SOURCE CODE.ZIP from

Instructions to compile the BIN file

Additionnal notes:

Open the folder named “OpenMQTTGateway”
Open the platformio.ini file and uncomment the default_envs line

;default_envs = sonoff-basic-rfr3
default_envs = rfbridge
;default_envs = esp32dev-all
;default_envs = esp32dev-rf
;default_envs = esp32dev-ir
;default_envs = esp32dev-ble
;default_envs = ttgo-lora32-v1

Change file user_config.h

//#define ZgatewayRF “RF” //ESP8266, Arduino, ESP32
//#define ZgatewayRF315 “RF315” //ESP8266, Arduino, ESP32
//#define ZgatewayIR “IR” //ESP8266, Arduino, Sonoff RF Bridge
//#define ZgatewayLORA “LORA” //ESP8266, Arduino, ESP32
#define ZgatewayPilight “Pilight” //ESP8266, Arduino, ESP32
//#define ZgatewayBT “BT” //ESP8266, Arduino, ESP32
//#define ZgatewayRF2 “RF2” //ESP8266, Arduino, ESP32

Change file config_RF.h

/-------------------PIN DEFINITIONS----------------------/
#ifdef ESP8266
#define RF_RECEIVER_PIN 4 // D3 on nodemcu // put 4 with rf bridge direct mod
#elif ESP32
#define RF_RECEIVER_PIN 27 // D27 on DOIT ESP32
#elif AVR_ATmega2560
#define RF_RECEIVER_PIN 1 //1 = D3 on mega
#define RF_RECEIVER_PIN 1 //1 = D3 on arduino

#ifdef ESP8266
#define RF_EMITTER_PIN 5 // RX on nodemcu if it doesn’t work with 3, try with 4 (D2) // put 5 with rf bridge direct mod
#elif ESP32
#define RF_EMITTER_PIN 12 // D12 on DOIT ESP32
#elif AVR_ATmega2560
#define RF_EMITTER_PIN 4
//IMPORTANT NOTE: On arduino UNO connect IR emitter pin to D9 , comment #define IR_USE_TIMER2 and uncomment #define IR_USE_TIMER1 on library IRremote/boarddefs.h so as to free pin D3 for RF RECEIVER PIN
//RF PIN definition
#define RF_EMITTER_PIN 4 //4 = D4 on arduino


Erase flash 1 or 2 times before uploading

Then you can upload the program to your board by clicking on the white arrow at the blue bottom bar
If you encounter errors the first thing to do is to clean your environment by using the white dust bin in the blue bottom bar.


It’s not supported yet. I still use RFLink for that.