nightshade-electronics / energyShield2

Arduino library for the NightShade Electronics energyShield 2 Pro
https://ns-electric.com/product/energyshield-2/
MIT License
0 stars 1 forks source link

No library.properties file for EnergyShield2? #2

Closed nitramor closed 5 years ago

nitramor commented 5 years ago

I'm fairly new to Arduinos, so this is likely some oversight on my part, but I've been unable to add the energyShield2 libraries onto the Arduino IDE. I'm getting an error that the library.properties are not found. Reading up on this issue a bit, the newer library spec requires this metadata file to be included. Please let me know if I should be looking for a different issue.

From Arduino:

The most significant addition to the format is the ability to add information about the library itself through a properties file called library.properties.

This file allows the Library Manager to search and install a library and its dependencies in an easy and automated way. It must be located in the root of the library folder.

library.properties file format The library.properties file is a key=value properties list. Every field in this file is UTF-8 encoded. Unless noted otherwise below, all fields are required. The available fields are:

name - the name of the library. Library names must contain only basic letters (A-Z or a-z) and numbers (0-9), spaces ( ), underscores (_), dots (.) and dashes (-). It cannot start or end with a space, and also it cannot start with a number. Note that libraries with a name value starting with Arduino will no longer be allowed addition to the Library Manager index as these names are now reserved for official Arduino libraries. version - version of the library. Version should be semver compliant. 1.2.0 is correct; 1.2 is accepted; r5, 003, 1.1c are invalid author - name/nickname of the authors and their email addresses (not mandatory) separated by comma "," maintainer - name and email of the maintainer sentence - a sentence explaining the purpose of the library paragraph - a longer description of the library. The value of sentence always will be prepended, so you should start by writing the second sentence here category - (defaults to Uncategorized) if present, one of these: Display Communication Signal Input/Output Sensors Device Control Timing Data Storage Data Processing Other url - the URL of the library project, for a person to visit. For example, the library's GitHub page. This is used for the "More info" links in Library Manager architectures - (defaults to ) a comma separated list of architectures supported by the library. If the library doesn’t contain architecture specific code use to match all architectures. This field is used as one factor in determining priority when multiple libraries match an #include directive and to provide a warning message when the library is compiled for a board of an architecture that doesn't match any on the list. dot_a_linkage - (available from IDE 1.6.0 / arduino-builder 1.0.0-beta13) (optional) when set to true, the library will be compiled using a .a (archive) file. First, all source files are compiled into .o files as normal. Then instead of including all .o files in the linker command directly, all .o files are saved into a .a file, which is then included in the linker command. 1.5 format library folder structure is required. includes - (available from IDE 1.6.10) (optional) a comma separated list of files to be added to the sketch as #include <...> lines. This property is used with the "Include library" command in the IDE. If the includes property is missing all the headers files (.h) on the root source folder are included. precompiled - (available from Arduino IDE 1.8.6/arduino-builder 1.4.0) (optional) set to true to allow the use of .a (archive) and .so (shared object) files. The .a/.so file must be located at src/{build.mcu} where {build.mcu} is the architecture name of the target the file was compiled for. Ex: cortex-m3 for the Arduino DUE. The static library should be linked as an ldflag. ldflags - (available from Arduino IDE 1.8.6/arduino-builder 1.4.0) (optional) the linker flags to be added. Ex: ldflags=-lm Example:

name=WebServer version=1.0.0 author=Cristian Maglie c.maglie@example.com, Pippo Pluto pippo@example.com maintainer=Cristian Maglie c.maglie@example.com sentence=A library that makes coding a Webserver a breeze. paragraph=Supports HTTP1.1 and you can do GET and POST. category=Communication url=http://example.com/ architectures=avr includes=WebServer.h

aliebold commented 5 years ago

Hi Ross,

I suspect the problem is that the library folder is still nested inside the GitHub folder (energyShield2-master). Make sure that you only put the NS_energyShield2 folder into the Arduino/libraries folder, where your sketches are stored. I've had this issue myself. Be sure to restart the Arduino IDE after making the folder change.

Let me know how it goes.

Best regards, Aaron

nitramor commented 5 years ago

Thanks for your prompt reply!

I ended up being able to load the library using manual extraction following the instructions provided by Arduino. But I could only do this on the Arduino IDE application, not the online tool. It looks like the online editor (which I prefer) doesn't accept custom files unless they include the library properties. Seems like an easy thing to add.

So if I were guessing what a library.properties file would look like for this library, it would be:

name=NS_energyShield2
version=1.0.0
author=Aaron Liebold <aliebold@ns-electric.com>
maintainer=Aaron Liebold <aliebold@ns-electric.com>
sentence=A library for the energyShield 2 lithium ion battery shields by NightShade Electronics. 
paragraph=The energyShield 2 library provides software functions that allow the user to easily access all of the energyShield's advanced functionality. This functionality comes from the energyShield's integrated battery fuel gauge, real-time clock, solar input regulation, and voltage measurement ability. Buy the energyShield 2 at NightShade Electronics' online store: https://ns-electric.com/shop/
category=Other
url=https://github.com/nightshade-electronics/energyShield2
architectures=*
includes=NS_energyShield2.h, NS_eS2_Utilities.h

I don't know the architectures your support, so the "all of them" option is "*".

Just went to the trouble of creating the file and tried loading it onto the online editor and it worked! If you let me upload it to this github repository, it would be my very first commit! At almost 55, who says you can't teach an old dog new tricks?

Btw, you'll like this: I will be using your energyShield 2 Pro in my one-man musical, Miss Isabella Rainsong and Her Traveling Companion: A One-Guitar Show. It's about a guitar that rehabs people while riding Amtrak all across America. I'm building an Arduino inside the RainSong (carbon fiber) guitar that is my co-star in the show. I'm using the Arduino to run the DMX lighting and MP3 audio queues from the stage so I can truly do the show as a solo effort. Up to now, I've had to have two people running lights and sound. I'm excited to be able to take this show on the road, packing up everything I need in the trunk of my Outback and being able to set up everything -- stage, lighting and PA -- within two to three hours.

I was up until about 3am last night adding the shield to the mix. Worked great running the audio! Now I have to add back the lights and see if all of it can work together with no conflicts. This, for me, is the trickiest part as I find the stacking of shields (I'm using three: your battery, a DMX master by Tinker, and the Adafruit MP3 Music Maker) and weeding out of the incompatibility issues. Never been an electronics dude before (or a real programmer), so I'm learning along the way. It has been a fascinating journey.

Check out the show at www.MissRainsong.com -- you can stream the music there and read the backstory. The companion CD just came out last month and still has that new CD smell. ;-)

Thanks again for the help. I'm amazed at the generosity of the open source community. I've been donating music via open source licenses for years, but this coding community really gives me hope for the future.

Regards,

Ross

aliebold commented 5 years ago

Hi Ross,

No problem.

Wow! Nice job. I guess I need to update the library to hold to the newer standards. Go ahead and push that file to the library and I’ll start there.

Your show sounds pretty great. Let me know if you ever make it to the Space Coast area of Florida. I’m sure my wife and I would enjoy it.

I don’t expect an compatibility issues with your setup. It looks like the DMX is actually controlled from the Arduino’s I2C bus, as is the energyShield. But, it is unlikely that the DMX protocol will interfere with any of the ICs. If you do have a problem, just most the one of the shields to a software I2C on different pins.

Let me know how it goes and if you have any problems! I’ll look for your push to the library.

Best regards, Aaron Liebold

nitramor commented 5 years ago

You have to give me upload access in order to add the file. Can you do that so I can have my first "commit"? If it's a hassle, no worries. Just add the file I attached earlier to the library zip.

aliebold commented 5 years ago

I mis-spoke. What I would like you to do is create a Pull Request. You submit your changes to the library and request that I pull them into the master branch. You already have the permission to do that.

https://help.github.com/en/articles/creating-a-pull-request

Aaron Liebold

nitramor commented 5 years ago

Just added a fork and sent the request to merge with the new library.properties file. If you see anything you need to change, please do so! Thanks for your help today! It's been very educational!

aliebold commented 5 years ago

I just pulled in your commit. It looks great! I also restructured the library so that it conforms to the new standard. You might want to pull it into your project again.

Good luck with your project! I hope things work out for Miss Rainsong. ;-)