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 787 forks source link

Linking error on ESP32 S3 board #1606

Closed Ltty closed 1 year ago

Ltty commented 1 year ago

Describe the bug The OpenMQTTGateway project cannot be compiled for the Bee S3 (board = bee_s3), which uses an ESP32-S3. The compilation fails during linking because of multiple definitions of a public variable in Espressif Framework and OpenMQTTGateway.

/home/gitpod/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/bee-openhab/libFrameworkArduino.a(USBCDC.cpp.o):/home/gitpod/.platformio/packages/framework-arduinoespressif32/cores/esp32/USBCDC.cpp:25: multiple definition ofdevices'; .pio/build/bee-openhab/src/main.ino.cpp.o:/workspace/OpenMQTTGateway/main/ZgatewayBT.ino:70: first defined here collect2: error: ld returned 1 exit status *** [.pio/build/bee-openhab/firmware.elf] Error 1`

To Reproduce Steps to reproduce the behavior:

  1. Create a configuration that uses board = bee_s3
  2. Add ${libraries.ble} to to lib_deps
  3. Add -DZgatewayBT="BT"' to the build flags
  4. Compile the project using the configuration

Expected behavior The firmware builds without errors

Environment (please complete the following information):

[env:bee-openhab] platform = ${com.esp32_platform} board = bee_s3 board_build.partitions = min_spiffs.csv lib_deps = ${com-esp.lib_deps} ${libraries.wifimanager32} ${libraries.ble} ${libraries.decoder} ${libraries.adafruit_neopixel} build_flags = ${com-esp.build_flags} '-DZgatewayBT="BT"' '-DANEOPIX_IND_DATA_GPIO=48' '-DANEOPIX_IND_NUM_LEDS=1' '-DRGB_INDICATORS=true' '-DNO_INT_TEMP_READING=true' ; Internal temperature reading not building on ESP32 C3 or S3 '-DOpenHABDiscovery=true' '-DGateway_Name="OMG_ESP32_BLE_OH"' '-DDEFAULT_LOW_POWER_MODE=2' '-DTimeBtwRead=550000' '-DAttemptBLECOnnect=false' '-DActiveBLEScan=false' custom_description = BLE gateway with OpenHAB discovery

Additional context Defining vector<BLEdevice*> devices; as external in ZgatewayBT.ino solves the linking issue. However, the device is then stuck in a boot loop when connected via USB to a computer.

1technophile commented 1 year ago

Same topic is being discussed below: https://community.openmqttgateway.com/t/linking-error-on-esp32-s3-board/2446

github-actions[bot] commented 1 year ago

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

github-actions[bot] commented 1 year ago

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