PlatformIO Community

I am having trouble with a GitHub library


#1

I am having trouble with a GitHub library. Can I create a fork and use that?


#2

Sure, nothing to stop you doing that! Either maintain your own forked version, and import it via

#pick one only
lib_deps = 
   #https://github.com/username/repo.git #url
   #username/repo #github shorthand

Or make the changes, and see if the origin library will accept the changes as a push request if it’s a bug or missing feature. Otherwise, you’ll want to update the library.json details so that it has your name as the maintainer, correct repo url, etc, and then register the library if you want it to be available via the library manager.


#3

I forget that REPLYing by email does not do anything.

That worked and some errors were corrected. The library.properties file at GitHub has been updated with a new version number and maintainer. Now I need PlatformIO to refresh, but the URL has not changed. The changes in the repository have not gotten to PlatformIO.

I have now gotten PlatformIO to find my reupdated personal version of the registered PID library. I had to change the repository name. There must be an easer more direct way.


#4

What were you expecting to change (I’m just unsure as what you mean by the changes have not gotten to PlatformIO)? The original library listed on the platformio library manager isn’t going to change as you are not the author of it. If you have registered the new forked library with platformio, it should become available somewhere within 24 hours (as the library scraper runs every 24 hours or so)…


#5

Yes. Thank you. I under stand your confusion. I have other posts at Arduino. Other details are there. I will tell a more complete story from here from the begging.

My balancing robot project is to use the MakeBlock build and firmware. The firmware uses one PID for speed and another for angle. I am exploring the Arduino PID library by Brett Beauregard. It installs with

>platformio lib install PID

It is activated with
image

MakeBlock and Brett are doing the same thing and using the same variable name. Namely “PID”. So, to just INCLUDE the library causes 100 errors. I can change all of my 100 variable names in old code or change the library for code that has not been written yet. So, I forked Brett’s library and changed all instances of PID to PID2. To use my personal version of the library I

lib_deps =
https://github.com/clplaneguy/MakeblockPID

the library link works, but I did not rename all the "PID"s. So, I found the rest and updated the names. My library is not official and is not registered. So, how do I get PlatformIO to use the new version of my persional library? So, I changed the repository name to MakeblockPID2 and platformio.ini

image

I would think that there a more direct way to get the new changes to PlatformIO than to change the repository name.


#6

Ah… that makes sense now. So, if you make the changes on GitHub, you want to know how to get that to update locally? I suspect that if the library manager checks for updates, it would look for version number changes in the library.json to indicate that there is a new version of the library. Otherwise, it would be a matter of using the terminal in the IDE to navigate to the .piolibdeps folder, then your MakeblockPID, and then do a git pull to pull any updates/changes.

i.e. something like (note the leading full stop/period on piolibdeps)

cd .piolibdeps
cd MakeblockPID
git pull