RF + IR gateway not possible anymore in ESP32?

Hi,

I am using two IR+RF gateway’s with OMG version 0.9.16 for almost 2 years now and decided to upgrade one to OMG 1.6.0 or 1.7.0 but do not get it working anymore.
I have tried >10 times with erasing and flashing ESP Easy (to check if the EPS32 still worked) but was not able to flash OMG anymore.

Hardware: ESP32 WROOM 32 + CC1101 module and IR receiver/transmitter.
1 PROBLEM reported in User_config.h about line 197:
const char* certificate PROGMEM = R"EOF("
expected a ‘;’ C/C++(65) [Ln 197, Col25]

prod_env.ini:
[env:esp32dev-IRF]
platform = ${com.esp32_platform}
board = esp32dev
board_build.partitions = min_spiffs.csv
lib_deps =
${com-esp.lib_deps}
${libraries.wifimanager32}
${libraries.rc-switch}
${libraries.smartrc-cc1101-driver-lib}
${libraries.rtl_433_ESP}
${libraries.esppilight}
${libraries.newremoteswitch}
${libraries.irremoteesp}
build_flags =
${com-esp.build_flags}
‘-DZgatewayRF=“RF”’
‘-DZgatewayRF2=“RF2”’
‘-DZgatewayRTL_433=“RTL_433”’
‘-DZradioCC1101=“CC1101”’
‘-DZgatewayIR=“IR”’
‘-DZgatewayPilight=“Pilight”’
‘-DGateway_Name=“OpenMQTTGateway_ESP32_IRF”’
‘-DvalueAsASubject=true’
‘-DRF_CC1101=“CC1101”’
‘-DRF_MODULE_CS=5’
‘-DRF_MODULE_GDO0=12’
‘-DRF_MODULE_GDO2=27’
‘-DZwebUI=“WebUI”’
board_build.flash_mode = dio
upload_speed = 115200

config_RF.h:
#define Pilight_rawEnabled true

User_config.h:
#define ZgatewayRF “RF”
#define ZgatewayIR “IR”
#define ZgatewayPilight “Pilight”
#define ZgatewayRF2 “RF2”
#define ZmqttDiscovery “HADiscovery”
#define ZradioCC1101 “CC1101”

platformio.ini:
default_envs = esp32dev-IRF

The terminal monitor shows:
Core 0 register dump:
PC : 0x40130788 PS : 0x00060930 A0 : 0x8013712c A1 : 0x3ffe3ae0
A2 : 0x3f41d360 A3 : 0x3f425568 A4 : 0x0000000c A5 : 0x00060f23
A6 : 0x00060f20 A7 : 0x00000001 A8 : 0x80130788 A9 : 0x3ffe3ac0
A10 : 0x3ffbaf88 A11 : 0xfffc1fff A12 : 0x00060f20 A13 : 0x00060f23
A14 : 0x007bedb0 A15 : 0x003fffff SAR : 0x00000018 EXCCAUSE: 0x00000003
EXCVADDR: 0x3f41d360 LBEG : 0x4008ac3d LEND : 0x4008ac4d LCOUNT : 0xfffffffe

Backtrace: 0x40130785:0x3ffe3ae0 0x40137129:0x3ffe3b00 0x40130738:0x3ffe3b20 0x4012ec02:0x3ffe3b40 0x4012efcd:0x3ffe3b60 0x400e632a:0x3ffe3b80 0x4015dfaf:0x3ffe3c10 0x400833d6:0x3ffe3c40 0x40079266:0x3ffe3c90 |<-CORRUPTED

Anyone with a clue how to fix this, please help me. I use my OMG 0.9.16 on a daily basis and would like to upgrade and use the RAW RF reception. That is because I have a Smartwares SH4-99580AT remote which I would like to use with OMG and version 0.9.16 does not recognize a stable RTL_433 signal from each button.

Edit 17-12-'23: I noticed that also main.ino gives these 3 problem warnings although I did not change this file:
identifier “setupCommonRF” is undefined C/CC++(20) [Ln 1196, Col 3]
identifier “stateRFMeasures” is undefined C/CC++(20) [Ln 2099, Col 9]
identifier “MQTTtoRFset” is undefined C/CC++(20) [Ln 2565, Col 5]

I have build a new configuration from scratch by first downloading the zip again and deleting all my previous tries.

I’ve created below personal environment file prod_env_IRF.ini and used PlatformIO to make a build.

But it gets stuck in a build loop with some “multiple definition” errors in the firmware.elf.

example of such error:
Linking .pio\build\rfbridge\firmware.elf
c:/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/10.3.0/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\rfbridge\src\main.ino.cpp.o:(.data.mqtt_topic+0x0): multiple definition of `mqtt_topic’; .pio\build\rfbridge\src\main.cpp.o:(.data.mqtt_topic+0x0):
first defined here

Now I am about to give up unless someone can point out what I keep doing wrong. It took me again almost a full day of waiting and trying.

PLEASE anybody help me, it seems impossible to build my own configuration with at least the RF, RF2 and IR gateways.

[platformio]
default_envs = esp32dev-IRF

[env:esp32dev-IRF]
platform = ${com.esp32_platform}
board = esp32dev
board_build.partitions = min_spiffs.csv
lib_deps =
${com-esp32.lib_deps}
${libraries.irremoteesp}
${libraries.rc-switch}
${libraries.smartrc-cc1101-driver-lib}
${libraries.newremoteswitch}
build_flags =
${com-esp32.build_flags}
‘-DZgatewayIR=“IR”’
‘-DZgatewayRF=“RF”’
‘-DZgatewayRF2=“RF2”’
‘-DZradioCC1101=“CC1101”’
‘-DGateway_Name=“OMG_ESP32_IRF”’
‘-DvalueAsATopic=true’ ; MQTT topic includes model and device (rtl_433) or protocol and id (RF and PiLight)
; *** RF Module Options ***
‘-DRF_CC1101=“CC1101”’ ; CC1101 Transceiver Module
‘-DRF_MODULE_CS=5’ ; pin to be used as chip select
‘-DRF_MODULE_GDO0=12’ ; CC1101 pin GDO0
‘-DRF_MODULE_GDO2=27’ ; CC1101 pin GDO2
custom_description = Infrared an RF (Emitting and receiving)

Stupid me, the file must be called exactly prod_env.ini and not prod_env*.ini.
Now it all works! I’m so relieved.

The * is just there so the existing example file is not being recognised already as a personal environment file, otherwise you can use any personalised naming, as long as it ends in _env.ini
hobby_env.ini
prod_hobby_env.ini
hobby_testing_env.ini

especially if you want to have several personal environment files, like for testing and then for final production purposes.

Great you got it working now.

Yeah that was not clear for me. I named it prod_env_IRF.ini and then it doesn’t work.
Now it’s clear and it is all so obvious and stupid that I didn’t find out this earlier :wink:

It is really a great project and I’m very happy with how it performs!

1 Like