homieiot / homie-esp8266

💡 ESP8266 framework for Homie, a lightweight MQTT convention for the IoT
http://homieiot.github.io/homie-esp8266
MIT License
1.36k stars 308 forks source link

Issue with ArduinoIDE and manually installed libraries #742

Open trysten opened 1 year ago

trysten commented 1 year ago

I thought it'd be fun to use git sub-modules to install all the dependencies for homie-esp8266. Everything seems to be working fine for esp8266, but when I installed the dependencies for esp32 I started having issues.

I added arduino-esp32 and ASyncTCP to my sketch folder. I set the board to ESP32 and compile the minimal example.

Lots of errors and warning about SEMAPHORE not declared stuff

/home/user/Arduino/libraries/async-mqtt-client/src/AsyncMqttClient.cpp:353:3: error: 'SEMAPHORE_TAKE' was not declared in this scope
   SEMAPHORE_TAKE();
   ^~~~~~~~~~~~~~

and an error about GET_FREE_MEMORY

/home/user/Arduino/libraries/async-mqtt-client/src/AsyncMqttClient.cpp: In member function 'uint16_t AsyncMqttClient::publish(const char*, uint8_t, bool, const char*, size_t, bool, uint16_t)':
/home/user/Arduino/libraries/async-mqtt-client/src/AsyncMqttClient.cpp:739:30: error: 'GET_FREE_MEMORY' was not declared in this scope
   if (_state != CONNECTED || GET_FREE_MEMORY() < MQTT_MIN_FREE_MEMORY) return 0;
                              ^~~~~~~~~~~~~~~

I have cloned the development versions of all libraries:

 855f5261913c74e9f4f99fc0de184c847cc4db59 ../hardware/esp32com/arduino-esp32 (heads/master)
 521ae60a89e64bb0d1eb7a0b7addf620ced5cad3 ../hardware/esp8266com/esp8266 (heads/master)
 ecbc8e85d436b50a2157c0aa2619974e8d7dfa65 ArduinoJson (heads/6.x)
 ca8ac5f919d02bea07b474531981ddbfd64de97c AsyncTCP (heads/master)
 ee74d739787caf1832c1cf5ad36134e601193b97 Bounce2 (heads/master)
 15476867dcbab906c0f1d47a7f63cdde223abeab ESPAsyncTCP (heads/master)
 f71e3d427b5be9791a8a2c93cf8079792c3a9a26 ESPAsyncWebServer (heads/master)
 89bf46485d5b60ce1e8e5e4d265a9c1570de3dc5 async-mqtt-client (heads/develop)
 e0347c08231592672c16c07356127a8f5d539c26 homie-esp8266 (heads/develop)

I've obviously made some nooby error, but I don't know what it is. I'm filing an issue because I think it might be worth clarifying the documentation to avoid this if it is as easy to reproduce as it seems.