Author Topic: Kicad Library Table generator  (Read 23852 times)

0 Members and 1 Guest are viewing this topic.

Offline DJPhilTopic starter

  • Frequent Contributor
  • **
  • Posts: 511
  • Country: 00
Kicad Library Table generator
« on: January 13, 2014, 05:52:16 pm »
Hey folks,

I know I've been away a long time, but I thought I'd drop this here in case it proves useful to someone.

I use Kicad's testing branch and build from it fairly regularly. In the most recent pull I've done they have switched footprint and module management to a Library Table system. This is progress, but it's kind of kludgy at the moment. It uses a file called "fp-lib-table" to store a list of module libraries. There's no automated way to populate the Library Table with entries at the moment.

I made a quick and dirty bash script to generate a starter file so folks can get up and running quickly. Rename it with an .sh extension, make it executable with "chmod a+x tablegen.sh", and drop it into a directory full of module libraries. Upon execution it'll generate an fp-lib-table file containing all the .mod files in the directory, which should then be dropped into your home directory (as far as I know).

Windows users with some programming savvy should be able to work out an equivalent.

I'm no programmer, but maybe this will help folks who would otherwise be brought to a full halt.
 

Offline johansen

  • Frequent Contributor
  • **
  • Posts: 977
Re: Kicad Library Table generator
« Reply #1 on: January 28, 2014, 12:11:56 am »
correct me if i'm wrong but a recent update auto populates the library table, at least for the included libraries..
not your own.
 

Offline firewalker

  • Super Contributor
  • ***
  • Posts: 2450
  • Country: gr
Re: Kicad Library Table generator
« Reply #2 on: January 28, 2014, 08:11:59 pm »
Any idea how to add the online *.pretty git repos?

Alexander.
Become a realist, stay a dreamer.

 

Offline johansen

  • Frequent Contributor
  • **
  • Posts: 977
Re: Kicad Library Table generator
« Reply #3 on: January 30, 2014, 04:28:09 am »
Any idea how to add the online *.pretty git repos?

Alexander.

GIT Clone
http://git-scm.com/docs/git-clone

in any case, once you download the libraries you have to add them to the kicad library table. which i haven't figured out how to do yet, so i'm waiting for someone else to figure it out, being in the middle of other non electrical projects right now.
 

Offline firewalker

  • Super Contributor
  • ***
  • Posts: 2450
  • Country: gr
Re: Kicad Library Table generator
« Reply #4 on: January 30, 2014, 06:53:03 am »
Every component family is a different git repos. Someone must clone ~50 git repos. I read to their email list that there is a way to put the git repository directly to the table and it will fetch it for you. But it doesn;t say how to do so.

Alexander.
Become a realist, stay a dreamer.

 

Offline DJPhilTopic starter

  • Frequent Contributor
  • **
  • Posts: 511
  • Country: 00
Re: Kicad Library Table generator
« Reply #5 on: January 30, 2014, 09:13:37 am »
I've been super busy with work lately, so I haven't dug back in to KiCad since I posted this.

Sounds like you guys are way ahead of me, as I've no idea about repo support. I wish I could be more help.

I'll post back here if I make any other related and useful discoveries. I imagine that it'll all get hacked out in short order and will render this thread moot.
 

Offline djsb

  • Frequent Contributor
  • **
  • Posts: 886
  • Country: gb
Re: Kicad Library Table generator
« Reply #6 on: February 09, 2014, 06:28:46 pm »
Any chance of a step by step tutorial on how to set the library table up under windows? The linux version does all this automatically and all the github footprints are available. The pcbnew.pdf help document is of little help and very confusing.

I've set up the KISYSMOD global path variable pointing it to where my modules/footprints are and I've set up a KIGITHUB global path variable to https://github.com/kicad.

I don't know how to use the fp-lib-table.for-legacy,fp-lib-table.for-pretty and fp-lib-table.for-github files that I have moved from the templates directory in my kicad installation directory to C:\Documents and Settings\David\Application Data\kicad. Is this directory even my HOME directory?
There is NOTHING listed in my PCB library tables dialog. Can ANYONE help me to get this sorted out? Thanks.

David.
« Last Edit: February 09, 2014, 06:37:50 pm by djsb »
David
Hertfordshire,UK
University Electronics Technician, London PIC,CCS C,Arduino,Kicad, Altium Designer,LPKF S103,S62 Operator, Electronics instructor. Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. Credited Kicad French to English translator.
 

Offline Samah

  • Newbie
  • Posts: 2
  • Country: es
Re: Kicad Library Table generator
« Reply #7 on: February 14, 2014, 04:28:32 pm »
I've copied the fp-lib-table.for-github to "C:\Documents and Settings\MYUSER\Application Data\kicad", and renamed the file to "fp-lib-table" . I  have not set up the windows environment variable KGITHUB, please note that it's already set up inside the file "RunKicad.bat":

Code: [Select]
REM Tell PCBNEW where to look on github when using the github footprint
REM libraries
SET KIGITHUB=https://github.com/KiCad

This way, for me it's working without problem. My Kicad revision is 4695. I hope this can help you a little.

Samah
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17729
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Kicad Library Table generator
« Reply #8 on: February 15, 2014, 09:04:06 pm »
aha that seems to work for me now, so what is happening, are the footprints being accessed from the internet now ? does it mean that if they change the online footprints it can screw up a design ?

I tried pointing to my old kicad libraries but it would not work.
 

Offline firewalker

  • Super Contributor
  • ***
  • Posts: 2450
  • Country: gr
Re: Kicad Library Table generator
« Reply #9 on: February 15, 2014, 11:59:28 pm »
Info: Someone has to enable git module before building,  in order to use git repos in fp-table.

cmake -DBUILD_GITHUB_PLUGIN=ON

Alexander.
Become a realist, stay a dreamer.

 

Offline Samah

  • Newbie
  • Posts: 2
  • Country: es
Re: Kicad Library Table generator
« Reply #10 on: February 17, 2014, 09:05:05 am »
Hi, Simon, if you want to use your local libraries, just copy the same way than before, the file "fp-lib-table.for-legacy" (IMPORTANT: This file contains the references to the NEW libraries, so if you want to use any older one, you have to edit/add lines and change the names at your convenience), and rename it like in my former post (please note that only one "fp-lib-table" file is needed/allowed).

Code: [Select]
(lib (name MY_NAME)(type Legacy)(uri ${KISYSMOD}/MY_LIBRARY.mod)(options "")(descr MY_DESCRIPTION))

After that, just don't forget to set the environment variable KISYSMOD, either globally in windows or editing the "RunKicad.bat" and adding this line, but pointing to the folder where your local libraries are.

Code: [Select]
SET KISYSMOD=X:/YOUR/LIBRARIES/FOLDER

I think you'll need to restart kicad to make it recognize the changes.

If you want to add another library (for example, a customized one) , i think you have to do it "by hand", just editing the file and adding it or through the Preferences menu.
It's very important to set up the plugin type to "Legacy" when you add the library, if i leave it in "kicad", it doesn't work for me, i don't know why.


And i agree with you, Simon, i'm a little concerned about if they change the footprints without notice and may screw up the designs, i think it's better to download the libraries to the hard disk and use them locally. If i want to update them,  i just have to download them again, not so very hard, i  think. And of course, this is a lot faster!  ;D

P.S. Sorry if my english sounds kinda strange, as i'm spanish  ::)

Samah
« Last Edit: February 17, 2014, 11:59:38 am by Samah »
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17729
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Kicad Library Table generator
« Reply #11 on: February 19, 2014, 10:26:04 am »
uh I've decided to give diptrace a go, I still think their part selection is a bit shit but it is more stable than kicad and can output 3D models which is a serious advantage when your working in a mechanical engineering company that doesn't understand electronics and it's design data.
 

Offline Frost

  • Regular Contributor
  • *
  • Posts: 170
  • Country: de
Re: Kicad Library Table generator
« Reply #12 on: February 19, 2014, 06:16:37 pm »
uh I've decided to give diptrace a go, I still think their part selection is a bit shit
but it is more stable than kicad and can output 3D models which is a serious advantage

That's the same reason, why I bought a diptrace starter licence last week :)
Diptrace can read dxf Files for the PCB borders and I hope that I am able
to import my parts as STEP files from the CAD tool with the Diptrace Beta version.

Before Diptrace I used Eagle for the PCB layout.
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17729
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Kicad Library Table generator
« Reply #13 on: February 19, 2014, 06:21:05 pm »
yes you can import from STEP files but you need to make sire that all of the axises of your model line up to the axises of the PCB footprint. I tried importing my own very nicely modelled SOIC8 package but it was 90 degrees out and the underside of the package sat on the board instead of the pins.

I'm going to try putting my parts into an assembly so that I can orient them in it's axises to agree with the diptrace footprint and then export to step/igs
 

Offline fs

  • Supporter
  • ****
  • Posts: 13
  • Country: ie
Re: Kicad Library Table generator
« Reply #14 on: March 13, 2014, 01:59:38 am »
(snip)
I made a quick and dirty bash script to generate a starter file so folks can get up and running quickly. Rename it with an .sh extension, make it executable with "chmod a+x tablegen.sh", and drop it into a directory full of module libraries. Upon execution it'll generate an fp-lib-table file containing all the .mod files in the directory, which should then be dropped into your home directory (as far as I know).
(snip)

I'm no programmer, but maybe this will help folks who would otherwise be brought to a full halt.

Thank you. 

I'm just on my first (gruelling) night trying out KiCad on OSX.  I've stumbled into several "packaging / installation" bugs already to do with missing files / config.  I'm up-and-running again, but I'm wondering if I too will end up defecting to diptrace (wheres that 'lite' version of Altium???).
 

Offline firewalker

  • Super Contributor
  • ***
  • Posts: 2450
  • Country: gr
Re: Kicad Library Table generator
« Reply #15 on: June 28, 2014, 10:07:12 am »
Is there a way to load a specific fp-lib-table file during startup (passing argumment, env var etc)? Not the ones located at %APPDATA%\kicad\ or ~/?

Alexander.
Become a realist, stay a dreamer.

 

Offline TaffyDownUnder

  • Newbie
  • Posts: 1
Re: Kicad Library Table generator
« Reply #16 on: July 28, 2014, 11:52:31 am »
I've started using KiCad again after a year or so away and this time on a Mac.  Thanks to this thread I'm making some progress. But I have some questions.

I used to keep my modules/libraries separate from the modules/libraries that came with KiCad. With the new fp-lib-table I'm not sure how to do this.  Can I edit the fp-lib-table and put in absolute paths to my modules?  Or is there a way to add another environment variable (or is there a standard one I should be using) that I can use?

Also in the cvpcb the KIGITHUB environment variable doesn't show up; I have used launchctl to set the environment variable.  Is there a way to check which flags the OSX version of KiCad I'm using was built with.  I got my version from here http://www.mdx4.org/ the one dated 2014-02-16.

Are there any pages I should be looking at about KiCad on OSX.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Kicad Library Table generator
« Reply #17 on: August 12, 2014, 08:54:39 pm »
I used to keep my modules/libraries separate from the modules/libraries that came with KiCad. With the new fp-lib-table I'm not sure how to do this.  Can I edit the fp-lib-table and put in absolute paths to my modules?  Or is there a way to add another environment variable (or is there a standard one I should be using) that I can use?

Yes, you can edit that table, which is what I did before someone on the Kicad mailing list posted a LaunchAgent script which set the relevant environment variables.

Quote
Also in the cvpcb the KIGITHUB environment variable doesn't show up; I have used launchctl to set the environment variable.


I don't use CvPCB, nor do I use the github stuff, but I suspect using a LaunchAgent plist will set it for you.

Quote
Is there a way to check which flags the OSX version of KiCad I'm using was built with.  I got my version from here http://www.mdx4.org/ the one dated 2014-02-16.

I honestly don't know, but recent bzr versions of Kicad build fine on OS X 10.9.4.
 

Offline jst

  • Newbie
  • Posts: 4
  • Country: de
Re: Kicad Library Table generator
« Reply #18 on: May 28, 2016, 07:17:30 pm »
Very helpful script!
I have edited the script for the new .pretty format.
 

Offline Thor-Arne

  • Supporter
  • ****
  • Posts: 500
  • Country: no
  • tinker - tinker, little noob.....
Re: Kicad Library Table generator
« Reply #19 on: May 28, 2016, 07:49:56 pm »
This thread is old. ;)

Current version of KiCad has a Footprint Wizard in pcbnew.
 

Offline timofonic

  • Frequent Contributor
  • **
  • Posts: 904
  • Country: es
  • Eternal Wannabe Geek
Re: Kicad Library Table generator
« Reply #20 on: May 30, 2016, 10:27:58 pm »
Nice! Ate there plans to have wizards? Are they going to be coded in Python? What about an extended Lua with Lua Rocks and Luvit?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf