Github Boards Devices Community Docs Blog

Sonoff rf-bridge online but no MQTT messages from test devices

Hi, I’m a new user of OMG,

I have a sonoff rf-bridge which is on my network and announcing to Mosquito MQTT but no test device/sensor messages are appearing on MQTT despite the red led flashing which I believe indicates a transmission has been received(?).

I’m hoping someone can help me understand why I’m not seeing device/sensor messages as I seem to have exhausted steps/ideas from the docs and community posts.

I have a rev2 board. Since no message had been received (and not knowing why/or better) I modified the board with the direct hack (https://github.com/xoseperez/espurna/wiki/Hardware-Itead-Sonoff-RF-Bridge---Direct-Hack) to give a wider set of remote control code support.

In follow-up I found a suggested platformio.ini env configuration in the forum which I have embellished with wifi ssid and password, and mqtt server params, as:

[env:rfbridge-pilight]
platform = ${com.esp8266_platform}
board = esp8285
lib_deps =
${com-esp.lib_deps}
${libraries.esppilight}
${libraries.esp8266_mdns}
build_flags =
${com-esp.build_flags}
‘-DZgatewayPilight=“Pilight”’
‘-DGateway_Name=“OMG-rf”’
‘-Dwifi_ssid=“redacted”’
‘-Dwifi_password=“redacted”’
‘-DMQTT_SERVER=“redacted”’
board_build.flash_mode = dout

(wifi credentials dont seem to take and I still need to use the network manager wizard to configure ssid/password ?)

I have performed an erase (pio run --target erase) as re-flash for good measure but with the same outcome.

In MQTT explorer I see 2 topic trees:
(1 - OMG server name I set)

  • LWT = Online
  • version = version_tag (should this have a value?)
  • SYStoMQTT = (shortened)uptime:version:freemem:rssi:SSID:ip:mac:wifiprt:modules=PilightHADDiscovery

(2 - homeassistant)

binary_sensor

  • [MAC Address]

switch

  • [MAC Address]restart
  • [MAC Address]erase

sensor

  • [MAC Address]gatewayPilight

I assume home assistant is out of the box, its not anything I’ve configured. None of binary_sensor, switch, sensor topics/values change when I activate my test devices.

My test devices are a magnetic door open sensor and a generic 433 keyfob with 4 buttons that I acquired from banggood - as mentioned previously all actions with either door sensor or keyfob trigger a red led on the rf-bridge.

Let me know if there is any other detail I can proivde to explain my setup.

Please let me know what I’ve overlooked or done wrong.

Thanks.

Hi,

Could you try with this configuration instead of Pilight one:

[env:rfbridge-rf]
platform = ${com.esp8266_platform}
board = esp8285
lib_deps =
${com-esp.lib_deps}
${libraries.rc-switch}
${libraries.esp8266_mdns}
build_flags =
${com-esp.build_flags}
'-DZgatewayRF="RF"'
'-DGateway_Name="OMG-rf"'
'-Dwifi_ssid="redacted"'
'-Dwifi_password="redacted"'
'-DMQTT_SERVER="redacted"'
board_build.flash_mode = dout

Hi,

Thanks for responding.

I took the env section you supplied and merged it into my platformio.ini, then set default_envs = rfbridge-rf.

I set the switch on the board to the off position and connected using my FTDI programmer.

I erased the device (pio run --target erase) for good measure, then flashed with the new config.

I moved the switch position back to on and powered up.

Once added to my network the device announced itself to MQTT albeit now with a slightly differently named topic hierarchy.

I repeated my tests (keyfob and magnetic door sensor) both result in the red light flashing but unfortunately nether test resulted in a topic/message being triggered/delivered.

I wonder, have I missed something fundamental? should I be doing anything with the button to enrol a device before seeing messages from it?

Thanks

Not necessary.

If you activate your serial monitor, what do you see?
Could you post an extract?

Hi,

The log looks as follows:

Thanks

Hi,

The logs are strange after the Received json,

Could you post a picture of your hardware modified also, so as to verify the wiring?

Topside image:

Thanks

Underside image:

Thanks

I also have the same problem.
I had OMG 0.9.4 dev before and was working,
but in the mean time I have changed the PC and I just wanted to refresh OMG.

So today I reprogram the SonOFF RF Bridge (hardware hacked) with OMG 0.9.5
and I just have the red LED flash when I push a remote RF433 (from an allarm)
but no MQTT data.

I cancelled all MQTT topics using MQTT Exlporer and then restart SonOFF RF
all the static topic was recreated… but no data:

In VSCode I push the “Terminal Monitor” but is not work…
In order to make it work I must let the USB port or I must put the FDI programmer ? or all two ?

Thanks in advance for the help
Denis

Hi,

Could you try to flash v0.9.4 back so as to see if it comes from v0.9.5 ?

I take off the HD from my old PC and install it external in order to recover the 0.9.4 dev version
that I used. I don’t know witch 0.9.4 dev. is :frowning:

In VSCode I close the 0.9.5 official version and I open the 0.9.4 dev.
but when I want to build it I take this error:

I also delete all from "C:\users\denis.platformio*.* in order to reset the PlatformIO
but after it recharge all, I take same error :frowning:
I deteted the .vscode folder too… but same error.

I’m sorry but I’m verry newbie with VSCode/PlatformIO and I can’t find answers on web
that can help me to understand this error. Or maybe I don’t know what I must search.

Thanks a lot again
Denis

I solved it by change this:
arduinolog = 1technophile/Arduino-Log#d13cd80
with this:
arduinolog = https://github.com/1technophile/Arduino-Log.git#d13cd80
…in the platformio.ini file.

So now the build it’s work :slight_smile:

I’ll write when I’ll finish the test of 0.9.4

Denis

Ok… now with 0.9.4 dev it’s work :slight_smile:

But now that I remember, the env rfbridge-pilight you sent me time ago in this forum,
and I paste and use it in the platfformio.ini file:

[env:rfbridge-pilight]
platform = ${com.esp8266_platform}
board = esp8285
lib_deps =
  ${com-esp.lib_deps}
  ${libraries.esppilight}
  ${libraries.esp8266_mdns}
build_flags =
  ${com-esp.build_flags}
  '-DZgatewayPilight="Pilight"'
  '-DGateway_Name="OpenMQTTGateway_SRFB_PIL"'
board_build.flash_mode = dout

But this same env I used also in the 0.9.5 version and was not worked :frowning:
So I think there is some “wrong” difference between this 2 versions.

Now because I discover ho to use the Serial Monitor, I’ll make some test

Ok… so here is the conclusion of 0.9.5 version:

Test 1 using “rfbridge-pilight” that you give me time ago:

[env:rfbridge-pilight]
platform = ${com.esp8266_platform}
board = esp8285
lib_deps =
  ${com-esp.lib_deps}
  ${libraries.esppilight}
  ${libraries.esp8266_mdns}
build_flags =
  ${com-esp.build_flags}
  '-DZgatewayPilight="Pilight"'
  '-DGateway_Name="OpenMQTTGateway_SRFB_PIL"'
board_build.flash_mode = dout
  • MQTT status topic is open when I poweron SonOff RF
  • When I push RFremote, red LED is flashing, but no MQTT topic receive

Test 2 using the 0.9.5 default env “rfbridge

[env:rfbridge]
platform = ${com.esp8266_platform}
board = esp8285
lib_deps =
${com-esp.lib_deps}
${libraries.esp8266_mdns}
build_flags =
${com-esp.build_flags}
‘-DZgatewaySRFB=“SRFB”’
‘-DLED_INFO=13’
‘-DLED_INFO_ON=0’
‘-DGateway_Name=“OpenMQTTGateway_SRFB”’
board_build.flash_mode = dout

  • blue LED always on
  • MQTT status topic is open when I poweron SonOff RF
  • When I push RFremote, red LED is flashing, but no MQTT topic receive
    but in the “Serial Monitor” arrive strange chars:

Test 3 with the env you posted in this thread but without WiFi and MQTT credentials:

[env:rfbridgerf]
platform = ${com.esp8266_platform}
board = esp8285
lib_deps =
${com-esp.lib_deps}
${libraries.rc-switch}
${libraries.esp8266_mdns}
build_flags =
${com-esp.build_flags}
‘-DZgatewayRF=“RF”’
‘-DGateway_Name=“OMG-rf”’
board_build.flash_mode = dout

  • blue LED always off
  • MQTT status topic is open when I poweron SonOff RF
  • When I push RFremote, red LED is flashing, but no MQTT topic receive,
    and no log in the “Serial Monitor”… just status log:

Now when you have some time to dedicate,
please try to understand where is the issue,
and obviously if I can do some other test, please let me know.

Thsnks a lot again
Denis

1 Like

By way of an update I have the same successful results as Denis when flashing back to v0.9.4

As a quick test I grabbed a copy of v0.9.4 rfbridge-firmware.bin and flashed using esptool.py (esptool.py --port /dev/{your-serial-device} write_flash -fm dout 0x00000 ~/Downloads/rfbridge-firmware.bin) and I am now seeing messages arrive on MQTT :+1::

Happy to follow instructions to help investigate the v0.9.5 variance.

Thanks

2 Likes

Hi @denisj, @dougster2k ,

Unfortunately, I don’t have anymore an RFBridge with me.
Would it be possible to put the LOG_LEVEL to LOG_LEVEL_TRACE with v0.9.5 and ZgatewaySRFB and send me an extract when pressing a remote button?

Hi,

Problem identified and corrected in the branch below:


Will be merged in the following days.

Thanks for pointing this!

1 Like

Thanks, I’ve got 2 new bridges on the way, will test when they arrive.

1 Like

Can you tell me which commit number this fix was, I cloned the repository a bit over a month ago and have the same symptoms. Cant find anything in the commit list that looks like a fix for this problem. So dont know if my my clone has the fix or not.

Here is the PR :

It was merged on november 28

I’ve had the same issue after updating my srfb from a ~2 year old version to the latest release, and only found this information after an hour or so searching.

Any chance of a new point-release with the above bug fix integrated, as currently rfbridges just don’t work at all with the latest released version of OMG.