Accéder au contenu principal

SONOFF RF BRIDGE + Pilight or How to extend the supported protocols by our little bridge

With version V0.9 of OpenMQTTGateway @steadramon & @puuu (the ESP library creator) enabled by their work to integrate Pilight library on OMG.

Permiting to increase significantly the list of RF protocols of OMG .

But now that we have this interesting possibility and with the goal of OMG of beiing multi boards compatible, why not trying to put Pilight on a Sonoff RF Bridge.

So as to do this test I ordered a new one so as to be on the same hardware as most of the users (my other RF Bridge is a demonstration old one)



So as to decode RF signals the Sonoff RF Bridge has a special dedicated chip (EFM8BB1) that communicate with the esp8285 with a serial connection.
If we want to increase the number of RF protocols compatibles on the device without modifying the hardware, the only software based solution is to hack the EFM8BB1. This hack is available and made by @Portisch.
The list of protocol is interesting but at the moment not as big as Pilight one. Maybe I will test this nice work later.

The second possibility is to modify the bridge hardware to connect directly the receiver and the emitter to the ESP8285. This way we are more close to the usage done traditionaly with OpenMQTTGateway, the decoder/encoder job is done by the microcontroller and not by a separate uc.

This is where @wildwiz enter to the scene, he made a detailled tutorial on ESPURNA wiki on how to do that, it is call the direct hack.

Here is my bridge before the modification.



No needs to detail more the hardware modifications to make, if you follow carrefully the instructions from @wildwiz it should be OK.
You need, to do that, some soldering dexterity due to the little components on which you will have to attach your resistors. 
Be ready (psychologically) also on breaking potentialy your RF Bridge.

Here is the result on mine after the modification:




You can see the two resistors added and the two cut traces.

Once the direct hack has been done we can upload to the bridge with OMG, 
so as to do that you can follow the tutorial on the wiki and stop before the software setup section. 

In terms of gateways to use we have now several possibilities:
  • ZgatewayRF
  • ZgatewayRF2
  • ZgatewayPilight
As the goal is to check the piligh library integration on the board we are going to try ZgatewayPilight of course.

We just left this one uncommented.

Regarding RF configuration we need to say to the ESP8285 that now he has to use the RF Bridge receiver and emitter pins. We configure config_RF.h like this
:
And that's all. Now upload the code to the bridge and you should see that when pressing a button (this extract contains also my other boards reception):



You see above that my arduino Uno with an ethernet shield is the first to answer but that s another story.

We can also now receive temperature and humidity from a DIGOO DG-R8S




You can of course send commands also by using the syntax detailled into the wiki and control power plugs or other actuators.

And that's it we have now extended the protocols supported by the SONOFF RF BRIDGE!


Commentaires

  1. I have managed to install Pilight, how ever i have lost protocols using in the normal RF version ( buttons, sensors). is there an option to use both?

    RépondreSupprimer
  2. Hi,

    I just made the hardware modifications (two resistors, two cuts) on a working device (R2 BOARD) and after that I am getting no RF signal. Previously it was running Tasmota.

    The device connects to my MQTT, send wifi infos, etc, but even if I build the firmware with #define ZgatewaySRFB "SRFB" option, nothing RF related arrives.

    My RF led is flashing sometimes but not when I press the button on a remote, but my Wifi LED never. I applied 330 Ohm resistors. Do you have any idea before I buy a new one? :)

    RépondreSupprimer
    Réponses
    1. Hi, Once the modification is done you can use ZgatewayRF, RF2 or Pilight. ZgatewaySRFB will no longer work as you are bypassing the EFM8BB1.

      Did you tried to change the position of the switch, I don't remenber if it can affect when using the hardware mod.

      Supprimer
    2. Hi,

      Thanks for your answer. I tried the switch in both positions, didn't help. Also tried with RF, RF2 and Pilight, nothing worked -> that's why I tried SRFB as a last resort before writing a comment :)
      As nothing worked I decided to resolder the cuttings and removed the resistors so it is working as before and leave it like this.

      Thank you anyway :)

      Supprimer
  3. I managed to get Pilight to work on my unit.
    What other "RF" protocol can i select to work at the same time as PiLight?

    Regards

    RépondreSupprimer
    Réponses
    1. They can't be cumulated for the moment, it is either Pilight, RF, RF2 or RFWEATHER.

      Regards

      Supprimer

Enregistrer un commentaire

Posts les plus consultés de ce blog

433toMQTTto433 - Bidirectional ESP8266 NodeMCU gateway between RF 433Mhz signal and MQTT

The goal  is to act as a gateway between 433Mhz sensors and a MQTT broker or between the MQTT broker and 433Mhz actuators, It enables to: receive MQTT data from a topic and send RF 433Mhz signal corresponding to the received MQTT data  publish MQTT data to a different topic related to received 433Mhz signal  It can be an interesting part in an home automation system so as to interface sensors and actuators (wall sockets) with software like openhab . List of compatible sensors here The interest of putting this gateway to an ESP8266 and not on a raspberry pi is to be able to manage security actions at gateway level (power on a siren, cut power to certain devices) following RF data received by sensors without being dependent to the PI for security related actions. [EDIT] all infos are now centralized into  the github repository  take a look at it you will find up to date info about OpenMQTTGateway You need: Software: Mosquitto Arduino IDE latest versio...

Get your BLE sensors data into Home Assistant in 5 minutes

You can now upload your board directly from the web browser!  So let's imagine you want to read data from a sensor like a Mi Flora, an LYWSD03MMC, a weight scale, or any other BLE sensor from this list  Plug an ESP32 dev board to your computer USB port Go to this website: https://docs.openmqttgateway.com/upload/web-install.html Select esp32dev-ble Click the install button Depending on your board you may have to press the BOOT button Choose the port that the ESP is connected to. Wait until the process is complete. Release the BOOT button That's it, OMG is now loaded into your ESP32 board without Arduino IDE, platformIO or a binary flasher. Here are the steps in images: Now comes the Home Assistant part: Add the MQTT integration and activate auto discovery Create a user and a password (Configuration->Users) without administrator right for the gateway Well, this is enough for Home Assistant. So let's now connect both: Check the Wifi Access points available with your smartph...

Infrared IR, 433mhz and MQTT on ESP8266 bidirectional gateway OpenMQTTGateway

Following discussions on the home assistant forum people gave me the idea to add Infrared communication to the 433mhz gateway.  The goal is to act as a gateway between 433Mhz sensors, infrared remote controls and a MQTT broker or between the MQTT broker and 433Mhz actuators, infrared devices, It enables to: receive MQTT data from a topic and send RF 433Mhz signal corresponding to the received MQTT data  publish MQTT data to a different topic related to received 433Mhz signal  receive MQTT data from a topic and send infrared signal corresponding to the received MQTT data  publish MQTT data to a different topic related to received infrared signal  It can be an interesting part in an home automation system so as to interface sensors and actuators (wall sockets), your tv, home cinema, hifi ... with software like  openhab  or home assistant . List of compatible RF sensors here [EDIT] all infos are now centralized into the github repository  ...