Having trouble with particle library upload

I’m having issues with particle library upload from the CLI. It’s failing with a generic:

This library could not be imported. Try another library or try this one again later.

Here’s my repo on github:

Any suggestions? I also can’t find the old webIDE option for uploading or updating libraries. Does that still exist?

Nope, uploading from Web IDE has gone since you can't build a folder hierarchy in Web IDE.

Make sure you were logged in with the same user account you uploaded 0.0.2.
What CLI command did you try to upload the library? The message about importing the library suggests you didn't actually use the upload command.
From where did you execute this?

If you are executing particle library upload from the directory where your library.properties file lives it should work tho'

I did a particle login with the same account (I can see the old version in the web IDE under that account) and then a particle library upload. I did this from the directory with library.properties. Is there a way to get more verbose error data?

It just recalled having a similar issue once. Which I only found a solution to by chance.
For some reason I had some non-printable characters (can’t remember what exactly but had to do with the line-ending - maybe CR LF vs. CR vs. LF or so) in my library-properties file which threw off the upload with the same non-descript error.
With an editor that also shows the non-printables (e.g. Notepad++) I saw these culprits and after removing them the library did upload.

I don’t know of any other way to get more info out of CLI than adding the --verbose flag, but I’m not sure whether this does actually provide any additional info in this case.

I’ve tried both with and without CRLFs (using unix2dos and dos2unix utils) and it doesn’t work. The error from --verbose is pretty unhelpful since it’s coming from an anonymous callback. I guess I’ll just wait until the CLI gets updated to be less obtuse - I was only updating a pre-existing library to the new libraries 2.0 format with no new functionality anyway.

Maybe @rickkas7 has some extra insight or other ideas what to try.
If there was an option to remove a private library I could give it a try with some other dummy name, just to check whether it’s a “local” thing or happens for me too (with your library) but since a lib once uploaded can’t be removed that’s not a clean option.

@jychuah, I’ve also commented on the GitHub issue, but the issue seem to be conflicting case between the public version 0.0.2 (ParticleFtpClient) and the version you tried to upload (ParticleFTPClient).
If you change the case in library.properties and all instances in the code files things should work out.

Changing the case in existing code is problematic as it would break existing code when you just update the library.
So best stick with the already published way of writing it ParticleFtpClient.

Could you please help me to upload this library to my project?

This is not in Community verified libraries and I would like to test it before.
I cannot understand how exactly it should be used.

How can I find this directory? I usually compile my firmware from the build.particle ide. Is there a way to add a library from there or do I have to use CLI? In this second issue, how?

Thank you!

The simplest way to test this is by adding extra files to your Web IDE project, name them as the original (if you get extra .cpp files you don’t need, you can just remove them by clicking the image), copy/paste the contents of the original file into the respective file tabs.

If needed adjust the #include statements to fit the - now flattened - project structure.

But since this library is rather hardware specific, I doubt it’ll work at all.

Thank you for your answer, ScruffR! I tried to do things like that but I receive a “there was an error saving firmware” when I try to verify that. I have two .h files and one .cpp file that recall both the .h files.
Do you know what could be wrong?
Thank you! :slight_smile:

No, I don’t know what you did wrong, but as said, that library won’t work on Particle devices.

Do you know if there is any library for frequency signals used in particle devices?

Do you think that trying to compile an hardware specific library that doesn’t fit particle hardware could be the reason for the problem I have?
I would have liked to adjust this one with particle micro timers, but don’t know if it’s so simple with my knowledge :confused:

If would not prevent the project from saving but only from building.

What exactly do you want to achieve with your project?
There might be much simpler ways to do it if you don't require all the features the library provides.

I'm trying to detect a vibration with an accelerometer. The accelerometer records any kind of movements but when the vibration (such as the phone ring would be) occurs the signal from the acceleration has a frequency >100Hz at least. So I'm trying to find a way to select this limit: when the frequency periodically goes up the 100Hz limit, I can push an event.
It would be simpler with a frequency signal analysis, but how can I reach this only using the signal in time?
If there were a way to measure the frequency from the period, it would be done.

Any kind of advice is welcome :slight_smile:
Thank you.