wokwi / kicad-jlcpcb-bom-plugin Goto Github PK
View Code? Open in Web Editor NEWExport a JLCPCB Compatible BOM directly from your KiCad schematic
Export a JLCPCB Compatible BOM directly from your KiCad schematic
So first off, this may be a user error, but I'm putting it here for posterity to describe the possible ways I've contributed to this error. For now, I'm not looking for any support (although thoughts/suggestions are welcome), I'm just documenting so when I figure out what's causing this I can record that here for future users to find in searches.
When generating BOM, the LCSC Part # column has a header, but none of the component rows have values for that column.
I originally added a Fieldname Template of LCSC Part
, and used that to fill in values. I discovered after the first time generating the BOM, that it added a 2nd identically named field to each component, with no value.
I figured that was why things were empty, so I manually removed BOTH of those fields, and added a new field of lcsc_pn
, (taking from the source code), and entered those for each component.
Still blank values...
I haven't tried things on a fresh project yet, and I suspect it will work fine on a fresh project.
exit 1
Application: Eeschema
Version: 5.1.7-a382d34a8~88~ubuntu20.04.1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh/0.9.3/openssl/zlib nghttp2/1.41.0 librtmp/2.3
Platform: Linux 5.8.0-25-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.71.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.68.0
Compiler: GCC 9.3.0 with C++ ABI 1013
Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON
Running the BOM script on my Mac OS 10.14 system (KiCad 5.1.6) I get:
Run command:
python “/private/var/folders/rh/ctp5glvj01s12dnfctv6j4_c0000gn/T/AppTranslocation/7C9B6EA2-A66C-4A48-9BB1-DD8449EA8C9E/d/kicad.app/Contents/SharedSupport/plugins/bom_csv_jlcpcb.py” “/Users/ned/src/fluke-884x-display/fluke_display/fluke_display.xml” “/Users/ned/src/fluke-884x-display/fluke_display/fluke_display”
Command error. Return code 1
Error messages:
Traceback (most recent call last):
File “/private/var/folders/rh/ctp5glvj01s12dnfctv6j4_c0000gn/T/AppTranslocation/7C9B6EA2-A66C-4A48-9BB1-DD8449EA8C9E/d/kicad.app/Contents/SharedSupport/plugins/bom_csv_jlcpcb.py”, line 29, in <module>
with open(sys.argv[2], ‘w’, newline=‘’) as f:
TypeError: ‘newline’ is an invalid keyword argument for this function
Removing the newline=''
from that line fixed the problem.
I think this is because the Python that is packaged with KiCad is version 2.7.
I'm on Kicad7 - if I fill out the LCSC Part # field and generate the production output, the caps and res LCSC Part # field is empty. Is it supposed to be this way?
I get the following error:
ModuleNotFoundError: No module named 'kicad_netlist_reader'
Hi, thanks for your work! Unfortunately, I get an error message when I try to execute the script in Eeschema. What is kicad_netlist_reader and how do I get it?
Greetings
h8
Command:
python "/usr/share/kicad/scripting/plugins/bom_csv_jlcpcb.py" "%I" "%O"
Error:
Run command:
python "/usr/share/kicad/scripting/plugins/bom_csv_jlcpcb.py" "/home/hesse/Dokumente/KiCad/Projekte/Privat/MateLightScrewCap/MateLightScrewCap.xml" "/home/hesse/Dokumente/KiCad/Projekte/Privat/MateLightScrewCap/MateLightScrewCap.csv"
Command error. Return code 1
Error messages:
Traceback (most recent call last):
File "/usr/share/kicad/scripting/plugins/bom_csv_jlcpcb.py", line 23, in <module>
import kicad_netlist_reader
ModuleNotFoundError: No module named 'kicad_netlist_reader'
sol:
Had to rewrite line 29
open(sys.argv[2], 'w', newline ='') as f:
to:
open(sys.argv[2], 'wb') as f:
When running the BOM script I get the error:
Command error. Return code 1
Error messages:
Traceback (most recent call last):
File “/private/var/folders/4r/0wdgxsd94j5bq4nywh48q9bh0000gn/T/AppTranslocation/7B6115DA-01DD-4A95-BA1E-A6283AC1F807/d/kicad.app/Contents/SharedSupport/scripting/bom_csv_jlcpcb.py”, line 23, in <module>
import kicad_netlist_reader
ModuleNotFoundError: No module named ‘kicad_netlist_reader’
I have tried installing this module with pip but to no avail. I can import the module in a python session.
Platform: macOS
KiCAD: 5.1.9
Python: 3.9.0
I'm currently using Kicad v5.1.7 and I'm getting the following error message:
Command error. Return code 1
Error messages:
Traceback (most recent call last):
File "C:\Program Files\KiCad\bin\scripting\plugins/bom_csv_jlcpcb.py", line 29, in
with open(sys.argv[2], 'w', newline='') as f:
TypeError: 'newline' is an invalid keyword argument for this function
Nice program, thanks. Looks like I have to rotate all capacitors and resistors, so pattern matching (like C*) in overrides.json would be convenient. It's too bad that rotation information is stored in a separate file and not tied to a specific part - preferable would be to store rotation information in a field in the schematic/part (which can be available as a BOM field).
Getting this error whenever I try to use this plugin.
I am on Windows 10 using KiCad 5.1.10
python3 "C:\Program Files\KiCad\bin\scripting\plugins/bom_csv_jlcpcb.py" "%I" "%O.csv"
Error messages:
Traceback (most recent call last):
File "C:\Program Files\KiCad\bin\scripting\plugins\bom_csv_jlcpcb.py", line 48, in <module>
out.writerow([c.getValue() + " " + c.getDescription(), ",".join(refs), c.getFootprint().split(':')[1],
IndexError: list index out of range
The read me suggests you are convering a xxx.pos
file using kicad_pos_to_cpl.py
, but the instructions actually seem to ask one to set up to actaully generate a xxx-pos.csv
file. So which is it? Given the settings, and a scan of the code, I would say the guidance needs rewording?
The settings are also set to create a top and a bottom file, I can only assume if the top of the board has the components then whatever conversion is against only the top file? Makes sense, since I also understand JCLPCB only place components on top. So, a little more clarity in the guidance maybe?
Python3 compatibility would be rather nice :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.