Using Github libraries offline

Hi all,

All I wanted to do was save a local copy of the Github footprints and then use only the local copy from then on. (I have a horrible internet connection.)

This may seem obvious, but it took me a while to figure out. So for everyone out there here is what I did.

After a bit of poking around I found the “Footprint libraries wizard” under prefrences in PCBnew.

I thought this would solve my problem by just choosing “Save a local copy to:” and it does download all the modules but PCBnew still tries to fetch from Github on the fly.

The “fix” I finally found was to then delete everything in the libraries table (prefs, footprint library manager) and then add them all back with the “Files on my computer” option in the wizard.

Hope this helps.

I am using BZR 5925

3 Likes

You saved me some time my friend, these things seem trivial but can be easily overlooked.

Would not the best solution be to set up a local repository and use KiCAD and Git as intended to clone the Github repository and regularly pull updates? As in:

https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository

3 Likes

I deleted all the libraries in the fp-lib-table. But when i try the Footprint library Wizard, the next option is greyed out. what am i doing wrong here?

I downloaded and extracted the whole library repo from here: https://github.com/KiCad/kicad-library

I dont have option to use git as internet is not available on the kicad computer. I must download the files from elswhere and import them to kicad somehow… Its not working.

kicad-library/modules contains 3d models and other things, but does not contain the footprints, they are in several repositories named with the .pretty suffix.

To download them all, you can do the following :

  1. Select menu option Preferences->Footprint Libraries Wizard
  2. Select “github repository”
  3. Select “Save a local copy to”
  4. Click browse and select a new folder e.g. “c:\kicad\modules” (create folder if it does not exist)
  5. Click Next
  6. Click Select all
  7. Click Next
  8. Wait while libraries are checked
  9. There are two libraries that are marked INVALID, not sure why…
  10. Click Next
  11. Select “global library config”
  12. Click Finish
  13. Wait while libraries are downloaded.
  14. Check - open the Footprint Libraries Manager, you should have 76 libraries in the list with the local path specified.
  15. Close Kicad and restart

Hi bob,

I dint have option to use git on the computer with kicad. so your solution doesnt work for me. This one worked for me: Using KiCad 4.0.1 without internet

Yeah, you missed the point. The idea is you use Kicad to download to the internet PC. Then you have a set of files stored locally you can copy to a USB stick or something.

1 Like

Oh, you mean, have 2 Kicad instanes on online and offline PC… and just sync the files using USB stick on both the PCs… thats a good option, I shall use that for my next updates! Thanks.

Well, I’m a newby for KiCad too (using 4.0.5 on W10), and could not use any of the suggestions I found anywhere to make it work. I also could not really follow the first suggestion on this post, so tried a few things, and ended up making it work for me. It’s not obvious for newbies like myself, so maybe this helps others.

So yes, I did manage it, but with a twist. Not sure if it’s the right way, but at least its relatively effortless. This is what I did:

  1. Go to PCBnew and select from the Preferences menu, the Footprint Libraries Wizzard. Select Github Repository, and then browse to a common place on your PC. I selected C:\Users\Public\Public KiCad\LocalModules Hit Next, then Select all libraries, and click Next. After validating all the libraries, it will start to download all of them to the directory you just selected. This may take a while.

Here is the problem:
To force KiCad to select the data from the local libraries, I understand you have to put the local libs above those with the Github libs. Makes sense. However, this is excruciatingly difficult, because you can only do that one lib at a time, and you have to hit the “Move Up” key 90 times, for each lib. I also suspect that this list cannot be larger than about 100 entries, because if you try to append your 90 local libraries (next step), this does not get all the local libraries added, only 7. I tried various ways to no avail.

Solution:
2. Make a copy of the fp-lib-table that is located here
C:\Users{USERNAME}\AppData\Roaming\kicad
Call the file something like fp-lib-table-git. While you’re at it, have a look. It’s a text file (I suggest you use Notepad++) And yes, I tried adding the local lib references to this file, still no deal. It shows only about 100 entries.

In any case, this file contains a reference for all libraries and their source(s).
It should have been easy to just add the local library names and their location to this list, but I only managed to get 7 of the files I downloaded locally at the end of the list. As I said, also manually editing this file did not work.

  1. After you have made a copy of the fp-lib-table, we’re simply going to remove all references to the github list. Select from the Preferences Menu The Footprint Library Manager. You will see all libraries with their (Github) destination path. Delete all these libraries. Leave the dialog box open.

  2. Now we’re going to import the local libs. Select Append with Wizzard. Select Files on my computer. Hit Next, locate the libs, select all of them, etc. and off you go. All local libs are now in the KiCad system. Click OK and you’re done.

  3. To be on the safe side, make another copy of the updated fp-lib-table file, and call it something like fp-lib-table-local.

Note If libraries change online, you need to probably go through the same exercise to get your local libs updated.

If there is a better way, please make sure people can find it !
Enjoy!

Ever tried selecting that button once with your mouse (i.e. clicking it) and then resting one of your fingers on the [ENTER] key?

:sunglasses:

1 Like

paulv,

The reason that the “NEXT” button is grayed out is because there are a few files in the list of 100-or-so downloaded library folders that are not compatible.

I found that if I hold down the CTRL key and select each library folder one at a time and watch the next button you will see it go normal and then if you click on an incompatible folder it will gray out again. So just keep holding the CTRL button and de-select that folder and the NEXT button should go normal again… keep selecting all the folders till you get to the end and you can then hit “NEXT” and Kicad will validate all the selected folders and import them and you will be good to go.

It is little (BIG STUMBLING BLOCKS) like this that are so damn irritating for anyone trying to learn and use Kicad.

It really is a great program and works a treat once you stumble around and figure out the libraries, etc.

hope this makes sense and helps.
regards
dwight

1 Like

:nerd_face: Got it. I was trying to make a point about the silliness of the procedure. Selecting a list of multiple libs (click-shift or click-ctrl) and moving them as a group would help, but only if the apperant limit of 100 libs is removed.
I have difficulty to believe that this is the intended way. Joan, there must surely be a better method? How/where?

Dwight, I am not sure I can follow you.
I did not experience your described situation with a greyed out Next button.

All the current (Github) libs deleted OK, the new libs downloaded OK, and they all seemed to have passed the validation check (no errors reported) when imported, and they all seem to be OK and ready to use from within KiCad, although I did not check them all out. Did/do I miss something?

Why keep the github libs in there?

With your local libs before the online ones you’re NEVER going to load them automatically.
If you want them, you have to do it manually. So what is the point in keeping them in the list and forcing KiCAD to check them each time you launch it (which just slows down everything)?

The official way to use the github online libs offline is described by @bobc up there.

What problem did you encounter with that procedure?

@keruseykaryu did describe that process in the past as well.

1 Like

I think some confusion may have crept in here, that advice is good for schematic libraries, but does not make sense for footprint libraries. Probably, you should not be allowed to enter two libraries with the same nickname, but never mind.

The recommended approach is to delete the github entries if you do not intend to use them, moving them is not necessary, which is what you have discovered.

My current faq entry looks like this:

How to install local Footprint libraries

(Tested with Kicad 4.0.2)

Using KiCad:

N.B this gets latest footprints from github, may be incompatible with your currently installed data.

  1. Start Kicad
  2. Open pcbnew
  3. Select menu option Preferences->Footprint Libraries Manager
  4. Delete all the libraries in the Global Libraries list
  5. Click “Append with Wizard”
  6. Select “Github repository”
  7. Enter “https://github.com/KiCad
  8. Select “Save a local copy to”
  9. Click browse and select a new folder e.g. “c:\kicad\footprints” (create folder if it does not exist)
  10. Click Next
  11. Click Select all
  12. Click Next
  13. Wait while libraries are checked
  14. (some libraries may be marked INVALID, not sure why…)
  15. Click Next
  16. Select “To global library configuration …”
  17. Click Finish
  18. Wait while libraries are downloaded.
  19. Check - open the Footprint Libraries Manager, you should have about 84 libraries in the list with the local path specified.
  20. Click OK
  21. Close Kicad and restart
  22. Note: KISYSMOD will still show default location, this does not matter.
3 Likes

Thank you for making it more clear, I got it. Unfortunately, the information is still not easy to find, maybe this should be part of the installation procedure or getting started tutorial?

In this case, wouldn’t you still have to delete all of the stuff in the tables anyway in order to make the new local repository the primary library?

Jup. You don’t need both. (You could also edit each entry but deleting everything and adding is faster.)

1 Like

I need to use KiCad offline because of proxy in our LAN.
I follow your “faq”, I copied all “pretty” libraries in /usr/share/kicad/modules/ then I “validated” all them and added. In Cvpcb not all libraries are available even if they’re present and plenty of footprint. As an example I don’t see any footprint in Capacitor_THT and TO_SOT_Packages_THT.
I can see and use packages in Resistors_THT instead.
Any hint?
I need urgent help because I would use KiCad in my school lab with my students but using it without internet is very difficult.

OpenMandriva Linux 64 bit, KiCad 4.05.

Do you see the libs in the leftmost column in cvpcb? If so make sure your filters are set correctly.
If not add the libs to the fp-lib-table using the lib wizard. (Make sure they are added to the global lib not to the local lib of some other project.)