OMG 1.4.0 RF2, does it exist?

Hi everyone,

I’m using OMG on a ESP8266 for a while for decoding my RF2 signals, but want to go to an ESP32.
However, I can not find an “RF2” environment in platformio.ini anymore.
Is this not supported anymore? Should I stick to my ESP8266? Or how can I create a “esp32dev-rf2” environment for my Wemos Mini D1 ESP32 ?

grtz,
B

Hi Bart,

It still exists, the environments have been moved to a dedicated file.
See below:

And don’t trash your esp8266 if you can !

And you can create your own esp32dev-rf2 environment by taking [env:esp32dev-multi_receiver] as a starting point and only taking the RF2 relevant parts for your project.

Out of curiosity - any reason why you want to switch over to the Wemos Mini D1 ESP32 instead of keeping the ESP8266 for RF2?

Hi

@1technophile
But this is adressing the esp8266_platform and not the esp32, not?

@DigiH
I will take a closer look at that.

Further:

Due to lack of knowledge on my side…
I just trying to find my way in this OMG code and only making progress in (very) small steps…
But I had some spare ESP32’s, and was trying to help my friend who is looking for a way to replace/automate his remote.
Meanwhile, I thought the ESP32 had some more capabilities and power on board so had the idea to replace my own ESP8266 too…

But this seems not to be a good idea?

The ESP32 also has the added capability of having on board Bluetooth, which is nice to have when BLE decoding is desired, but for an RF2 gateway the additional power of an ESP32 over the ESP8266 does not really make any real world difference.

Maybe install a BLE OMG version [esp32dev-ble] on your ESP32 to see if you have any relevant compatible Bluetooth devices around, or which you might get in the future :slight_smile:

mmm…
I tried the webinstall with the out-of-the box esp32dev-multi_receiver, but after setting the correct settings in the wifi manager (I tripple checked this), the device is not connecting to my network.

From the documentation, I can read

Multi RF library with the possibility to switch between ESPilight, RTL_433_ESP, NewRemoteSwitch and RCSwitch, need CC1101

but I don’t have a CC1101 right now (it’s on its way :slight_smile: )

Does OMG detects if this transceiver is connected and refuses to start if not?

PS

This is what I already did on my girlfriends place for a Xiaomi temp/humidity sensor. Works like a charm! (as does my girlfriend)

I would assume so, but haven’t actually tried myself with esp32dev-multi_receiver and nonCC1101 connected :wink: as a CC1101 is definitely required for the RTL_433_ESP part.

Good to hear that you’ve tried the BLE gateway as well, and that you’re happy with both of them :wink:

1 Like

OK, one little step further.

I did some reverse engineering, and in environments.ini, I defined

[env:esp32dev-rf2]
platform = ${com.esp32_platform}
board = esp32dev
lib_deps =
  ${com-esp.lib_deps}
  ${libraries.wifimanager32}
  ${libraries.newremoteswitch}
build_flags =
  ${com-esp.build_flags}
  '-DZgatewayRF2="RF2"'
  '-DGateway_Name="OpenMQTTGateway_ESP32_RF2"'
custom_description = RF2 gateway using RCSwitch library

This one connects to my wifi and MQTT-broker, and decodez my RF2 signals…!

So good for now…

Thanx a lot for all support!!!

1 Like

Small correction to myself: modifed description, and placed all code in platformio_esp32dev-rf2_env.ini (just to have only modify one single file)

This leads to:

; ======================================================================================
; BEARFORCE
; ======================================================================================
; see 
; https://docs.openmqttgateway.com/upload/builds.html

[platformio]
default_envs =  esp32dev-rf2-custom


[env:esp32dev-rf2]
platform = ${com.esp32_platform}
board = esp32dev
lib_deps =
  ${com-esp.lib_deps}
  ${libraries.wifimanager32}
  ${libraries.newremoteswitch}
build_flags =
  ${com-esp.build_flags}
  '-DZgatewayRF2="RF2"'
  '-DGateway_Name="OpenMQTTGateway_ESP32_RF2"'
custom_description = RF2 gateway using NewRemoteSwitch library



[env:esp32dev-rf2-custom]
extends = env:esp32dev-rf2
lib_deps =
  ${env:esp32dev-rf2.lib_deps}
build_flags =
  ${env:esp32dev-rf2.build_flags}
  '-DGateway_Name="OMG-ESP32-RF2-GPIO16"'

  '-DESPWifiManualSetup=true'
  '-Dwifi_ssid="my_wifi_ssid"'
  '-Dwifi_password="my_wifi_password"'

  '-DMQTT_USER="my_mqtt_username"'
  '-DMQTT_PASS="my_mqtt_password"'
  '-DMQTT_SERVER="my.mqttbroker.org"'
 
  '-DRF_RECEIVER_GPIO=16' ;this works on my Wemos Mini D1 ESP32


(1) power (+5V)
(2) power (ground)
(3) GPIO16

Didn’t you have a custom portable _env.ini already set up for another custom environment?

If so you can add all your custom environment definitions into one file, otherwise the advantage of having these portable files diminishes if you have lots and lost of them over time :wink:

well, because I’m still very unsecure on this technology, and don’t want to break things, I’m working now as follows:

  • unzip the “OpenMQTTGateway-1.4.0.zip”
  • rename the directory to i.e. “OpenMQTTGateway-1.4.0-ESP32-RF2”
  • within this directory, place the file “platformio_esp32dev-rf2_env.ini”
  • compile and upload via platform.io in vs code.

This means for every single config, I have a directory with the whole code. Not ideal, I know.
This works for me for now, but probably there is “some room for optimization”… :wink:

1 Like

Nothing wrong with taking small steps with new tech, but you might want to try

• unzip the “OpenMQTTGateway-1.4.0.zip”
• leave the name as is and only create one file bearforce_env.ini in which you define

; ======================================================================================
; BEARFORCE
; ======================================================================================
; see 
; https://docs.openmqttgateway.com/upload/builds.html

[platformio]
default_envs = nodemcuv2-rf-bart
default_envs = esp32dev-rf2
default_envs = esp32dev-rf2-custom

[env:nodemcuv2-rf-bart]
extends = env:nodemcuv2-rf
lib_deps =
  ${env:nodemcuv2-rf.lib_deps}
build_flags =
  ${env:nodemcuv2-rf.build_flags}
  '-DGateway_Name="OMG-007"'
  '-DMQTT_USER="your_username"'
  '-DMQTT_PASS="your_password"'
  '-DMQTT_SERVER="mqtt.bearforce.org"'
  '-DRF_RECEIVER_GPIO=5'

[env:esp32dev-rf2]
platform = ${com.esp32_platform}
board = esp32dev
lib_deps =
  ${com-esp.lib_deps}
  ${libraries.wifimanager32}
  ${libraries.newremoteswitch}
build_flags =
  ${com-esp.build_flags}
  '-DZgatewayRF2="RF2"'
  '-DGateway_Name="OpenMQTTGateway_ESP32_RF2"'
custom_description = RF2 gateway using NewRemoteSwitch library

[env:esp32dev-rf2-custom]
extends = env:esp32dev-rf2
lib_deps =
  ${env:esp32dev-rf2.lib_deps}
build_flags =
  ${env:esp32dev-rf2.build_flags}
  '-DGateway_Name="OMG-ESP32-RF2-GPIO16"'

  '-DESPWifiManualSetup=true'
  '-Dwifi_ssid="my_wifi_ssid"'
  '-Dwifi_password="my_wifi_password"'

  '-DMQTT_USER="my_mqtt_username"'
  '-DMQTT_PASS="my_mqtt_password"'
  '-DMQTT_SERVER="my.mqttbroker.org"'
 
  '-DRF_RECEIVER_GPIO=16' ;this works on my Wemos Mini D1 ESP32

and any future custom environments, and/or a separate OTA extend for [env:nodemcuv2-rf-bart] as well.

cool!
Steaming up. I also placed my network settings in a separte environment. Is this a good idea?

this leads to

; ======================================================================================
; BEARFORCE
; ======================================================================================
; see 
; https://docs.openmqttgateway.com/upload/builds.html

[platformio]
;default_envs =  esp8266-rf-custom
;default_envs =  esp8266-rf2-custom
;default_envs =  esp32-rf-custom
default_envs =  esp32-rf2-custom

; --------------------------------------------------------------------------------------
; my own network settings
; --------------------------------------------------------------------------------------
[env:my-network]
build_flags =
  '-DESPWifiManualSetup=true'
  '-Dwifi_ssid="my_wifi_ssid"'
  '-Dwifi_password="my_wifi_password"'

  '-DMQTT_USER="my_mqtt_username"'
  '-DMQTT_PASS="my_mqtt_password"'
  '-DMQTT_SERVER="my.mqtt.broker"'
 

; --------------------------------------------------------------------------------------
; esp32dev-rf2
; --------------------------------------------------------------------------------------
[env:esp32dev-rf2]
platform = ${com.esp32_platform}
board = esp32dev
lib_deps =
  ${com-esp.lib_deps}
  ${libraries.wifimanager32}
  ${libraries.newremoteswitch}
build_flags =
  ${com-esp.build_flags}
  '-DZgatewayRF2="RF2"'
  '-DGateway_Name="OpenMQTTGateway_ESP32_RF2"'
custom_description = RF2 gateway using NewRemoteSwitch library


; --------------------------------------------------------------------------------------
; esp8266-rf-custom
; --------------------------------------------------------------------------------------
[env:esp8266-rf-custom]
extends = env:nodemcuv2-rf
lib_deps =
  ${env:nodemcuv2-rf.lib_deps}
build_flags =
  ${env:nodemcuv2-rf.build_flags}
  ${env:my-network.build_flags}
  '-DGateway_Name="OMG-ESP8266-RF-GPIO5"' ;//D1
  '-DRF_RECEIVER_GPIO=5'


; --------------------------------------------------------------------------------------
; esp8266-rf2-custom
; --------------------------------------------------------------------------------------
[env:esp8266-rf2-custom]
extends = env:nodemcuv2-rf2
lib_deps =
  ${env:nodemcuv2-rf2.lib_deps}
build_flags =
  ${env:nodemcuv2-rf2.build_flags}
  ${env:my-network.build_flags}
  '-DGateway_Name="OMG-ESP8266-RF2-GPIO5"'
  '-DRF_RECEIVER_GPIO=5'

; --------------------------------------------------------------------------------------
; esp32-rf-custom
; --------------------------------------------------------------------------------------
[env:esp32-rf-custom]
extends = env:esp32dev-rf
lib_deps =
  ${env:esp32dev-rf.lib_deps}
build_flags =
  ${env:esp32dev-rf.build_flags}
  ${env:my-network.build_flags}
  '-DGateway_Name="OMG-ESP32-RF-GPIO16"'
  '-DRF_RECEIVER_GPIO=16'


; --------------------------------------------------------------------------------------
; esp32-rf2-custom
; --------------------------------------------------------------------------------------
[env:esp32-rf2-custom]
extends = env:esp32dev-rf2
lib_deps =
  ${env:esp32dev-rf2.lib_deps}
build_flags =
  ${env:esp32dev-rf2.build_flags}
  ${env:my-network.build_flags}
  '-DGateway_Name="OMG-ESP32-RF2-GPIO16"'
  '-DRF_RECEIVER_GPIO=16'




Feels like I’m almost a developper… :rofl:

Cheers,
B

PS.
I think I’m definitly a developper now: there were some typo’s in above code so had to correct them already :rofl: :rofl: :rofl:

2 Likes

This was a perfect idea! Well done, Mr. NewDeveloper! :slight_smile:

Now also have a look on the left side of VSC and click on the alien head (Platformio section), there under PROJECT TASKS you will see all environments, including your custom ones at the bottom, and when expanding them you see Build and Upload options. With this you don’t have to comment/uncomment your default_envs all the time, but can direly build and upload the environment you want.

If you additionally comment out line 16 in platformio.ini
; environments.ini
you will only see you custom environments for a complete custom build and upload experience :slight_smile:

PROJECT TASKS reload might be required initially - the round arrow after PROJECT TASKS

1 Like