The annoyance of updating libraries

During the years I’ve installed tons of libraries for a ton of different projects. Arduino IDE remembers all of them, of course. I don’t. Libs depend on each other, so if I remember I need one library, I’m not that sure about what other libraries that particular library depends on. So I tend to update all libs that the IDE suggests I should update. Sometimes this leads to things not working anymore.

My servos stopped working. I have a lot of servos and I use PCA9685 drivers for them, and I’ve used the PCA9685_RT library. When they stopped working, I started to suspect library updates. I did more error checking in my code and saw that no I2C devices could be found (though I wasn’t that sure my I2C scanner routine worked either). Anyway, I deleted the PCA9685_RT lib and installed another instead. Now the servos started working (after adapting my code to the other library).

So I’m in the situation where my code works and I don’t know why it works. :grinning_face_with_smiling_eyes: :roll_eyes:

I suspected the PCA9685_RT lib had become incompatible with something (Wire.h or something, I don’t know), I replaced PCA9685_RT with something else and now it’s working. The PCA9685_RT lib is probably just fine, as well as all other libs. They just don’t always mix after updates. Or so it feels.

So from now on, I won’t update anything unless the old one doesn’t work.

1 Like

Just a suggestion.

When your project is finished, enable verbose output during compilation (if not done already). You will get all the information that you need to about the libraries and platform / board used.

The first few lines will tell you the board

FQBN: arduino:avr:nano
Using board 'nano' from platform in folder: C:\Users\bugge\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\bugge\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

and for the libraries the information is near the end.

Using library Wire at version 1.0 in folder: C:\Users\bugge\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire 
Using library Adafruit GFX Library at version 1.12.3 in folder: C:\Users\bugge\OneDrive\Documents\Arduino\libraries\Adafruit_GFX_Library 
Using library Adafruit BusIO at version 1.17.4 in folder: C:\Users\bugge\OneDrive\Documents\Arduino\libraries\Adafruit_BusIO 
Using library SPI at version 1.0 in folder: C:\Users\bugge\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI 
Using library Adafruit SSD1306 at version 2.5.15 in folder: C:\Users\bugge\OneDrive\Documents\Arduino\libraries\Adafruit_SSD1306 

You can copy that information and store it in a text file with the project for future reference.

2 Likes

Some of these libraries have been around for a long time now.
Should we expect authors to maintain them for years and years?
Probably not.
A vote of thanks to all contributors is in order.

Occasionally a library will have a major change that breaks code written for previous versions. For the PCA9685_RT library, there was at least one major change a couple of years ago that removed Wire.begin() from inside the library and make it the programmer's responsibility to initialize the I2C bus, that may be your problem https://github.com/RobTillaart/PCA9685_RT/issues/28. There is also the possibility that the boards package for a particular board will have some change that breaks compatibility with older code, that has happened recently with the ESP32 board package if I recall correctly.

You can place a copy of a library inside the sketch folder so that you will have a specific version that does not get updated, that might be a better solution than not updating any libraries.

1 Like

There are a couple things to consider.

  1. Use "someLibrary.h" instead of <someLibrary.h> now a local copy takes precedence.
  2. Isn't this what PlatformIO is for?
  3. Change the version number in your library to something like 99.9.9 in library.properties. It looks like version=2.5.0.

It would be nice if you could add a comment to document why this is being done. Maybe github, maybe Sentence and Paragraph.

#3 is global
#2 and #1 are per project

Also, have you made sure this is not a Boards 3 situation?

As the author of this library I am interested in which version you used and which library (+version) did solve your problem. As stated above there can be different causes and I like to understand what caused the break. I might be able to fix the library (or maybe not) for proper future use.

Can you provide this information?

1 Like

If you would like to be able to control the library and boards platform dependencies of each sketch individually (as opposed to the traditional Arduino way of all sketches sharing the same pool of globally installed dependencies), you might be interested in this new 3rd party extension for Arduino IDE 2.x:

You can use the extension to create a build profile (referred to as a "board config" by the extension) that defines all the dependencies of the sketch, including the specific version of each dependency. The sketch will then be compiled in an isolated dependencies environment that only contains those specific dependencies, separated from your collection of globally installed platforms and libraries.

The build profile is stored in a file in the sketch folder, so this data can be distributed with the sketch, and included in backups/version control.

1 Like

For me, when a project is “finished” or stable, I copy all the required libraries to the sketch folder and make them all “local”. I will recompile and verify operation. (I haven’t done this in a while so I might miss a step) I will copy the hex file to the sketch libraries as well (just in case).

I also add to the sketch the target processor, and speed, whatever boards my project needs etc. and most of all, the sketch version. If appropriate I will also add a pdf of the wiring diagram/schematic etc.

Then I will zip them up and store them on another drive. like “completed Arduino projects”.

This is very good information and something I didn't know. Thank you

Hi - the problem is that the Arduino IDE try to update anyway if there is a library.properties in the folder….

I have the same problem with lvgl, I need 8.4 and have it in the scetch folder, and it gets updated. Without the library.properties it wouldn’t compile…:frowning:

This is incorrect. Arduino IDE only offers updates of the libraries installed under the libraries subfolder of the sketchbook folder.

The Library Manager system that provides updates doesn't know anything about libraries that are bundled with the sketch. As far as Arduino IDE knows, those are just part of the sketch code. It doesn't use the library.properties file at all in that configuration.

Maybe you are getting confused between the concepts of "sketch folder" and "sketchbook folder"?

I used the newest version of your lib. And switched to this:

1 Like

I think the question was far more which version of Rob's library did work in the past.

1 Like

@Johan_Ha

Thanks for this info, appreciated,

Some more questions to zoom into the cause

  • As @sterretje said which version of the PCA9685_RT library did work?
  • What board do you use in your project?
  • Did you have a compile error or a runtime error?

Created issue - library does not work. · Issue #32 · RobTillaart/PCA9685_RT · GitHub to put it on to my todo list

I believe I used the newest version, when it was still running, unless PCA9685_RT had a recent update and it was one of those libs that updated last time I accepted all updates. I mean, I didn’t watch thoroughly what was happening keeping track of which libs got updated.

The IDE says:

Updates are available for some of your libraries.

Then I click Install All.

I have a Seeed Xiao ESP32-C6. But I also use an Arduino Leonardo. And both work fine, when they work. And both fail, when they fail. Sorry, but I can’t track the exact moment when it started to fail. I was more focused on getting it work than on finding the cause.

I had no compile or runtime error, the servos just didn’t move. The servos did move at startup, when they get some noise from somewhere, but the I2C traffic failed. Everything seems to be working again. PCA9685_RT was probably just fine, but something else wasn’t. And deleting PCA9685_RT and installing another PCA9685 lib instead probably installed some other depending libs. Or re-installed them, I don’t know.

OK, fair enough

Analysis so far

The latest version 0.7.2 (may 9 2025) has no functional changes compared to the 0.7.1 version (jan 5 2024). The last breaking changes were in 0.7.0 (dec 21 2023), renaming some functions to make it work on Arduino Nano ESP32.

The 0.7.0 changes (and version before) would cause a compile error, as you did not get such error with 0.7.2 you have updated from either 0.7.0 or 0.7.1. I cannot explain why it did not work from the minor changes in the library.

I have a Seeed Xiao ESP32-C6. But I also use an Arduino Leonardo. And both work fine, when they work. And both fail, when they fail.

As @david_2018 said, it could be an update from those boards.

As you have a working solution I won’t investigate further.
Again, thanks for the information so far

1 Like

Yes, I assume that library was located in the /libraries sub folder which is the easiest way if you have a big library like the lvgl.
In my case, I changed the version specified in the .properties file to a big number - then I finally can avoid that the library gets updated…