Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation BLE + RTL433 fails claiming type TheengsDecoder not a type. #1652

Closed
AlmightyFrog opened this issue May 22, 2023 · 4 comments
Closed
Labels

Comments

@AlmightyFrog
Copy link

AlmightyFrog commented May 22, 2023

Describe the bug
Compilation fails claiming TheengsDecoder not a type (which is indeed available in decoder.h):
TheengsDecoder' does not name a type; did you mean 'UseExtDecoder'?
Include structure seems fine, defines seem to be set correct so that decoder.h is included; it is a little hard to tell cause sadly this project still uses ino instead of cpp and therefore the build in PIO is not as clear as it could be.

All i want is ESP32 + Pilight + RTL433 + Somfy + BLE; in theory offload to PC over MQTT would be fine as HomeAssistant is running 24/7.

To Reproduce
Working config without RTL433:

[env:esp32dev-ble-pilight-somfy]
platform = ${com.esp32_platform}
board = esp32dev
board_build.partitions = min_spiffs.csv
lib_deps =
  ${com-esp32.lib_deps}
  ${libraries.decoder}
  ${libraries.ble}
  ${libraries.smartrc-cc1101-driver-lib}
  ${libraries.esppilight}
  ${libraries.somfy_remote}
build_flags =
  ${com-esp32.build_flags}
  '-DZgatewayPilight="Pilight"'
  '-DZactuatorSomfy="Somfy"'
  '-DZgatewayBT="BT"'
  '-DGateway_Name="OMG_ESP32_433"'
; *** 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 = ESP32 with BLE, Somfy and ESPilight

Problematic config with RTL433 added following multi rf example:

[env:esp32dev-ble-pilight-somfy-rtl]
platform = ${com.esp32_platform}
board = esp32dev
board_build.partitions = min_spiffs.csv
lib_deps =
  ${com-esp32.lib_deps}
  ${libraries.decoder}
  ${libraries.ble}
  ${libraries.smartrc-cc1101-driver-lib}
  ${libraries.rtl_433_ESP}
  ${libraries.esppilight}
  ${libraries.rc-switch}
  ${libraries.newremoteswitch}
  ${libraries.somfy_remote}
build_flags =
  ${com-esp32.build_flags}
  '-DvalueAsATopic=true'       ; MQTT topic includes model and device
  '-DGateway_Name="OMG_ESP32_433"'
  '-DCORE_DEBUG_LEVEL=4'
; *** 433 gateways ***
  '-DZgatewayRF="RF"'
  '-DZgatewayPilight="Pilight"'
  '-DZactuatorSomfy="Somfy"'
  '-DZgatewayRTL_433="rtl_433"'
  '-DDEMOD_DEBUG=true'         ; display signal debug info
; *** BT gateways ***
  '-DZgatewayBT="BT"'
; *** RF Module Options ***
  '-DZradioCC1101="CC1101"'
  '-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 = ESP32 with BLE, Somfy, ESPilight and RTL433

Steps to reproduce the behavior:

  1. Compile
  2. See error output
$ pio run -e esp32dev-ble-pilight-somfy-rtl
Processing esp32dev-ble-pilight-somfy-rtl (platform: espressif32@6.1.0; board: esp32dev; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.1.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.20007.0 (2.0.7)
 - tool-esptoolpy @ 1.40500.0 (4.5.0)
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Converting main.ino
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 46 compatible libraries
Scanning dependencies...
Dependency Graph
|-- PubSubClient @ 2.8.0
|-- ArduinoJson @ 6.18.3
|-- ArduinoLog @ 1.0.3+sha.d13cd80
|-- WiFiManager @ 2.0.14-beta+sha.9f5981e
|-- TheengsDecoder @ 1.4.2+sha.1276d11
|-- NimBLE-Arduino @ 1.4.1+sha.b6b8af8
|-- SmartRC-CC1101-Driver-Lib @ 2.5.7
|-- rtl_433_ESP @ 0.2.0+sha.c90ea35
|-- ESPiLight @ 0.17.0
|-- rc-switch @ 2.6.2+sha.98537e9
|-- NewRemoteSwitch @ 0.0.0+20230522172550.sha.8eb980e
|-- Somfy_Remote_Lib @ 0.3.0
|-- Wire @ 2.0.0
|-- ArduinoOTA @ 2.0.0
|-- DNSServer @ 2.0.0
|-- EEPROM @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- Ethernet @ 2.0.0
|-- FS @ 2.0.0
|-- HTTPClient @ 2.0.0
|-- SPI @ 2.0.0
|-- SPIFFS @ 2.0.0
|-- WebServer @ 2.0.0
|-- WiFiClientSecure @ 2.0.0
|-- WiFi @ 2.0.0
|-- Preferences @ 2.0.0
|-- Update @ 2.0.0
Building in release mode
Compiling .pio/build/esp32dev-ble-pilight-somfy-rtl/src/main.ino.cpp.o
Archiving .pio/build/esp32dev-ble-pilight-somfy-rtl/lib7dd/libFS.a
Indexing .pio/build/esp32dev-ble-pilight-somfy-rtl/lib7dd/libFS.a
Compiling .pio/build/esp32dev-ble-pilight-somfy-rtl/lib58b/WebServer/detail/mimetable.cpp.o
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:60:1: error: 'TheengsDecoder' does not name a type; did you mean 'UseExtDecoder'?
 TheengsDecoder decoder;
 ^~~~~~~~~~~~~~
 UseExtDecoder
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:84:40: error: 'TheengsDecoder' has not been declared
                                        TheengsDecoder::BLE_ID_NUM::UNKNOWN_MODEL};
                                        ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino: In function 'bool updateWorB(ArduinoJson::JsonObject&, bool)':
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:444:26: error: 'TheengsDecoder' has not been declared
                          TheengsDecoder::BLE_ID_NUM::UNKNOWN_MODEL);
                          ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino: In function 'void createOrUpdateDevice(const char*, uint8_t, int, int)':
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:484:18: error: 'TheengsDecoder' has not been declared
     if (model != TheengsDecoder::BLE_ID_NUM::UNKNOWN_MODEL) {
                  ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino: In function 'void updateDevicesStatus()':
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:505:58: error: 'TheengsDecoder' has not been declared
     if (BTConfig.presenceEnable && (p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::NUT ||
                                                          ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:506:58: error: 'TheengsDecoder' has not been declared
                                     p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::MIBAND ||
                                                          ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:507:58: error: 'TheengsDecoder' has not been declared
                                     p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::TAGIT ||
                                                          ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:508:58: error: 'TheengsDecoder' has not been declared
                                     p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::TILE ||
                                                          ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:509:58: error: 'TheengsDecoder' has not been declared
                                     p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::TILEN ||
                                                          ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:510:58: error: 'TheengsDecoder' has not been declared
                                     p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::ITAG ||
                                                          ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:511:58: error: 'TheengsDecoder' has not been declared
                                     p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::RUUVITAG_RAWV1 ||
                                                          ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:512:58: error: 'TheengsDecoder' has not been declared
                                     p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::RUUVITAG_RAWV2)) { // We apply the offline status only for tracking device, can be extended further to all the devices
                                                          ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:524:30: error: 'TheengsDecoder' has not been declared
     if (p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::BC08) {
                              ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino: In function 'void BLEconnect()':
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:807:43: error: 'TheengsDecoder' has not been declared
           } else if (p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC) {
                                           ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:815:43: error: 'TheengsDecoder' has not been declared
           } else if (p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::SBS1) {
                                           ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:833:42: error: 'TheengsDecoder' has not been declared
                     p->sensorModel_id != TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC &&
                                          ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino: In function 'void launchBTDiscovery(bool)':
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1057:31: error: 'TheengsDecoder' has not been declared
           p->sensorModel_id > TheengsDecoder::BLE_ID_NUM::UNKNOWN_MODEL &&
                               ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1058:31: error: 'TheengsDecoder' has not been declared
           p->sensorModel_id < TheengsDecoder::BLE_ID_NUM::BLE_ID_MAX &&
                               ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1059:32: error: 'TheengsDecoder' has not been declared
           p->sensorModel_id != TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC && p->sensorModel_id != TheengsDecoder::BLE_ID_NUM::BM2) { // Exception on HHCCJCY01HHCC and BM2 as these ones are discoverable and connectable
                                ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1059:98: error: 'TheengsDecoder' has not been declared
           p->sensorModel_id != TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC && p->sensorModel_id != TheengsDecoder::BLE_ID_NUM::BM2) { // Exception on HHCCJCY01HHCC and BM2 as these ones are discoverable and connectable
                                                                                                  ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1061:34: error: 'decoder' was not declared in this scope
         std::string properties = decoder.getTheengProperties(p->sensorModel_id);
                                  ^~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1061:34: note: suggested alternative: 'decoder_log'
         std::string properties = decoder.getTheengProperties(p->sensorModel_id);
                                  ^~~~~~~
                                  decoder_log
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1067:34: error: 'TheengsDecoder' has not been declared
         if (p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::NUT ||
                                  ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1068:34: error: 'TheengsDecoder' has not been declared
             p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::MIBAND ||
                                  ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1069:34: error: 'TheengsDecoder' has not been declared
             p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::TAGIT ||
                                  ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1070:34: error: 'TheengsDecoder' has not been declared
             p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::TILE ||
                                  ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1071:34: error: 'TheengsDecoder' has not been declared
             p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::TILEN ||
                                  ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1072:34: error: 'TheengsDecoder' has not been declared
             p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::ITAG ||
                                  ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1073:34: error: 'TheengsDecoder' has not been declared
             p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::RUUVITAG_RAWV1 ||
                                  ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1074:34: error: 'TheengsDecoder' has not been declared
             p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::RUUVITAG_RAWV2) {
                                  ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1085:34: error: 'TheengsDecoder' has not been declared
         if (p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::BC08) {
                                  ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1110:38: error: 'TheengsDecoder' has not been declared
             if (p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::SBS1 && strcmp(prop.key().c_str(), "state") != 0) {
                                      ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1134:34: error: 'TheengsDecoder' has not been declared
             p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC || p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::BM2) {
                                  ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1134:100: error: 'TheengsDecoder' has not been declared
             p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC || p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::BM2) {
                                                                                                    ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1151:36: error: 'TheengsDecoder' has not been declared
           if (p->sensorModel_id == TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC) {
                                    ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino: In function 'void process_bledata(ArduinoJson::JsonObject&)':
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1197:51: error: 'decoder' was not declared in this scope
   int model_id = BTConfig.extDecoderEnable ? -1 : decoder.decodeBLEJson(BLEdata);
                                                   ^~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1197:51: note: suggested alternative: 'decoder_log'
   int model_id = BTConfig.extDecoderEnable ? -1 : decoder.decodeBLEJson(BLEdata);
                                                   ^~~~~~~
                                                   decoder_log
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1199:74: error: 'TheengsDecoder' has not been declared
   if ((BLEdata["type"].as<string>()).compare("RMAC") != 0 && model_id != TheengsDecoder::BLE_ID_NUM::IBEACON) { // Do not store in memory the random mac devices and iBeacons
                                                                          ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1202:23: error: 'TheengsDecoder' has not been declared
       if (model_id == TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC || model_id == TheengsDecoder::BLE_ID_NUM::BM2) {
                       ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1202:80: error: 'TheengsDecoder' has not been declared
       if (model_id == TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC || model_id == TheengsDecoder::BLE_ID_NUM::BM2) {
                                                                                ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1248:23: error: 'TheengsDecoder' has not been declared
           model_id == TheengsDecoder::BLE_ID_NUM::HHCCJCY01HHCC;
                       ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino: In function 'void MQTTtoBTAction(ArduinoJson::JsonObject&)':
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1357:26: error: 'TheengsDecoder' has not been declared
                          TheengsDecoder::BLE_ID_NUM::SBS1, 1);
                          ^~~~~~~~~~~~~~
/just/some/folder/OpenMQTTGateway/main/ZgatewayBT.ino:1406:24: error: 'TheengsDecoder' has not been declared
                        TheengsDecoder::BLE_ID_NUM::UNKNOWN_MODEL,
                        ^~~~~~~~~~~~~~
Compiling .pio/build/esp32dev-ble-pilight-somfy-rtl/lib37d/WiFiManager/WiFiManager.cpp.o
Archiving .pio/build/esp32dev-ble-pilight-somfy-rtl/lib58b/libWebServer.a
Indexing .pio/build/esp32dev-ble-pilight-somfy-rtl/lib58b/libWebServer.a
Compiling .pio/build/esp32dev-ble-pilight-somfy-rtl/lib31f/TheengsDecoder/decoder.cpp.o
Compiling .pio/build/esp32dev-ble-pilight-somfy-rtl/lib31f/TheengsDecoder/decoder_c.cpp.o
*** [.pio/build/esp32dev-ble-pilight-somfy-rtl/src/main.ino.cpp.o] Error 1
================================================================================================================= [FAILED] Took 9.63 seconds =================================================================================================================

Note: I you comment out '-DZgatewayBT="BT"' compile works again.

Expected behavior
Compile should run fine, maybe linking would fail due to used memory (as issue #1258 claims that might be a little much).

Environment (please complete the following information):

  • OpenMQTTGateway latest development version
  • PlatformIO Core, version 6.1.7
@lachesis
Copy link

I believe this is because rtl_433_ESP defines its own decoder.h file which does something different than the one in TheengsDecoder. I am not sure how to resolve this conflict.

@NorthernMan54
Copy link
Collaborator

Please note that the current resource requirements ( heap and CPU ) of BLE and RTL433 make this configuration not feasible.

@github-actions
Copy link

github-actions bot commented Sep 1, 2023

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Sep 1, 2023
@github-actions
Copy link

github-actions bot commented Sep 9, 2023

This issue was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this as completed Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants