Cant upload a new library


#1

I am on the stage to upload a new private library via CLI, but get an authorization error from CLI like this:
particle library upload
HTTP error 401 from https://api.particle.io/v1/libraries - The access token provided is invalid.

How can I give CLI my token?

At the end I like to share the Pixy2-libs from pixycam.com


#2

Are you logged into the cli? The token saved on your computer could be expired. Try logging in again.

particle login

#3

worked! - Now the next step:

You are not the owner of this library

I think it will be noticed that this is not the identical email address specified in the properties. Actually, I’m not the publisher of Lib, but I just want to make it accessible to Particle users.


#4

Ping @rickkas7 @ScruffR


#5

It someone else has uploaded a library with the same name (even only private) you cannot upload a library with that same name.
You either need to rename your library or file a PR on the original contributors repository and hope it’ll be merged and updated by him.

@Postler, if you can provide the exact library name (stated in library.properties) @rickkas7 may be able to look up who has already claimed that name.


#6

Content of library.properties:

name=Pixy2
version=1.0.3
author=cmucam@cs.cmu.edu
license=GNU
sentence=Library to use the Pixy v2 camera with Particle-Devices

Pixycam5 for Pixy v1 is available in the Libs.

I can provide you with my prepared file structure if this helps.


#7

Ingo, I do remember helping @hasanals with the Pixy2 library a while back. Maybe he has claimed the library name but didn’t get round to publishing the lib.

But I can’t be sure as I have no access to the private libraries list.


#8

I can’t seem to find an existing library named Pixy2, but since it’s not letting you create it, I’d just switch to a different name.


#9

I get the same error from CLI as before:

You are not the owner of this library

after I tested with another library name “Pixy2 CMUcam” and changed the E-Mail to mine.
In both cases I got the same message, after upload.


#10

No blanks in the library name! That’s the reason why you see so many libraries with _ where you’d normally use a blank. After all, the library name is also the name of the main .h and .cpp files and as such they mustnot contain blanks.

Since a blank breaks the library name, your “new” name is still Pixy2.


#11

Does not work yet. Have tried the following changes in library.properties:

  • name = Pixy2 (I started with that name)
  • name = Pixy2_CMUcam (with underscore)
  • name = Pixy2_CMUcam + renamed src/Pixy2.h > src/Pixy2_CMUcam.h

How does the importer know that I am not the owner of the Lib?


#12

Being the owner of the lib only depends on who - or rather which account - has uploaded a lib with that very name. There is no connection between the URL, Repository or Author field of library.properties.

I guess the error messages for your three tries did slightly vary, so it would have been good to state each of the individual responses too.


#13

I got no individual errors: always the same how above, ScruffR

You are not the owner of this library


#14

Try some other name again, but now right from the start with the name consistently set in library.properties, header .h and .cpp file. Maybe you were just “lucky” to again pick a name that was already taken.

Otherwise you can send me a zip file of your library and I’ll try to upload it.


Update:
After receiving @Postler’s zip file the reason for the issue became clear quite quickly. The library.properties file was invalid but the error message given by CLI was rather misleading.
After correcting the format of the file I was able to upload the library as Pixy2.
Currently the library hasn’t been made public.


#15

At the moment I prepared the file-structure on a Windows-PC with renewing the lib.prop-file.
I wanted to upload, but I cant authenticate my login with a token.
cli_login

On MacOS I get the question with e-mail, password AND Token (Pls enter a login code).
This is on Windows missing - using CLI v1.23.0.


#16

Your CLI is rather old which most likely doesn’t support multifactor authentication.
Currently we are at 1.35.2
Try updating via particle update-cli and then try again.


#17

I cant, ScruffR.

There are 3 tools (boom, cryptiles, hoek) out of maintanance. Could be the problem?

Update: I´m deleting CLI (npm uninstall -g particle-cli) and install the Windows-CLI by following this guide. Now v1.35.2 is available and login with token works.


#18

Until one error I cleaned up the code:
Error: Pixy2.h:31:77: ‘SPISettings’ was not declared in this scope
Here the prepared example with manual included files for review:
https://go.particle.io/shared_apps/5bdf24a55e1b657fac000997


#19

You need to add #include "Arduino.h" in order to get SPISettings - don’t ask, I’ve had discussions about that to no avail :see_no_evil:


#20

image

Edited and successful uploaded as private library!

So where exactly do I find the private library to test before I share?
The documentation says that I could also access via WebIDE.
I can not find them now - too late for the eyes?

Update: After a while the entry appears:
lib2