Rookie mistake – forgot to pin library versions!

In PlatformIO there is the platformio.ini – a really powerful tool to select versions of libraries from PlatformIO servers, and initialise settings for the whole project.
I recently had a problem where a friend was not able to compile my SmartPoi project – but it worked for me??

Long story short

I re-cloned the project myself (starting clean) and managed to reproduce the same problem my friend was having while compiling. After a lot of head scratching I realised – the libraries in my project were declared like so:

mathieucarbou/ESPAsyncWebServer @ ^3.1.5

However that just tells the compiler to fetch the LATEST version as long as it is above (^) 3.1.5 – and that particular library had a breaking change update. The reason I didn’t have a problem on my local version was because my compiler was just using the cached local version (not bothering to update every time, you can force this by doing “Full Clean” which I don’t tend to do)

Conclusion

Make sure to pin your versions, especially in code you want to share!

My new platformio.ini now has lib_deps that look like this:

ESP32Async/ESPAsyncWebServer @ 3.7.4

Go and get the latest ESP32 SmartPoi now

git clone https://github.com/tomjuggler/SmartPoi-Firmware

cd SmartPoi-Firmware

git checkout -b ElegantOTA_CombinedS3C3_PlatformIO origin/ElegantOTA_CombinedS3C3_PlatformIO  

Leave a Reply

Your email address will not be published. Required fields are marked *