Wrong lib installed when there are 2 libs with the same name

I was trying to install the following library:
ssd1306 by Alexey Dynda
but when I press install the following lib is being installed:
SSD1306 by Majenko Technologies

It seems like library manager has problems identifying libs with duplicated names.

Windows 10 1903, PlatformIO Home: 2.3.2, Core: 4.0.3

If memory serves me correct, when duplicate name libraries are encountered, the first one found will be used. This is the main reason you should specify the library by ID - as then regardless of name(or name changes) only the specified library will match.

I use the following syntax, as PIO will ignore semi-colon comments:

lib_deps = 
   1904 ;ssd1306

I’m not talking about lib_deps configuration as I can just give the zip location from github. I’m talking about the bug in the library installer which is not case sensitive I suppose. It should install libs by its ID not lib’s name

1 Like

Oh, sorry… misread that… gotcha now… the library manager / library installer

Well, this could be a problem… :open_mouth: I fully agree… that mode is wrong… it should install the library you are on (i.e. by id)… not be ‘automatically chosing’ anything.

image

I’m a beginner. Keep reading to install libraries by id number. How do I find the id number of a library installed in the Arduino IDE?

You are necro-posting in a 2 year old topic. The information here is outdated.

Library IDs are the internal IDs within the PlatformIO library registry, looking into the the libraries files in your local Arduino IDE installation will not help. You need to find the library in the registry. Clicking on one lib will then show in the URL the ID, e.g. https://platformio.org/lib/show/64/ArduinoJson, ID 64 is ArduinoJSON.

However, you should not be using library IDs in the current day and age. You should always be following the official documentation, e.g. regarding the library manager. There it will tell you that you refer to a library, which is in the PlatformIO registry system, with their uploader username, library name and version (as SemVer expression).

PlatformIO again shows you this on every library install page, e.g. with the above referenced ArduinoJson

So you should be using

lib_deps =
     bblanchon/ArduinoJson @ ^6.18.3

in the platformio.ini (see lib_deps) instead of the outdated way

lib_deps =
   64

Sorry about the old topic business. That is the one that came up when I did my search.
I am just getting my feet wet with PIO, so most of what you said was way above my pay-grade.
I have an Arduino project that is working fine in that IDE. It uses LiquidCrystal_I2C.h library and DHT_U.h.
When I try to install the libraries in PIO, there are several with the same name. I have tried them all, but being a new PIO user, I probably did something wrong. Bottom line, I was never successful.
Guess I’d better just stick with the Arduino IDE. At least I got that to work.
Thanks for all of your help and understanding.
-Hal

Hi @smithhal, I’m also fairly new to PIO. It’s true that in PIO there might be multiple libraries with nearly identical names. Here is what I do:

In order figure out what is the “Arduino equivalent” library, I first look at the Arduino’s Library Manager. Looking closely at the library you are using you can see the author’s name. For example, for the LiquidCrystal_I2C library that I have installed the author is Frank de Brabander.

image

Then in PIO I look for a library of the same name from the same author:

image

And that’s it. If you want to be double sure, you can also select “More Info” in the Arduino’s Library Manager and “Repository” in PIO’s Library registry and make sure they bring you to the same GitHub repo.

image

Hope this helps.

Thanks Mauricio…
Your solution makes a lot of sense to me. I’ll give it a try soon.
Thanks so much for the help.
-Hal

1 Like