Github Boards Devices Community Docs Blog

Sonoff RF Bridge 433 + Digoo DG-R8H 433MHz

So I make the hardware modification on the Sonoff RF Bridge (mine is R2 V1) :

I downloaded the OpenMQTTGateway_sources and the rfbridge-libraries
and I put all 2 in the ArduinoIde “libraries” folder
I uncoment "#define ZgatewayPilight “Pilight” and I change the pin’s in the config_RF.h

Now I don’t know witch board I must choose from Tools menu cause if I try to compile it give me the error:

Board generic (platform esp8266, package esp8266) is unknown
Error compiling for board Generic ESP8266 Module.

Thanks a lot for the help

I have solve all problems with the board under ArduinoIde
but then it give me a lot of error about “libs not found”.

So I read some docs that tell me that is better if I use Visual Studio with PlatformIO.
So I installed all, then I downloaded again the OMG version 0.9.4
then I modified the User_config.h (wifi,mqtt)
then I uncomment the record: #define ZgatewayPilight “Pilight”
then I define t 4 and 5 PIN in config_RF.h
then I click the Build icon…
It give me the error:

Building in release mode
Compiling .pio\build\rfbridge\src\main.ino.cpp.o
Generating LD script .pio\build\rfbridge\ld\
Compiling .pio\build\rfbridge\liba9e\PubSubClient_ID89\PubSubClient.cpp.o
Archiving .pio\build\rfbridge\lib7a8\libArduinoJson_ID64.a
Compiling .pio\build\rfbridge\liba04\ArduinoLog\ArduinoLog.cpp.o
Compiling .pio\build\rfbridge\libde6\ESP8266WiFi\BearSSLHelpers.cpp.o
Compiling .pio\build\rfbridge\libde6\ESP8266WiFi\CertStoreBearSSL.cpp.o
Compiling .pio\build\rfbridge\libde6\ESP8266WiFi\ESP8266WiFi.cpp.o
Compiling .pio\build\rfbridge\libde6\ESP8266WiFi\ESP8266WiFiAP.cpp.o
Compiling .pio\build\rfbridge\libde6\ESP8266WiFi\ESP8266WiFiGeneric.cpp.o
D:/OpenMQTTGateway-0.9.4/main/ZgatewayPilight.ino:36:24: fatal error: ESPiLight.h: No such file or directory

Someone can help me please to flash the Sonoff RF ?
Thanks in advance
(Baia Mare:-)

Would it be possible to test the code below on an esp8266 ?

It could be a first step for the r8s integration.

With platformio you don’t need to modify user_config.h. Just uncomment the env you want to build.

Sorry but is the first time that I use
I have restart all from beginning and I only change the WiFi and MQTT
credentials and settings in the user_config.h
Then I click the build icon… now I’m here from about 20 minutes to wait that finish work.
I don’d understand what it do all this time.

So next step will be to uncomment the env in the platformio.ini file ?
Then… what I uncomment ? the “default_envs = rfbridge” or the “default_envs = esp32dev-pilight” ?
…or all two ?

Thanks a lot again

The rfbridge does not contain an esp32.

Ok… bu in this case I don’t understand how understand that I want PiLight

I program it with default_envs = rfbridge and now I can see in my MQTT broker some topics:

But if I push some rf433 remote from my alarm there is no updates in the MQTT.
Maybe it’s work… but I don’t know ?

I think I’m missing something… cause in this blog page you tell us to uncomment the:
#define ZgatewayPilight “Pilight”
in the user_config.h file.

Can you let me know the right way please ?

Thanks a lot again

Nobody can help me please ?

Here is an evironment description that you should add to your .ini file:

platform = ${com.esp8266_platform}
board = esp8285
lib_deps =
build_flags =
board_build.flash_mode = dout

Once done you can add also the call at the begining of the ini file:
default_envs = rfbridge-pilight

These are the instructions for Arduino IDE not for platformio.

At final, and to come back to this thread subject I don’t know yet if I’m going to add the R8H to Pilight or RCSwitch or with another way. So you may load Pilight but you would have to reload a different version later.

This is not a problem… the first time is more difficult :slight_smile:

Thanks a lot for the piece of source code.
I modified, build and upload the code… and everything was ok until I test it.
But I think my Sonoff RF now it’s broke.
Cause is not work anymore. Not MQTT topics, no WiFi link (cause no ping)
No WiFi manager… nothing.
I’ll need more time to test and understand what’s wrong.
And if I can’t make it work I think I’ll make a new OMG using NodeMcu (cause I have some boards at home)

In your opinion… is better SonoffRF or NodeMCU + radio please ?
And in the mean time… witch radio hardware is best quality in order to linked to the NodeMcu please ?
I’ll buy it and wait to arrive the shipping.

Thanks a lot again

If you are able to upload the ESP is still alive, did you try to erase the flash memory?

NodeMCU are easier to upload and update but you will need a box.
RFBridge as a box but is limited by its internal decoder if you don’t modify it.

You can take the superheterodyne ones linked below (affiliated links) :

IT’S WORK !!! :slight_smile:
…it was “pio run --target erase”

Now in my MQTT broker I receive:
…from a remote that I have at home alarm
I receive all the dor sensor, and I received also in Node-Red node test :slight_smile:
So it’s like it’s work :slight_smile:

The olnly think that I don’t receive is the car gate remote… and I know it’s 433mHz
…but is not the right place here in this thread.

So now I’ll wait that R8H will arrive and I think then I will watch this thread in order
to try to make it work

Thanks a lot for all help… and the future one :slight_smile:



It is normal, most of the time car gate use a rolling code system (at each press the code is different) to avoid hacking. It should feel you safer also :wink:

Hello guys

I have 2 Digoo DG-R8H. I can get the proper information using nexus433 on RaspberryPi…
Client mosqsub|30542-paul-Insp received PUBLISH (d0, q0, r0, m0, ‘nexus433/sensor/da01/state’, … (72 bytes))
nexus433/sensor/da01/state { “temperature”: 22.7, “humidity”: 75, “battery”: “100”, “quality”: 66 }

But as denisj, I would prefer to use Open MQTT Gateway with Sonoff RF Bridge.

So, I followed your the instructions in this tread (thanks a lot) and I got my RF Bridge working receiving door sensors but I am not getting the Digoo DG-R8H information…

Did I missed something?
1technophile asking to test code on an esp8266 (PrologueDecoder)
Is this something I should use?


Hi Paul,
1tecnophile promise me that when will find some time in order to test OMG with DG-R8H,
and develope it, he will tell us how to update the firmware of RF Bridge.

Maybe we can help him… but I’m Cobol programmer and I don’t know how to make test.


1 Like

Hi Denis,

I will be please to help also!
I am DBA and doing a lot of Perl programming for automation…
I am looking forward to learn Python.

The code that 1tecnophile putted for testing, where should it be putted?

Any news? I think the R8S is already working on OMG with PiLight but the the R8H :confused:

On my todo for this summer

1 Like

Watching =)
I have the hacked Sonoff +OMG working with the R8S but also have some R8H waiting for OMG compatibility.
I can provide testing assistance.
Enjoy the summer and keep us posted. Cheers.

Sorry for my stupid question … I so e new release mail…
so it’s there also the new version
in order to make work the DIGOO R8H please ?
Thanks a lot.