Steps to use libraries 2.0

DOH!!! I missed that!

The library name is ALREADY case sensitive. It’s just that getting the correct name from the Web IDE is a pain.

1 Like

What is doing the flattening on windows that it would not do on Linux?

It must have to do with path separators being different.

That path is being built on the server, right? So windows uses ‘’ versus linux which uses ‘/’ for path separation. Can’t that be fixed in particle.js before sending to the server?

You got it chief. I just gotta do it :smile:

1 Like

@jvanier,

tested with particle-cli-2.0.0-libraries.4 for:

  • 0.5.3-rc.3
  • 0.6.0-libraries.1
KENMBP:cli-lib kennethlimcp$ pcp --target 0.5.3-rc.3

Compiling code for photon
Targeting version: 0.5.3-rc.3

Including:
    /Users/kennethlimcp/Desktop/cli-lib/project.properties
    /Users/kennethlimcp/Desktop/cli-lib/src/application.cpp
attempting to compile firmware 
downloading binary from: /v1/binaries/57c63d9ed66d10de4d7faf08
saving to: photon_firmware_1472609687126.bin
Compile succeeded.
Saved firmware to: /Users/kennethlimcp/Desktop/cli-lib/photon_firmware_1472609687126.bin
KENMBP:cli-lib kennethlimcp$ pcp --target 0.6.0-libraries.1

Compiling code for photon
Targeting version: 0.6.0-libraries.1

Including:
    /Users/kennethlimcp/Desktop/cli-lib/project.properties
    /Users/kennethlimcp/Desktop/cli-lib/src/application.cpp
attempting to compile firmware 
	downloading binary from: /v1/binaries/57c63dd9d6e4eeb04d34a98d
saving to: photon_firmware_1472609728919.bin
Compile succeeded.
Saved firmware to: /Users/kennethlimcp/Desktop/cli-lib/photon_firmware_1472609728919.bin

Public libraries are working but a little confusing:

KENMBP:cli-lib kennethlimcp$ p library add stepper
Library stepper not found
KENMBP:cli-lib kennethlimcp$ p library add spark-stepper
Library spark-stepper not found
KENMBP:cli-lib kennethlimcp$ p library add Stepper

Took me a while to figure out which name to use.

Do you still have the same issue? If so, what are the steps to reproduce?

Nope, I haven’t got that issue anymore.
After I upgraded all my devices from 0.5.2 to 0.6.0-rc.1 I could also go to 0.6.0-libraries.1, so I can’t reproduce it anymore either.

You can use 0.6.0-rc.1 and 0.6.0-libraries.1 interchangeably. They are the same firmware, only difference is 0.6.0-libraries.1 goes thru the new compiler infrastructure.

Has development stalled here?
We are still at v14 in above link and the missing particle-library-manager message still pops up when installing from that zip.

1 Like

Thanks for the reminder. I updated the dependencies for the CLI and installed it successfully on Windows. Let me know if that fixes the issue for you too.

@jvanier, just installed it and only warnings I received were these:

C:\SPARK\TESTING>npm install -g https://github.com/spark/particle-cli/releases/download/v2.0
.0-libraries.15/particle-cli-2.0.0-libraries.15.tgz
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a
RegExp DoS issue
npm WARN excluding symbolic link test\server\static\ie8-polyfill.js -> ../../../ie8-polyfill
.js
npm WARN excluding symbolic link test\server\static\ie8-polyfill.js -> ../../../ie8-polyfill
.js

Everything else seemed to installed just fine.

1 Like

I updated the instructions for the latest CLI beta. It comes with a few new things:

The current default firmware 0.5.3 now supports libraries so no need to compile with --target 0.6.0-rc.2

Simple projects now support libraries so you can compile an ino file next to a project.properties for quick apps!

Private libraries are available in libs 2.0. Publishing is now a 2 step process: contribute a new private version then publish that version publicly.

I’m going to post the instructions to add libraries to Dev right after this.

By the way, we dropped the version number back to 1.18.0 because there are not enough user-visible changes to warrant a 2.0 release.

A post was split to a new topic: Using libraries in Particle Dev

I separated the instructions for Dev to a separate topic so if you use Dev, please reply there with your comments.

@jvanier

I’d just like to mention that po-util has its own library manager as well.

I see that we are using similar methods for adding libraries to a project.

  • Po-util uses a libs.txt file to keep track of of what libraries are required, with the git url and name of a repository on each line. All installed libraries are kept in ~/.po-util/lib, and symbolic links to the library files are created in the firmware/ directory of the project.

  • I have observed that Libraries 2.0 keeps a list of libraries the project depends on in a project.properties. Does it keep all libraries in a central location like po-util does, or are libraries downloaded and kept only in a project?

Also how does Libraries 2.0 get the libraries? Does it make some kind of request to the Particle server to get the Git url and additional information?