-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SKiDL BUG]incompatable with latest KiCad v7 #179
Comments
A workaround to this F0 error is to manually download v6 Schematic symbols here, and set $KICAD_SYMBOL_DIR to location of this v6 Schematic symbols |
That worked here. skidl latest with kicad-7.0.2, but this does not fix #180 |
I am trying to check #182, most things seems to be handled there, just not sure. Even when changing "F0" to "Reference" will allow parts to load, there is more error/s in 'getattr'. when debugging
|
Which version of SKiDL are you using? Is it 1.2.1 from PyPi? I would suggest trying the development version: pip install git+https://github.com/devbisme/skidl@development The development version includes some new code for handling KiCad 6 and 7. It's not quite ready for release. For one thing, it needs documentation. You have to use set_default_tool(KICAD7) Send me the code causing the problem and I'll try it out. |
Hello, I have installed the development version of SKiDL as described above but the KICAD7 name is not defined. |
My apologies! When I finally got around to checking this, I found I'd failed to push the development branch to Github! I've done that, so give it a try and we can move on to whatever problem comes next... |
I installed the development version, set
|
This problem occurred because I erroneously referenced KICAD6 in the KICAD7 library parser. I fixed it in the development branch. Give it a try and see if it works for you. |
Hi @devbisme! I tried the updated version and the error is the same, although it is in the kicad7/lib.py now 😅
|
KiCad 7 introduced a new pin type: free. I added that to the development branch. Should clear this error. |
@devbisme that helped, thank you! |
Great project, trying to give it a shot on my end. import os
os.environ["KICAD7_SYMBOL_DIR"] = "/usr/share/kicad/symbols/"
os.environ["KICAD7_3DMODEL_DIR"] = "/usr/share/kicad/3dmodels/"
os.environ["KICAD7_3RD_PARTY"] = "/home/jubei/.local/share/kicad/7.0/3rdparty/"
os.environ["KICAD7_FOOTPRINT_DIR"] = "/usr/share/kicad/footprints/"
os.environ["KICAD7_TEMPLATE_DIR"] = "/usr/share/kicad/template/"
os.environ["KICAD_USER_TEMPLATE_DIR"] = "/home/jubei/.local/share/kicad/7.0/template/"
from skidl import *
set_default_tool(KICAD7)
# Create part templates.
q = Part("Device", "Q_PNP_CBE", dest=TEMPLATE)
r = Part("Device", "R", dest=TEMPLATE)
# Create nets.
gnd, vcc = Net("GND"), Net("VCC")
a, b, a_and_b = Net("A"), Net("B"), Net("A_AND_B")
# Instantiate parts.
gndt = Part("power", "GND") # Ground terminal.
vcct = Part("power", "VCC") # Power terminal.
q1, q2 = q(2) # Two transistors.
r1, r2, r3, r4, r5 = r(5, value="10K") # Five 10K resistors.
# Make connections between parts.
a & r1 & q1["B C"] & r4 & q2["B C"] & a_and_b & r5 & gnd
b & r2 & q1["B"]
q1["C"] & r3 & gnd
vcc += q1["E"], q2["E"], vcct
gnd += gndt
generate_netlist() Results in errors:
I am using the development version. My environment variable for KICAD7_SYMBOL_DIR was never set. However when I open Kicad7, I can go to the symbols and they work fine over there. |
Tested the current skidl development branch on KiCad v8, same issue with the missing footprints, even though the correct path is in footprint_search_paths['kicad'] (see below).
|
Describe the bug
KiCad released new version "KiCad 7.0.0" on Feb/12/2023, skidl's part method call on KiCad-7.0.0 would result in KeyError: "F0"
To Reproduce
Steps to reproduce the behavior:
Traceback (most recent call last): File "skidl101.py", line 7, in <module> r1, r2 = 2 * Part("Device", 'R', TEMPLATE, footprint='Resistor_SMD.pretty:R_0805_2012Metric') File "/Users/zhuoli/.pyenv/versions/3.6.15/lib/python3.6/site-packages/skidl/part.py", line 194, in __init__ part = lib[name].copy(dest=TEMPLATE) File "/Users/zhuoli/.pyenv/versions/3.6.15/lib/python3.6/site-packages/skidl/schlib.py", line 192, in get_part_by_name parts.parse(get_name_only) File "/Users/zhuoli/.pyenv/versions/3.6.15/lib/python3.6/site-packages/skidl/part.py", line 373, in parse parse_func(get_name_only) File "/Users/zhuoli/.pyenv/versions/3.6.15/lib/python3.6/site-packages/skidl/tools/kicad/kicad.py", line 297, in parse_lib_part _parse_lib_part_kicad_v6(self, get_name_only) File "/Users/zhuoli/.pyenv/versions/3.6.15/lib/python3.6/site-packages/skidl/tools/kicad/kicad.py", line 817, in _parse_lib_part_kicad_v6 self.ref_prefix = self.fields["F0"] # Part ref prefix (e.g., 'R'). KeyError: 'F0'
Expected behavior
No error should raised from skidl's official example.
Screenshots
Desktop (please complete the following information):
Additional context
The failure is brought by this merge with a hardcode logic to search part in kicad v6
The text was updated successfully, but these errors were encountered: