Github footprints problem

KiCad 2014 is now quite old, and a new stable version has been released since:

You should really consider updating, that’s where you will get the most support.

OK, have 4.0.1 now and see the option. Stable doesn’t seem very stable though… In the path prefs I have these settings:

KIGITHUB   https://github.com/KiCad
KISYS3DMOD /Library/Application Support/kicad/packages3d 
KISYSMOD   /Library/Application Support/kicad/modules

Creating schematic is OK but when I try to run CvPcb it just hangs. Am I understanding that KIGITHUB var should be changed to be same as KISYSMOD? I’ve tried that too and it’s still hanging.

With grain of salt:
Those paths looks alright, I think you have a problem in the fp-lib table, which builds up on those paths and tries to access libraries that don’t exist anymore…
In Windows 7 it’s located here:

C:\Users\JohnDoe\AppData\Roaming\kicad\fp-lib-table

Check it’s content and see if you can find the libraries listed there with your internet browser. Any 404 message means, you should remove that entry from the fp-lib table… or run with local libs like I do (just remove all internet links in that file and replace them with paths to local libs):

(fp_lib_table
(lib (name SMDx)(type KiCad)(uri E:\Data_KiCAD_KiCAD_Footprints\SMDx.pretty)(options “”)(descr “”))
(lib (name OLD_Footprints)(type KiCad)(uri E:\Data_KiCAD_KiCAD_Footprints\OLD_Footprints.pretty)(options “”)(descr “”))
)

OK, finally got the local libraries working. Here’s how I did it on OSX:

  • Deleted all previous traces of KiCad, including
    • /Library/Application Support/KiCad
    • ~/Library/Application Support/KiCad
    • brew uninstall kicad-library
  • Installed KiCad and KiCad Extras binaries
  • Edited fp-lib-table in /usr/local/Cellar/kicad-library/library (Does OSX install rely on brew? Not sure why table is in there)
    • Changed everything like this: (lib (name Air_Coils_SML_NEOSID)(type Github)(uri $(KIGITHUB)/Air_Coils_SML_NEOSID.pretty)(options "")(descr HAMxx31A_HDMxx31A))
    • to: (lib (name Air_Coils_SML_NEOSID)(type KiCad)(uri "$(KISYSMOD)/Air_Coils_SML_NEOSID.pretty")(options "")(descr HAMxx31A_HDMxx31A))

CvPcb is now working but not yet Pcbnew. Can’t find the footprints still:
Error: No footprint defined for component 'D3'.

Info: Checking netlist component footprint "D3:/56A24047:". Error: Cannot add new component "D3:/56A24047" due to missing footprint "".

I’ve run the Footprints Library Wizard and added all local modules. Getting close though. Thanks for all the help so far.

EDIT: Stranger still, in Pcbnew I can clearly see the footprints in the footprint viewer. But I see no .cmp file is getting produced when I save CvPcb. That’s probably the problem, but I dunno why it’s not saving.

With 4.0.1 it looks like footprint information is in the .net netlist, like so:

(footprint Resistors_SMD:R_0805)

Ah, I see. Oh and now it works. Didn’t do anything special I don’t think. Anyway, just happy I can carry on. Thanks.

“I think that instead of this solution you should remove all references to kicad github libraries from your fp-lib-table and use only libraries stored on your hdd or your own git”

Well, exactly.

“Well, the idea is that you always get up to date footprints, if there is an error in a footprint it gets fixed.”

Noooooo! This may be fine for hobbyists, how do I completely remove this functionality? It is completely unacceptable to have a design that can change out from under me, for -any- reason at all.

Is it as simple as removing any references to GitHub in those fp-lib-table* files? Are there other places where GitHub access is either hard coded, or where in can be disabled in a config file?

I didn’t even know it was accessing external resources until I did an annotation and it couldn’t parse something it got off GitHub that had broken. Totally unacceptable.

Actually, one thing further: This completely the wrong way to use Git.

If you want to have GitHub as a master repo for libraries, then you should always clone to a local copy. The program can keep libraries in sync. Then you simply keep a changeset number with the part instance(s) in the layout. When upstream changes, the user can be prompted, but the editor itself never never accesses the repo (except to do that pull, which you can give the user a few choices of auto, or fully manual).

This is what distributed version control is all about (it’s not just a better CVS) but I’ve seen so many people misunderstand this, and work directly on/in GitHub. They miss the distributed part.

1 Like

The footprints you use in a design are not updated automatically. They are copied into the header of the pcb_new file. You need to trigger the update of footprints in a design or add new footprints to it to get new files from github.
But if you make a new design, new footprints are used which means that it can happen that a footprint you successfully used in one design suddenly has problems in a new design.
This is why it might be a good idea to use the kicad libs only as a starting point for you personal verified library.

Kicad does not really use git. It uses the github api do download a zip archive. Don’t ask why. (I think @SchrodingersGat mentioned that someone in the development team is quite attached to the github plugin. A real git plugin would be nice.)

2 Likes

It is completely unacceptable to have a design that can change out from under me, for -any- reason at all.

This.

A real git plugin would be nice

That.

1 Like

The git part is easy. I’m still trying to figure out what cvpcb is trying to do.

Where do the various programs get and store their information that appears to be contained in fp-lib-table? Does it make a copy in the project directory? Is it stored in some .config somewhere?

Someone said that the developers have a hard time with the Mac platform. Is there somewhere special this information is stored because I’m using a Mac?

Here is what I’m trying to do:

  • Clone the repos to /Library/Application Support/kicad/library-repos I did this by neutering the script that someone put together. The result is as expected

  • Make a symlink from library to library-repos

  • move the fp-lib-table.* (which only appear in templates?) to a directory as backup locatoipn

  • copy (only) the .pretty version to templates fp-lib-table

The result on creating a project is

  • All sorts of missing library errors

  • PARSE_ERROR: Expecting ‘’)’’ in input/source ‘https://github.com/KiCad/Housings_BGA.pretty’ line 2 offset 19 from /Users/ansible/4.0.6/kicad-mac-packaging-4.0.0/kicad/common/dsnlexer.cpp : Expecting() : line 361

Which is what I started out this mess trying to solve. Removing the offending library from fp-lib-table and making a new project doesn’t solve this. Therefore, the question at the top stated another way: Why is this information about the BGA library persistent?

I think that footprints downloaded from github are stored in memory, I can’t find any disk cache.

Not sure what is going there, it looks like it is trying to parse a folder as a file. Slightly confusingly, the “KiCad” Plugin type field in fp-lib-table means a pretty folder on disk, “github” means a zipped pretty folder retrieved directly from github (to memory?). If you have pretty folders on disk, you should be using the “fp-lib-table-for-pretty” as a template.

Yeah, I couldn’t find anywhere it was storing anything either, which is why I asked.

As for the parse error, it did that before I started hacking on this, with a fresh install from the latest official OS X disk images. It isn’t new or a result of anything I did. The larger problem, perhaps, is actually that… nothing I do affects this error, so that means I’m still not understanding where either the library config or cache is!

A clean install may not overwrite the gobal fp-lib-table if there is already one present. The only other place it could be is in a project specific fp-lib-table. Exactly when do you get the error? What do the other errors look like?

I think if there was a general bug with 4.0.6 on MacOS, someone would have reported it, but I guess you may be the unlucky pioneer.

On windows there is a user folder for application settings where KiCAD stores all it’s stuff, inclusive this global fp-lib-table file.
The one in the program folder under templates is not being used in my experience.

So others don’t have to go looking… On OS X there is one in your Users directory, specifically: ~/Library/Preferences/kicad/fp-lib-table This is likely copied from the /Library/Application\ Support\kicad\template\fp-lib-table (note no ~ this is the globally installed copy) when first run, but I don’t see what triggers it to be updated.

There are no more copies of fp-lib-table that I can find. This is the copy CvPcb uses, and since it appears the code is common likely everything else…

1 Like

IMHO
If you open PCBnew or the FP editor and under

Preferences>LibraryManagementXYZ

you choose to use the Wizard to append libraries (either via this button)

or directly via the preferences menu, there should be an automatism there that will scourge the KiCAD github repo for footprint libs and put them into that list.
If you want to start fresh - remove all libs in there beforehand.

If you run local libs, you don’t want to do that, unless you want to run the github libs locally, then follow @bobc 's guide on that.
In all other cases, you modify the fp-lib-table filer either in above dialog your self (and set it up to look on your harddrive for your local self-managed libraries) or you edit it outside of KiCAD with a text editor.

PS: as you can see, I run them locally, using the KISYSMOD environment variable, pointing at a folder on my E: drive. All libs then use this varaible as part of the path and are located there.
If I use another computer, I can move the whole lot and just change the path variable and be done.

1 Like

No. Of course I can use the GU and cause it to find the librariesI, but I don’t care if I can do something that way. I have to be able to find where that information is stored, how it gets its defaults, what uses it, when it is updated and why.

This is just table stakes for using this tool in a work environment. The library issues have stopped our evaluation of this tool as is, and I have moved on to trying to figure out what it would take to clean up things like this. The problem is, it appears to actively be moving in the wrong direction… it is actively trying to do nonsense on GitHub and force the use of preinstalled libraries… that is fine for a toy but not for real work.

The code is not very complex, it should be easy to fix and add proper functionality for repositories. But my concern is as was pointed out

I’m not interested in doing the work if it isn’t going to go upstream. Let’s see if I can figure out what is really going on with all these paths, variables, tables and ‘plugins’, and how much actual work it would be to really make it rational (that is, not lead to nasty surprises) and functional (that is, actually provide versioned, repo backed library management) first…

In that case I’d suggest get in contact with the developers on the mailing list or IRC.
They will be able to pinpoint you most exactly to what/where to look.
Especially if you want to have this included in future versions.
I’m just a user who moderates a bit here on the forum.

PS: we had someone on the forum some time ago that did set up a classroom environment for KiCAD. But I don’t think he was using KiCAD for the repo/versioning, rather external tools.

PPS: if you really going to introduce versioned repo backed library management you definitely have to get in contact with the developers.

1 Like

This issue was due to a faulty footprint in github library

The reason the problem persists after a re-install, is because the online libraries were still being used.