Giter VIP home page Giter VIP logo

kicad_bom_wizard's Introduction

KiCad BOM Wizard Plugin

KiCad_BOM_Wizard is nodeJs script for generating custom KiCad BOMs. It uses template files to describe and define the content of the output.

KiCad_BOM_Wizard can either be integrated into KiCad’s BOM plugin manager for easier use or executed directly via your system's terminal.

KiCad_BOM_Wizard comes with three templates examples, one for generate HTML BOMs, one for generating a CSV BOM and the final one for generating PDF BOMs.


Author

Ronald Sousa hashdefineelectronics.com

Twitter: @Opticalworm @HashDefineElec

Project Information


Video Instructions

Using KiCad Bom Wizard Plugin


Install and Setup

To use KiCad_BOM_Wizard, you will need NodeJs and NPM installed and configured in your system.

There are two options for installing and using KiCad_BOM_Wizard.

1. github download method

This method if for anyone who's new to git and rather download the project directly from github.

2. git clone method

This method if for anyone who prefers to use git.

This is particularly useful if you are planning on using git submodule to keep a copy of KiCad_BOM_Wizard per KiCad projects.


Short codes

These are the list of short code that are used in the template files.

Shortcode cheatsheet - shortcode.md


Frequently asked question

Pleased don't forget to checkout the FAQ.md document if you have any issue with the document.


For more details on how to use your own template for KiCad_BOM_Wizard then head over to the project Homepage.

kicad_bom_wizard's People

Contributors

fromeijn avatar hashdefineelectronics avatar opticalworm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kicad_bom_wizard's Issues

Symbols with >1 char in ref have extra space between ref letters and numbers

For example:

  • Symbol with ref J100 will be properly exported as "J100"
  • Multiple identical symbols will be exported as "J100 J101 J102" etc.
  • Symbol with ref RX100 will be incorrectly exported as "RX 100"
  • Multiple identical symbols will be exported as "RX 100 RX 101 RX 102" etc.

All of the above happens when using CSV format. I have not yet tried HTML or other formats.

My method of naming some symbols with 2-char ref is probably a bit non-standard, but my schematic has a large number of connectors and using 2-char refs helps to keep things easier to understand & relatively sane.

Using git revision: f16c62a

Footprint field

Thanks for the plugin! Is there any chance you'd be able to add the ability to output the footprint field as well? I tried ROW_PART_FOOTPRINT but it didn't work, and I didn't see another way to output the footprint.
Thanks!

Failed with Code 1

Hi,

I've used the BOM wizard tool for two schematics I captured. For one of them the tool created a csv file without any problem, the other one gives me Error code 1.

I suppose it has something to do with my parts selection, but can't seem to find the exact reason.

The output is (I've replaced my local path to ~):

Run command:
node /Dropbox/KiCad/KiCad_BOM_Wizard-master/KiCad_BOM_Wizard.js "/Dropbox/KiCad/MIDI_Shield_16u2/MIDI_shield_16u2.xml" "~/Dropbox/KiCad/MIDI_Shield_16u2/MIDI_shield_16u2.csv" "CSV"

Command error. Return code 1

Info messages:
BOM CONFIGURATION:

{ OptionFilePath: null,
CurrentWorkingPath: 'C:\Program Files\KiCad',
TemplateFolder: '\Dropbox\KiCad\KiCad_BOM_Wizard-master\Template\',
version: 1,
outputType: 'FILE',
templatePath: '
\Dropbox\KiCad\KiCad_BOM_Wizard-master\Template\CSV',
tempFilePath: null,
keepTempFile: false,
output:
{ path: '\Dropbox\KiCad\MIDI_Shield_16u2\MIDI_shield_16u2.csv',
basename: 'MIDI_shield_16u2',
ext: '.csv' },
input:
{ path: '
/Dropbox/KiCad/MIDI_Shield_16u2/MIDI_shield_16u2.xml',
ext: '.xml',
basename: 'MIDI_shield_16u2' },
pdfOptions:
{ showPage: false,
pageSize: 'A4',
printBackground: false,
landscape: false,
marginsType: 0 },
sort: { by: 'ref', ascending: true } }

Reading KiCad file [ ~/Dropbox/KiCad/MIDI_Shield_16u2/MIDI_shield_16u2.xml ]

Error messages:
Trace: ** Error **
TypeError: Cannot read property 'forEach' of undefined

at exports.Error (~\Dropbox\KiCad\KiCad_BOM_Wizard-master\Lib\common.js:113:11)
at tryCallOne (~\Dropbox\KiCad\KiCad_BOM_Wizard-master\node_modules\promise\lib\core.js:37:12)
at ~\Dropbox\KiCad\KiCad_BOM_Wizard-master\node_modules\promise\lib\core.js:123:15
at flush (~\Dropbox\KiCad\KiCad_BOM_Wizard-master\node_modules\asap\raw.js:50:29)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)

Comma in MPN field problem

If I export BOM to HTML, if it is comma in MPN field, then it is replaced with space. Default fields (ref, value, footprint, datasheet) are OK. ON source xml file it is too OK.
It would be good to be able to choose which custom fields will be listed in the BOM.

If I export It to CSV, it is too bad.

Using git revision f16c62a

doesn't run on Ubuntu 16.04LTS without manual upgrade of node

The version of node that comes with the default packages for Ubuntu 16.04LTS is too old to run kicad_bom_wizard and it errors out with a strange "const" error message (as discussed on the kicad forum).

Instead it would be better if during the npm install process the old version of node would be detected and an appropriate error message be printed out to the user.

PDF output not readable on Mac

Running the BOM wizard with HTML output works perfectly, but changing it to PDF generates a file that is not readable by Preview on Mac (or on an online PDF viewer).

Wrong order of Ref Designators

When creating a .csv BOM on Kicad's dev branch, the reference Designators are not sorted by number but collected as is from the generated .xml.

For example one cell might contain the following sequence:

Ref
C12 C4 C30 C31

Is there an easy way to get the Elements in one cell in ascending order?

npm ERR! error rolling back Error: ENOTEMPTY: directory not empty

Hi, thanks for your tool.

I was going to try out your BOM creator, and I followed your github instructions. npm throws some errors when I type "npm install" that I can't figure out how to fix. I'm not familiar with node at all.

$ uname -a
Linux debian 4.13.0-1-amd64 #1 SMP Debian 4.13.4-2 (2017-10-15) x86_64 GNU/Linux
$ apt policy npm
npm:
  Installed: 1.4.21+ds-2
  Candidate: 1.4.21+ds-2
  Version table:
 *** 1.4.21+ds-2 100
         50 https://deb.debian.org/debian unstable/main amd64 Packages
         50 https://deb.debian.org/debian unstable/main i386 Packages
        100 /var/lib/dpkg/status
$ apt policy nodejs
nodejs:
  Installed: 4.8.4~dfsg-1
  Candidate: 4.8.4~dfsg-1
  Version table:
     6.11.4~dfsg-1 50
         50 https://deb.debian.org/debian unstable/main amd64 Packages
 *** 4.8.4~dfsg-1 1000
       1000 https://deb.debian.org/debian testing/main amd64 Packages
        100 /var/lib/dpkg/status
     4.8.2~dfsg-1 750
        750 https://deb.debian.org/debian stable/main amd64 Packages

If you need the more detailed error log, let me know.
Thanks for your help!

~/build/KiCad_BOM_Wizard$ npm install
npm ERR! error rolling back Error: ENOTEMPTY: directory not empty, rmdir '/home/yankee/build/KiCad_BOM_Wizard/node_modules/nightmare/node_modules/mkdirp'
npm ERR! error rolling back     at Error (native)
npm ERR! error rolling back  nightmare@2.10.0 { [Error: ENOTEMPTY: directory not empty, rmdir '/home/yankee/build/KiCad_BOM_Wizard/node_modules/nightmare/node_modules/mkdirp']
npm ERR! error rolling back   errno: -39,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   syscall: 'rmdir',
npm ERR! error rolling back   path: '/home/yankee/build/KiCad_BOM_Wizard/node_modules/nightmare/node_modules/mkdirp' }
npm ERR! 404 Not Found
npm ERR! 404 
npm ERR! 404 'types/node' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'electron'
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Linux 4.13.0-1-amd64
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/yankee/build/KiCad_BOM_Wizard
npm ERR! node -v v4.8.4
npm ERR! npm -v 1.4.21
npm ERR! code E404
npm ERR! tar.unpack untar error /home/yankee/.npm/enqueue/1.0.2/package.tgz
npm WARN deprecated ignore@2.2.19: several bugs fixed in v3.2.1
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/yankee/build/KiCad_BOM_Wizard/npm-debug.log
npm ERR! not ok code 0

Doesn't run "out of the box" on a mac - with homebrew

On OS X with homebrew, would not run out of the box. There are 2 workaround options:

  1. On the Bill of Materials Command Line in KiCad use: /usr/local/bin/node "....KiCad_BOM_Wizard.js"....etc
  2. Edit the top line of the KiCad_BOM_Wizard.js file to read #!/usr/local/bin/node

CSV File getting munched vs. HTML

On Mac OS X Seeing interesting differences between CSV and HTML. Might be because not every single one of my parts shares identical fields due to legacy parts from prior projects.

In short, the CSV seems to be running fields together whereas the HTML is not.

screen shot 2016-10-11 at 12 48 43 am

screen shot 2016-10-11 at 12 49 30 am

Both CSV and HTML have weird issues with text values as well. I'm not using any special characters in EESchema...just "10uF", etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.