1technophile / OpenMQTTGateway

MQTT gateway for ESP8266 or ESP32 with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility & LoRa.
https://docs.openmqttgateway.com
GNU General Public License v3.0
3.57k stars 786 forks source link

Mixing LoRa and rtl_433 #1938

Closed alucryd closed 1 month ago

alucryd commented 5 months ago

Is your feature request related to a problem? Please describe. I've got an ESP board with 2 SX1278 chips, currently dedicated to LoRa and working great. I'd like to listen to LoRa devices on the first chip, and FSK devices on the second chip. However trying to build OMG with both LoRa and FSK fails, I guess it's not intended to be used that way?

Compiling .pio/build/makerfabs-wrover-lora-32-868/lib778/PubSubClient/PubSubClient.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib72b/ArduinoLog/ArduinoLog.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib88e/WiFi/WiFi.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib88e/WiFi/WiFiAP.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib88e/WiFi/WiFiClient.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib88e/WiFi/WiFiGeneric.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib88e/WiFi/WiFiMulti.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib88e/WiFi/WiFiSTA.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib88e/WiFi/WiFiScan.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib88e/WiFi/WiFiServer.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib88e/WiFi/WiFiUdp.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib122/DNSServer/DNSServer.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/libd7c/ESPmDNS/ESPmDNS.cpp.o
Archiving .pio/build/makerfabs-wrover-lora-32-868/lib72b/libArduinoLog.a
Indexing .pio/build/makerfabs-wrover-lora-32-868/lib72b/libArduinoLog.a
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib1ed/Update/HttpsOTAUpdate.cpp.o
Archiving .pio/build/makerfabs-wrover-lora-32-868/lib778/libPubSubClient.a
Indexing .pio/build/makerfabs-wrover-lora-32-868/lib778/libPubSubClient.a
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib1ed/Update/Updater.cpp.o
/home/alucryd/Projects/OpenMQTTGateway/main/ZgatewayRTL_433.ino:52:16: error: ambiguating new declaration of 'RTL_433device* getDeviceById(const char*)'
 RTL_433device* getDeviceById(const char* id); // Declared here to avoid pre-compilation issue (misplaced auto declaration by pio)
                ^~~~~~~~~~~~~
/home/alucryd/Projects/OpenMQTTGateway/main/ZgatewayLORA.ino:52:13: note: old declaration 'LORAdevice* getDeviceById(const char*)'
 LORAdevice* getDeviceById(const char* id) {
             ^~~~~~~~~~~~~
/home/alucryd/Projects/OpenMQTTGateway/main/ZgatewayRTL_433.ino:53:16: error: ambiguating new declaration of 'RTL_433device* getDeviceById(const char*)'
 RTL_433device* getDeviceById(const char* id) {
                ^~~~~~~~~~~~~
/home/alucryd/Projects/OpenMQTTGateway/main/ZgatewayLORA.ino:52:13: note: old declaration 'LORAdevice* getDeviceById(const char*)'
 LORAdevice* getDeviceById(const char* id) {
             ^~~~~~~~~~~~~
/home/alucryd/Projects/OpenMQTTGateway/main/ZgatewayRTL_433.ino: In function 'void createOrUpdateDeviceRTL_433(const char*, const char*, uint8_t)':
/home/alucryd/Projects/OpenMQTTGateway/main/ZgatewayRTL_433.ino:79:43: error: cannot convert 'LORAdevice*' to 'RTL_433device*' in initialization
   RTL_433device* device = getDeviceById(id);
                                           ^
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib401/FS/FS.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib401/FS/vfs_api.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib6b9/WebServer/Parsing.cpp.o
Archiving .pio/build/makerfabs-wrover-lora-32-868/lib122/libDNSServer.a
Indexing .pio/build/makerfabs-wrover-lora-32-868/lib122/libDNSServer.a
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib6b9/WebServer/WebServer.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib6b9/WebServer/detail/mimetable.cpp.o
Compiling .pio/build/makerfabs-wrover-lora-32-868/lib6ae/WiFiManager/WiFiManager.cpp.o
*** [.pio/build/makerfabs-wrover-lora-32-868/src/main.ino.cpp.o] Error 1

Describe the solution you'd like I'd like to be able to use both LoRa and FSK on the same gateway, if possible.

Describe alternatives you've considered The only alternative I can think of right now is building another gateway just for FSK.

Additional context The board: https://wiki.makerfabs.com/MaESP_ESP32_Lora_Gateway.html

My environments.ini:

[env:makerfabs-wrover-lora-32-868]  ; MaESP ESP32 Board with SSD1306 display
platform = ${com.esp32_platform}
board = esp-wrover-kit
lib_deps =
  ${com-esp32.lib_deps}
  ${libraries.lora}
  ${libraries.rtl_433_ESP}
  ${libraries.ssd1306}
build_flags =
  ${com-esp32.build_flags}
  '-DZgatewayRTL_433="rtl_433"'
  '-DZradioSX127x="SX127x"'
  '-DRF_SX1278="SX1278"'
  '-DRF_MODULE_SCK=14'
  '-DRF_MODULE_MISO=12'
  '-DRF_MODULE_MOSI=13'
  '-DRF_MODULE_CS=32'
  '-DRF_MODULE_RST=33'
  '-DRF_MODULE_DIO0=36'
  '-DRF_MODULE_DIO1=27'
  '-DRF_MODULE_DIO2=26'
  '-DOOK_MODULATION=false'
  '-DRF_FREQUENCY=868.300'
  '-DZgatewayLORA="LORA"'
  '-DLORA_BAND=868E6'
  '-DLORA_SCK=14'
  '-DLORA_MISO=12'
  '-DLORA_MOSI=13'
  '-DLORA_SS=25'
  '-DLORA_RST=2'
  '-DLORA_DI0=35'
  '-DLORA_SPREADING_FACTOR=9'
  '-DLORA_CODING_RATE=7'
  '-DDEFAULT_CRC=false'
  '-DZdisplaySSD1306="SSD1306"'
  '-DSDA_OLED=4'
  '-DSCL_OLED=5'
  '-DRST_OLED=16'
  '-DWIFI_LoRa_32=true'
1technophile commented 5 months ago

I guess it's not intended to be used that way?

This is not a configuration that we are supporting. Also I'm not planning to add it as there was not a lot of ask for it. So your solution is indeed to use another board.

We are studying the add of BLE to RTL, or merging FSK and OOK binaries for example as they are more requested.

github-actions[bot] commented 2 months ago

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

github-actions[bot] commented 1 month ago

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