darrylb123 / ESP32_SMA-Inverter-MQTT

Arduino project to read SMA Inverter data via ESP32 bluetooth
MIT License
6 stars 4 forks source link

Which program to build and upload, VScode and Gitpod error. #8

Closed kommando828 closed 9 months ago

kommando828 commented 9 months ago

Having an issue trying to get this to build using VS Code, In PIO home I get this error highlighted in bold.

Compiling .pio\build\espwroom32\lib175\WiFi\WiFiScan.cpp.o In file included from src/ESP32_SMA_Inverter_App.cpp:26:

__src/ESP32_SMA_Inverter_App.h:9:10: fatal error: TBPubSubClient.h: No such file or directory__



Not sure if I should be using VS code and so get the error or there is another error.

In Gitpod I get much the same error

In file included from src/ESP32_SMA_MQTT.h:20, from src/ESP32_SMA_MQTT.cpp:25: src/ESP32_SMA_Inverter_App.h:9:10: fatal error: TBPubSubClient.h: No such file or directory


The only change I have made is in platformio.ini where I have set the comms ports to COM[6], as I am using Win11 and the board is set to esp32dev as I have a Wroom32 and this same board type works with other projects. But even if I leave it as lolin_d32 I get the same error. file included from src/ESP32_SMA_MQTT.h:20, from src/ESP32_SMA_MQTT.cpp:25: s_rc/ESP32_SMA_InverterApp.h:9:10: fatal error: TBPubSubClient.h: No such file or directory

thanks in advance for looking.

kommando828 commented 9 months ago

Seems a library is not working, these are said to be used but TBPubSubClient is corrupt on my PC or is no longer working

Dependency Graph |-- ArduinoJson @ 6.21.4 |-- TBPubSubClient @ 2.9.3+sha.5b3177f |-- ESP32 logger @ 1.0.3+sha.f296e5d |-- BluetoothSerial @ 2.0.0 |-- WebServer @ 2.0.0 |-- WiFi @ 2.0.0 |-- FS @ 2.0.0 |-- LittleFS @ 2.0.0 |-- Preferences @ 2.0.0

kommando828 commented 9 months ago

This is from platformio.ini

knolleary/PubSubClient@^2.8

but the library being downloaded is 2.9.3 so maybe there is a mismatch and they are out of sync.

kommando828 commented 9 months ago

Looks like the change from 2.9.2 to 2.9.3 has broken the link between PubSubClient.h and TBPubSubClient.h to be seen as one and the same files. The change notes refer to 2.9.3 as being supposed to fix this but looks to have had the opposite effect.

https://github.com/thingsboard/pubsubclient/releases

I went into ESP32_SMA_Inverter_App.h and edited TBPubSubClient.h to PubSubClient.h and this change allowed the build to finish successfully.

darrylb123 commented 9 months ago

Sorry, Just saw this issue. I had not used Vscode for months and once everything updated I saw the same issue as you described and the fix was as you said. Thanks

darrylb123 commented 9 months ago

Pushed new version with fix