Help with tstamp value in footprint library files

Hi all, sorry for my bad language… I’m very new to Kicad. I would like to make a bash script that helps me to create dynamically some libraries of connectors. I have made a connector of 2 pins and another one with 3 pins, I have opened the files and I have seen that is simple to continue the series with a script that generates all the files dynamically without the editor. I have only a problem with the “tstamp” value, I don’t know how to generate it.
Example:

2 PIN
(fp_rect (start -1.85 -3.5) (end 5.35 3.5) (layer "F.SilkS") (width 0.12) (fill none) (tstamp 2e5bc288-17c8-49e5-b46b-145030236d60))
  (fp_rect (start -1.95 -3.6) (end 5.45 3.6) (layer "F.CrtYd") (width 0.12) (fill none) (tstamp 8b27eec4-0a1c-4bb7-9862-97051ab9ba69))
  (fp_rect (start -1.75 -3.4) (end 5.25 3.4) (layer "F.Fab") (width 0.12) (fill none) (tstamp 046db72a-11cf-4a78-a04d-5d7a2f30a1e1))
  (pad "1" thru_hole roundrect (at 0 0) (size 1.34 2.68) (drill 1.09) (layers *.Cu *.Mask) (roundrect_rratio 0.45) (tstamp ca018f44-972d-4483-965b-00cc1c25bcd5))
  (pad "2" thru_hole roundrect (at 3.5 0) (size 1.34 2.68) (drill 1.09) (layers *.Cu *.Mask) (roundrect_rratio 0.45) (tstamp 35320c85-bd8c-4804-b5a6-e0be56b15352))

3 PIN
(fp_rect (start -1.85 -3.5) (end 8.85 3.5) (layer "F.SilkS") (width 0.12) (fill none) (tstamp 2e5bc288-17c8-49e5-b46b-145030236d60))
  (fp_rect (start -1.95 -3.6) (end 8.95 3.6) (layer "F.CrtYd") (width 0.12) (fill none) (tstamp 8b27eec4-0a1c-4bb7-9862-97051ab9ba69))
  (fp_rect (start -1.75 -3.4) (end 8.75 3.4) (layer "F.Fab") (width 0.12) (fill none) (tstamp 046db72a-11cf-4a78-a04d-5d7a2f30a1e1))
  (pad "1" thru_hole roundrect (at 0 0) (size 1.34 2.68) (drill 1.09) (layers *.Cu *.Mask) (roundrect_rratio 0.45) (tstamp ca018f44-972d-4483-965b-00cc1c25bcd5))
  (pad "2" thru_hole roundrect (at 3.5 0) (size 1.34 2.68) (drill 1.09) (layers *.Cu *.Mask) (roundrect_rratio 0.45) (tstamp 35320c85-bd8c-4804-b5a6-e0be56b15352))
  (pad "3" thru_hole roundrect (at 7 0) (size 1.34 2.68) (drill 1.09) (layers *.Cu *.Mask) (roundrect_rratio 0.45) (tstamp ??????????????????????))

How I can generate the tstamp value?

The timestamp value is the number of seconds since 1970-01-01 UTC in hexadecimal, viz Unix seconds.

Hmm I see that field isn’t a timestamp now. Some discussions back it was a real timestamp. Maybe that was in v5.

As you were.

Timestamp is a bit of a misnomer. It’s a left over from some KiCad versions ago. A better name would be UUID and there are libraries for generating those. If you ask me, KiCad is going a bit over the top with UUID’s lately. Every line segment, label, dot and other graphical item is getting them these days. The UUID is important for matching the schematic symbol with the PCB footprint (both must have the same UUID). For most other purposes, the UUID’s are (mostly?) optional. Most of the UUID’s can simply be omitted (although I’m not quite sure which of them are important). If the UUID’s are “missing”, then KiCad can often generate them itself wherever it thinks they are needed.

Also, if you like bash scripts:

paul@cezanne:~$ sudo apt install uuid
[sudo] password for paul:
Reading package lists… Done

paul@cezanne:~$ uuid
11da20dc-087a-11ed-afd2-cf58134e8fe3

1 Like

Thank you very much my friends… I will make a bash script and some tests

If you’re generating UUIDs from a language other than shell, e.g. Python, there certainly will be libraries for it. No need to invoke a process for each instance.

1 Like