Library Registry - Semantic Version Error

Hello:

I’m trying to build an Arduino project in PlatformIO, and after pulling one of the libraries from the registry, I get the message:

SemanticVersionError: Invalid simple block ‘^2.5.9cd’

After seeing this, I looked at my list of lib_deps in platformio.ini for the project and noted that one of the libraries was listed as:

firmata/Firmata@^2.5.9cd

Noting that this didn’t match similar syntax to other libraries, I simply removed the “cd” characters at the end of the line and saved the ini file.

Unfortunately this didn’t remove the issue. I’ve seen a similar issue posted on 16-April-2024 but no responses. Any ideas on how to resolve this issue? It looks like I’m not the only one running into this issue when trying to build a project using the ESP32 board platform.

Thanks,
Rob

Change your lib_deps to firmata/Firmata@^2.5.9 and perform a full clean

(PIO Icon → Project Tasks → [environment name] → General → Full Clean)

1 Like

OK, thanks for your help, that seemed to clear up the original issue but when I run build I’m running into other issues with some of the dep_libs for my project. in particular, those that were not found in the library registry.

I downloaded the library in zip file format to my downloads directory, and then from the platformio cli I run the command:

pio pkg install -l “~/Downloads/Adafruit-GFX-Library-1.8.4.zip”

I get an error

VCSBaseException: VCS: Unknown repository type ~/Downloads/Adafruit-GFX-Library-1.8.4.zip

Unless another argument is needed for pio pkg install command, this seems to match what I’ve found on: How integrate external personal .zip libraries - #9 by jim2

Some questions I have about this method of library installation:

  1. Do I need to be in a specific project directory when I issue the pio pkg install command?
  2. If this install method is successful, does the library entry in plaformio.ini have the original .zip file extension?

Thanks again for the support!
Rob

If the library is hosted on github simply add the link to your lib_deps like so:

lib_deps =
  https://github.com/me-no-dev/ESPAsyncWebserver

See lib_deps — PlatformIO latest documentation

If the library is only available as ZIP file, you should unzip the content to the .lib folder. See README inside the lib folder:


This directory is intended for project specific (private) libraries.
PlatformIO will compile them to static libraries and link into executable file.

The source code of each library should be placed in an own separate directory
("lib/your_library_name/[here are source files]").

For example, see a structure of the following two libraries `Foo` and `Bar`:

|--lib
|  |
|  |--Bar
|  |  |--docs
|  |  |--examples
|  |  |--src
|  |     |- Bar.c
|  |     |- Bar.h
|  |  |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
|  |
|  |--Foo
|  |  |- Foo.c
|  |  |- Foo.h
|  |
|  |- README --> THIS FILE

I don’t have a .lib directory in my project but one that is called lib, I think that is what you mean? I do see a README file in that directory.

For the github lib_deps link, this would be the exact link from the particular github repository, I think these typically end with a .git extension.

Rob

Yes, sorry, my mistake - I meant the lib directory.

Github repositories can also be linked without the .git extension

1 Like