# Cant upload a new library

**URL:** <https://community.particle.io/t/cant-upload-a-new-library/44951>\
**Category:** Libraries\
**Created:** [November 2, 2018, 2:49pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951 "2018-11-02T14:49:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Postler](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/postler/32/13693_2.png) [@Postler](https://community.particle.io/u/Postler)\
**Post date:** [November 2, 2018, 2:49pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/1 "2018-11-02T14:49:32Z")

</div>

I am on the stage to [upload a new private library](https://docs.particle.io/tutorials/device-os/libraries/#uploading-a-private-version) via CLI, but get an authorization error from CLI like this:  
`particle library upload`  
HTTP error 401 from [https://api.particle.io/v1/libraries](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](https://pixycam.com/downloads-pixy2/)

---

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [November 2, 2018, 2:51pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/2 "2018-11-02T14:51:33Z")

</div>

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

```auto
particle login

```

---

<div class="post-metadata">

**Author:** ![Postler](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/postler/32/13693_2.png) [@Postler](https://community.particle.io/u/Postler)\
**Post date:** [November 2, 2018, 2:57pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/3 "2018-11-02T14:57:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [November 2, 2018, 2:57pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/4 "2018-11-02T14:57:59Z")

</div>

Ping @rickkas7 @ScruffR

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [November 2, 2018, 3:07pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/5 "2018-11-02T15:07:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Postler](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/postler/32/13693_2.png) [@Postler](https://community.particle.io/u/Postler)\
**Post date:** [November 2, 2018, 3:23pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/6 "2018-11-02T15:23:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [November 2, 2018, 3:44pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/7 "2018-11-02T15:44:39Z")

</div>

Ingo, I do remember helping @hasanals with the Pixy2 library a [while back](https://community.particle.io/t/pixy2-connection-to-photon/44362). 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.

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [November 2, 2018, 5:30pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/8 "2018-11-02T17:30:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Postler](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/postler/32/13693_2.png) [@Postler](https://community.particle.io/u/Postler)\
**Post date:** [November 2, 2018, 10:12pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/9 "2018-11-02T22:12:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [November 3, 2018, 4:24am UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/10 "2018-11-03T04:24:33Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![Postler](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/postler/32/13693_2.png) [@Postler](https://community.particle.io/u/Postler)\
**Post date:** [November 3, 2018, 10:24am UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/11 "2018-11-03T10:24:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [November 3, 2018, 10:57am UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/12 "2018-11-03T10:57:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Postler](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/postler/32/13693_2.png) [@Postler](https://community.particle.io/u/Postler)\
**Post date:** [November 3, 2018, 11:49am UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/13 "2018-11-03T11:49:29Z")

</div>

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

> You are not the owner of this library

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [November 3, 2018, 12:31pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/14 "2018-11-03T12:31:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Postler](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/postler/32/13693_2.png) [@Postler](https://community.particle.io/u/Postler)\
**Post date:** [November 4, 2018, 3:31pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/15 "2018-11-04T15:31:31Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/9/a/9a8b8fa7f31585595337d0ec5d1264170a46c1f8.JPG)

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.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [November 4, 2018, 3:50pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/16 "2018-11-04T15:50:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Postler](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/postler/32/13693_2.png) [@Postler](https://community.particle.io/u/Postler)\
**Post date:** [November 4, 2018, 4:15pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/17 "2018-11-04T16:15:32Z")

</div>

I cant, ScruffR.

 ![cli_login](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/7/2/726179bc3cd60e2eceedb27763aa1d7c4814ec48.JPG)

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](https://community.particle.io/t/particle-cli-update/27512/2). Now v1.35.2 is available and login with token works.

---

<div class="post-metadata">

**Author:** ![Postler](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/postler/32/13693_2.png) [@Postler](https://community.particle.io/u/Postler)\
**Post date:** [November 4, 2018, 4:58pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/18 "2018-11-04T16:58:51Z")

</div>

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](https://go.particle.io/shared_apps/5bdf24a55e1b657fac000997)

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [November 4, 2018, 7:52pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/19 "2018-11-04T19:52:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Postler](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/postler/32/13693_2.png) [@Postler](https://community.particle.io/u/Postler)\
**Post date:** [November 4, 2018, 10:03pm UTC](https://community.particle.io/t/cant-upload-a-new-library/44951/20 "2018-11-04T22:03:58Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/9/1/91c16813c216c4521a4681e58919ffbb5caa718e.png)

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](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/2/1/21bcebc41ae6975e50a00272509d199e6b05ed1e.JPG)
