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.56k stars 785 forks source link

Zactuator "undefined reference to `MQTTtoONOFF" #556

Closed Fr3d59180 closed 4 years ago

Fr3d59180 commented 4 years ago

I've previoulsy tested other feature DHT,DS1820 working so easy !! but with Zactuator :( I've only decommented in User_config.h this line :

define ZactuatorONOFF "ONOFF" //ESP8266, Arduino, ESP32, Sonoff RF Bridge

And I get

_> ketch\main.ino.cpp.o: In function `MQTTtoSYS(char*, ArduinoJson::JsonObject&)':

C:\Users\fr3d\Documents\PlatformIO\Projects\OpenMQTTGateway_new\OpenMQTTGateway\main/main.ino:303: undefined reference to `MQTTtoONOFF(char, char)'

sketch\main.ino.cpp.o: In function `variantAsInteger':

C:\Users\fr3d\Documents\PlatformIO\Projects\OpenMQTTGateway_new\OpenMQTTGateway\main/main.ino:303: undefined reference to `MQTTtoONOFF(char, char)'

collect2.exe: error: ld returned 1 exit status_

Re-tested on a freshen redownloaded.

Fr3d59180 commented 4 years ago

solution :

ifdef ZactuatorONOFF // outside the jsonpublishing macro due to the fact that we need to use simplepublishing with HA discovery

  MQTTtoONOFF(topicOri, jsondata);
  #endif      
#endif

If I put it inside i can compile. in simplepublishing

1technophile commented 4 years ago

Hi,

Strange, I've tried to uncomment #define ZactuatorONOFF in User_config.h but I did not get any build error. May you give me the board used?

thomas-merzenich commented 4 years ago

I have the same error: /home/thomas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /tmp/arduino_build_562085/sketch/main.ino.cpp.o:/home/thomas/Arduino/OpenMQTTGateway-development/main/main.ino:1323: undefined reference to MQTTtoONOFF(char*, char*)

/home/thomas/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /tmp/arduino_build_562085/sketch/main.ino.cpp.o: in function receivingMQTT(char*, char*):

/home/thomas/Arduino/libraries/ArduinoJson/src/ArduinoJson/JsonObject.hpp:166: undefined reference to MQTTtoONOFF(char*, char*)

collect2: error: ld returned 1 exit status

I'm using LOLIN(WEMOS) D1 mini Pro.

david-j84 commented 4 years ago

I am also having the same issue with a WEMOS D1 Mini, I have experimented with different versions of the ArduinoJSON library as some limited troubleshooting. I tried the 0.9.3 and the 0.9.4b beta.

1technophile commented 4 years ago

Could you share your user_config.h or/and your env definition please?

1technophile commented 4 years ago

reproduced with Arduino IDE (works with PIO)

halk1982 commented 2 years ago

Hello 1technophile, can't thank you enough for OMG project! It's absolutely amazing from several aspects. Regarding this issue, to my understanding this will be resolved in version 0.9.9, is that correct ?

1technophile commented 2 years ago

Hello;

It should be resolved from v0.9.4, are you still getting this error?

halk1982 commented 2 years ago

It could be that I'm facing another issue then, apologies. I tried to upload to an ESP32 (Espressif) both BLE & Actuator ONOFF but failed with "Zactuator "undefined reference to `MQTTtoONOFF" error message:

Screen Shot 2022-01-20 at 19 58 50

Then I tried to upload only ZActuatorONOFF to an ESP8266 and again failed with these messages:

Screen Shot 2022-01-20 at 14 45 05

P.S. I have already successfully created an ESP8266 with CC1101 and an ESP32 with BLE only.

1technophile commented 2 years ago

Which version are you trying to build @halk1982 ?

halk1982 commented 2 years ago

The latest one, 0.9.8. After all, I managed to do it without any issue by using PlatformIO. Not sure what was the problem with Arduino IDE.