Library is cloned only partially

I try to use GitHub - Seeed-Studio/PN532: NFC library using PN532 to read/write card and communicate with android library in my project. It is not contained in Platformio Registry, so I try to clone it. I add lib_deps = https://github.com/Seeed-Studio/PN532.git to my platformio.ini file, but the library is cloned only partially - only PN532 subdirectory of the repo is cloned, other directories like PN532_SPI are not there.
What am I doing wrong and how can I fix it?

PlatformIO doesn’t support a repo that has multiple libraries. It will always look for the first manifest file (library.json,package.json, etc.) or the examples/ folder and then only copy that subpath from it. (See How can I create a repository with multiple libraries in it on GitHub and use them in a project? - #3 by pfeerick).

As the readme says, even installing this library in the Arduino IDE requires adding symbolic links from the sub-folders to the main libraries folder, which is completely abnormal for a regular Arduino library.

In PlatformIO, you should download the library once and copy all sub folders in the lib/ folder of your project, so that lib/PN532, lib/PN532_HSU etc exist.

1 Like