Friday, September 13, 2024

Slightly Painful - Painless Mesh for ESP32

While working on a mesh networking project, I decided to give Painless Mesh a try. 

I ran into whole bunch of issues in PlatformIO for some reason, so I resorted to using ArduinoIDE 2. 

The first weird thing was that I got a message saying: 

Failed to install library: 'PubSubClient:2.8.0'.

Error: 2 UNKNOWN: destination dir C:\Users\CorrLabs\Documents\Arduino\libraries\PubSubClient already exists, cannot install

The solution to this was just to manually delete the folder and reinstall the library. For some reason there was a library already downloaded, but Arduino IDE could not utilize it.


Then I ran into this one:

wifi.hpp:49:14: error: 'class WiFiClass' has no member named 'setAutoConnect'; did you mean 'setAutoReconnect'?

Fortunately, I found a comment by a person named luckymatt who had the answer to this. Basically the problem is just with compatibility changes between versions. 


At this point, I was able to compile and flash my ESP32-WROOM32 dev board with the Painless Mesh MQTT example.


References:

https://forum.arduino.cc/t/error-with-wifi-hpp-when-compiling-painless-mesh-code/1248608/13