GithubHelp home page GithubHelp logo

inti-cmnb / kibot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from johnbeard/kiplot

524.0 524.0 64.0 55.38 MB

KiCad automation utility

License: GNU Affero General Public License v3.0

Python 96.30% Makefile 0.38% Shell 0.74% Perl 0.01% CSS 0.36% Dockerfile 0.35% HTML 0.49% JavaScript 1.32% Handlebars 0.04%
3d-models automation bom ci-cd drill gerber kicad plot position

kibot's People

Contributors

andrew-collins avatar atmelfan avatar crides avatar diogocondeco avatar easyriderr avatar edlongman avatar flaviut avatar frankleonrose avatar hkleen avatar hoijui avatar johnbeard avatar kasbah avatar kevin-dong-nai-jia avatar matthiesenj avatar matthijskooijman avatar mdeweerd avatar modischfabrications avatar nerdyscout avatar nopeppermint avatar oliv3r avatar rdeterre avatar rleh avatar set-soft avatar sethkaz avatar skorokithakis avatar taotieren avatar theslowgrowth avatar thetazero avatar thorfinn-thorsson avatar zedudi 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kibot's Issues

pdf_pcb_print throws erroneous WARNING:KiCad project file not found

I've found that pdf_pcb_print is throwing this warning:

WARNING:KiCad project file not found

This is from here

I had a quick look and it seems that pdf_pcb_print is operating on a temporary file (ie /tmp/tmp9j_9c3fb.pro) and so fails the check.

So I think the check needs to be disabled for pdf_pcb_print.

As an extra note, this warning doesn't have a number and so can't be filtered manually either, which might be desirable if you want to run the tool on a kicad_pcb file on its own.

KiBoM generation failure

Thank you for efforts in aggregating all these tools and making the result incredibility easy to use!

I am having an issue when using Github Actions with v0.8.1, when I run locally there are no issues and the KiBot completely runs. But on github actions the CSV KiBOM fails while the IBOM and other functionality works.

From the github action I can extract this:

- Updating BoM in XML format
WARNING:(W037) Field Mouser of component R813 (R_US 10k) contains extra spaces: `603-RC0603FR-0710KL ` removing them. (kibot.kibot.kicad.v5_sch - log.py:82)
WARNING:(W037) Field Digikey of component U703 (TLV70233_SOT23-5) contains extra spaces: `296-32415-1-ND ` removing them. (kibot.kibot.kicad.v5_sch - log.py:82)
WARNING:(W041) Missing library `mylib` (kibot.kibot.kicad.v5_sch - log.py:82)
- 'Print schematic (PDF)' (print_sch) [pdf_sch_print]
- 'Interactive Bill of Materials (HTML)' (interactive_bom) [ibom]
- 'Bill of Materials in CSV format' (bom_csv) [kibom]
ERROR:Failed to create BoM, error 1 (kibot.kibot.out_kibom - out_kibom.py:379)

KiBot/kibot/out_kibom.py

Lines 376 to 382 in 986f0c7

try:
cmd_output = check_output(cmd, stderr=STDOUT)
except CalledProcessError as e:
logger.error('Failed to create BoM, error %d', e.returncode)
if e.output:
logger.debug('Output from command: '+e.output.decode())
exit(BOM_ERROR)

I think the issue is pertaining to the missing library. Is the library really required to generate the bom? Can't the cache or rescue libraries be used instead?

Going forward is there a way to get more verbose information from Github Actions? I see the -v flag but do not know how to pass though the action config or the yaml config.

Drill file rename failure

I am seeing an error when it appears to be trying to rename a drill pdf file:

File "/usr/lib/python3/dist-packages/kibot/out_any_drill.py", line 121, in run
os.rename(k_file, file)
FileNotFoundError: [Errno 2] No such file or directory: '/home/david/Dev/misc/fancontrol/hardware/fancontrol/kibot/pcbfab/fancontrol-PTH-drl_map.pdf' -> '/home/david/Dev/misc/fancontrol/hardware/fancontrol/kibot/pcbfab/fancontrol-PTH_drill_map.pdf'

There is a fancontrol-PTH-drl-drl_map.pdf file present in that folder.

As this is my first time using KiBot so my kibot.yaml file is pretty much everything from the example so that I can get an idea of what the generated output looks like ahead of refining it to my actual needs. I have attached the full console output and my kibot.yaml files in case they are needed. Please let me know if there is any additional information needed.
KiBot_reanme_fail.zip

Incorrect modification of pcb file during (at least) pdf_pcb_print

When pdf_pcb_print modifies a PCB to draw crosses for variant, it's deleting some layers from pad layer set.

Sometimes pads have no signal layers at all. Examples of such pads are extra holes for solder paste in QFN packages.

This leads to situation that after modification pad has no layers remaining. An incorrect tag (layer ) (without any data) is written to updated PCB file. KiCad will not load such file, it'll generate an error (visible in recorded session):

footprint U1, pad (unnamed): could not find valid layer for pad

and either refuse to open the board, either confuse KiAuto strong enough to exit with "Timeout waiting for Print dialog window" message.

To reproduce:

  • Start new project;
  • Place a component in QFN package on schematic, for example, AX5043.
  • Update PCB.
  • Assign component to some variant (using Config field)
  • Create pdf_pcb_print output to print another variant (so this component should be crossed out). It'll not work.

Possible solution: if pad layer set becomes empty after modification, don't include this pad record at all.

pcbnew import error

I'm so used to using virtual environment that I created one to install kibot and got this error:

$ kibot
ERROR:Failed to import pcbnew Python module. Is KiCad installed? Do you need to add it to PYTHONPATH? (kibot.kibot.kiplot - kiplot.py:43)
ERROR:Failed to import pcbnew Python module. Is KiCad installed? Do you need to add it to PYTHONPATH? (kibot.kibot.kiplot - kiplot.py:43)

After some research and tries, it seems like isolating it from the system Python is what causes pcbnew to fail the import.
Maybe it would be good to mention this in the README? ๐Ÿ˜„

[MacOS] dynamic module does not define module export function

Hi,

I did the following on a Mac using:

Installation on other targets

Install KiCad 5.x
Install Python 3.5 or newer
Install the Python Yaml module
Run the script src/kibot

Resulting in

> python --version
Python 3.8.3
pip show PyYAML
Name: PyYAML
Version: 5.3.1
Summary: YAML parser and emitter for Python
Home-page: https://github.com/yaml/pyyaml
Author: Kirill Simonov
Author-email: [email protected]
License: MIT
Location: .../.pyenv/versions/3.8.3/lib/python3.8/site-packages
Requires:
Required-by: kibot

KiCad

Application: KiCad
Version: (5.1.7-0-10_14), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.1 SecureTransport (LibreSSL/2.8.3) zlib/1.2.11 nghttp2/1.39.2
Platform: macOS Catalina Version 10.15.7 (Build 19H2), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (wchar_t,STL containers,compatible with 2.8)
    Boost: 1.73.0
    OpenCASCADE Technology: 7.4.0
    Curl: 7.54.0
    Compiler: Clang 10.0.1 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=ON
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=OFF
    KICAD_USE_OCC=ON
    KICAD_SPICE=ON

When running src/kibot I get the following error message.

Traceback (most recent call last):
  File "/Users/marcel/KiCad/KiBot/kibot/kiplot.py", line 40, in <module>
    import pcbnew
  File "/Applications/KiCad/kicad.app/Contents/Frameworks/python/site-packages/pcbnew.py", line 15, in <module>
    import _pcbnew
ImportError: dynamic module does not define module export function (PyInit__pcbnew)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./kibot", line 15, in <module>
    from kibot.__main__ import main
  File "/Users/marcel/KiCad/KiBot/kibot/__main__.py", line 71, in <module>
    from .kiplot import (generate_outputs, load_actions, config_output)
  File "/Users/marcel/KiCad/KiBot/kibot/kiplot.py", line 42, in <module>
    log.init(False, False)
TypeError: init() takes 0 positional arguments but 2 were given

How can this be resolved? Any ideas?

Support symbols with missing field names

When downloading some symbols from SnapEDA, some of them have fields without names, which makes the script fail:

ERROR:At line 11 of `path to lib`: Missing component field name (kibot.kibot.kiplot - kiplot.py:180)
ERROR:Line content: `F4 "L6470H" -200 1250 50 H I L BNN` (kibot.kibot.kiplot - kiplot.py:181)

Here is how field definitions in this particular library look like:

DEF L6470H U 0 40 Y Y 1 F N
F0 "U" -600 650 50 H V L BNN
F1 "L6470H" -600 -700 50 H V L BNN
F2 "SnapEDA Library:SOP65P640X120-29N" -450 -50 50 H I L BNN
F3 "" -300 1250 50 H I L BNN
F4 "L6470H" -200 1250 50 H I L BNN
F5 "7486" -150 1250 50 H I L BNN
F6 "5.73 USD" -200 1250 50 H I L BNN
F7 "STMicroelectronics" -400 1250 50 H I L BNN
F8 "HTSSOP-28 STMicroelectronics" -550 1250 50 H I L BNN
F9 "L6470H Series 45 V Dual Full Bridge dSPIN Microstepping Motor Driver - HTSSOP-28" -1600 1250 50 H I L BNN
F10 "7" -100 1200 50 H I L BNN
F11 "Good" -150 1250 50 H I L BNN

KiCad imports the fields F4+ as Field4, Field5, etc...
So I think the script should do the same and not throw an error.

pcbDraw error : Unable to determine pcbdraw version.

Hello,

with ubuntu 20.04

I installed kibot and pcbdraw like this:

python -m pip install kibot
python -m pip install pcbdraw

Now, launching kibot with pcbdraw output leads to this error:

ERROR:Unable to determine pcbdraw version:
 (kibot.kibot.kiplot - kiplot.py:110)

What should I do?

In case it would help, here is the configuration:

    comment: 'default green svg top'
    type: 'pcbdraw'
    dir: 'outputs/docs/img'
    options:
      # [boolean=false] render the bottom side of the board (default is top side)
      bottom: true
      # [string|list(string)=''] Name of the filter to mark components as not fitted.
      # A short-cut to use for simple cases where a variant is an overkill
      dnf_filter: ''
      # [number=300] [10,1200] dots per inch (resolution) of the generated image
      dpi: 300
      # [string='svg'] [svg,png,jpg] output format. Only used if no `output` is specified
      format: 'svg'
      # [list(string)=[]] list of components to highlight
      highlight: []
      # [list(string)=[]] list of libraries
      libs: ['/usr/share/pcbdraw/footprints/KiCAD-base']
      # [boolean=false] mirror the board
      mirror: true
      # [boolean=false] do not make holes transparent
      no_drillholes: false
      # [string='%f-%i%v.%x'] name for the generated file. Affected by global options
      output: '%f-%i%v.%x'
      # [boolean=false] show placeholder for missing components
      placeholder: false
      # [dict|None] replacements for PCB references using components (lib:component)
   #   remap:
      # [list(string)|string=none] [none,all] list of components to draw, can be also a string for none or all.
      # The default is none
 #     show_components: none
      # [string|dict] PCB style (colors). An internal name, the name of a JSON file or the style options
  #    style: '/usr/share/pcbdraw/styles/jlcpcb-green-hasl.json'
      # [string=''] Board variant to apply
      variant: ''
      # [boolean=false] render V-CUTS on the Cmts.User layer
      vcuts: false
      # [string='visible'] [visible,all,none] using visible only the warnings about components in the visible side are generated
      warnings: 'none'

Thanks
Julien

Error when running KiBot

I installed KiBot with pip install --user --no-compile kibot, but, when trying to run it, I get:

ERROR:Unable to import plug-ins: No module named 'lib.python3' (kibot.kibot.kiplot - kiplot.py:64)

[FEATURE REQUEST] Generate ".brd" file

Hi!

Would it be possible to integrate one more tool into this toolbox? I think exporting ".brd" files would be very interesting. Quoting directly from this tool which I am currently using:

The KiCAD to Boardview exporter reads KiCAD PCB layout files and writes Boardview files. Boardview is a set of file formats used in the industry for communicating important data about PCB in post-production stage, such as component, pin, and test point placement.

The Boardview file formats do not typically have a specification or even a name. The KiCAD to Boardview exporter writes ".brd" files with ASCII Boardview data. These files can be opened with MIT-licensed OpenBoardView.

Sincerely I don't really know how many people would be benefited from it and my final intent would be to use it through this other tool, which would enable us to automatically generate the board view right from the Github Actions. I actually post this issue there but it makes more sense to integrate it here, not directly there.

Let me know what you think about it,
Thanks!

Missing libraries on Ubuntu

I was missing xvfb and xdotool on my Ubuntu 18.04 system, which I've installed using:

$ sudo apt update
$ sudo apt install xvfb xdotool

Not sure if it was specific to my system or if that's a common theme for new KiBot users.
Would be nice if this was documented in the Installation using pip section!

dnf_filter does not work (or at least not documented) for pick_and_place

At least for the pick_and_place output (and possibly others) the documentation indicates:

dnf_filter: [string|list(string)=''] Name of the filter to mark components as not fitted. A short-cut to use for simple cases where a variant is an overkill.

However putting anything in this field leads to:

Unknown filter [whatever] used for `dnf_filter`

It is not clear how to get the pick_and_place output to ignore DNF components without using variants.

Variant with Rotation Filter Not Including All Parts in Pick and Place File

Thanks for all the hard work on this project, it's wonderful to be able to integrate it as part of a github action to help check PRs and automatically keep generated artifacts up to date on a commit.

A project I'm working on has a board with variants which we want to produce the JLCPCB fab files for. You can see the project and associated config file at https://github.com/daveismith/index/tree/feature/128-kibot-variants/feeder/pcb/mobo. It's run in github actions on each commit and produces uploaded artifacts as part of this action: https://github.com/daveismith/index/actions/runs/616280571. The one of interest is the feeder_mobo_output which contains two variants. One is the default and the other is specified with the key VCNT2020. Instead of running two separate runs, I use the config to output separate schematic, bom and cpl (pick and place) files for the variant. The schematic and the bom correctly pick up the variants, but when I look at my CPL file for the variant it's missing U2.

I've attached the two versions of the schematics, bom and cpl files as well as my config. The BOM and CPL files have been renamed to TXT to allow attachment. I'm hoping I've just missed something in the documentation.

Schematic.pdf
Schematic_vcnt2020.pdf

mobo_bom_jlc.csv.txt
mobo_bom_jlc_vcnt2020.csv.txt

mobo_cpl_jlc.csv.txt
mobo_cpl_jlc_vcnt2020.csv.txt

config.kibot.yaml.txt

Run "Annotate Schematic"

I have a KiCad project that uses some generic sheets I pull in from another repository as a git submodule. Unfortunately, before I can work on my project in a fresh checkout, I have to run "Annotate Schematic" to get all the page numbers and symbol references sorted out. I can't commit these changes to the other repository containing the generic sheets, as they are specific to my project.

Is it possible to get KiBot to run the "Annotate Schematic" function before doing the ERC or Plot functions?

Support option to invert `rot_footprint` result for bottom mounted components

I'm generating files for PCB:NG and for bottom mounted parts, the rotation correction (apparently) needs to be 180 - comp. footprint_rot. Unless I'm mistaken, there's no way to express that in the rot_footprint filter.

https://github.com/INTI-CMNB/KiBot/blob/master/kibot/fil_rot_footprint.py#L94-L97

                if self.negative_bottom and comp.bottom:
                    comp.footprint_rot -= angle
                else:
                    comp.footprint_rot += angle

A new option (invert_bottom?) would allow it. negative_bottom allows subtraction, rot - angle, then invert_bottom would make that angle - rot.

                if self.negative_bottom and comp.bottom:
                    comp.footprint_rot -= angle
                else:
                    comp.footprint_rot += angle
                if self.invert_bottom and comp.bottom:
                    comp.footprint_rot = -comp.footprint_rot

Is there a better way to do this? Would you accept a PR?

InteractiveHtmlBom pugin causes: "Time-out waiting for pcbnew"

Without the plugin, it works fine.

with plugin

$ kibot -s all -v
DEBUG:Python cache dir: /home/hoijui/.local/lib/python3.8/site-packages/kibot/__pycache__ (kibot - __main__.py:223)
DEBUG:Importing from /home/hoijui/.local/lib/python3.8/site-packages/kibot (kibot.kibot.kiplot - kiplot.py:58)
DEBUG:- Importing out_ibom (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_any_layer (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_any_drill (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_pdf (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_gerber (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_excellon (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_ps (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_gerb_drill (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_pcbdraw (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_pdf_pcb_print (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_kibom (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_pdf_sch_print (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_position (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_step (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_svg (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_dxf (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_svg_sch_print (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_hpgl (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_base (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_bom (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing pre_base (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing pre_filters (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing pre_ignore_unconnected (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing pre_erc (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing pre_check_zone_fills (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing pre_update_xml (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing pre_drc (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:Deactivating macros (kibot.kibot.kiplot - kiplot.py:80)
Using config file: for-science.kibot.yaml
DEBUG:Using configuration file: `for-science.kibot.yaml` (kibot - __main__.py:171)
DEBUG:Parsing preflight options: {'run_erc': True, 'run_drc': True, 'check_zone_fills': False, 'ignore_unconnected': False} (kibot.kibot.config_reader - config_reader.py:84)
DEBUG:Parsing preflight run_erc (kibot.kibot.config_reader - config_reader.py:92)
DEBUG:Parsing preflight run_drc (kibot.kibot.config_reader - config_reader.py:92)
DEBUG:Parsing preflight check_zone_fills (kibot.kibot.config_reader - config_reader.py:92)
DEBUG:Parsing preflight ignore_unconnected (kibot.kibot.config_reader - config_reader.py:92)
DEBUG:Parsing global options: {'output': '%f-%i_%r.%x'} (kibot.kibot.config_reader - config_reader.py:100)
DEBUG:Pre-parsing output options for `print_front` (pdf_pcb_print) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `print_bottom` (pdf_pcb_print) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `interactive_bom` (ibom) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `bom_html` (bom) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `bom_csv` (bom) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `gerbers` (gerber) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `excellon_drill` (excellon) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `gerber_drills` (gerb_drill) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `position` (position) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `pcb_top_g` (pcbdraw) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `pcb_bot_g` (pcbdraw) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `step` (step) (kibot.kibot.config_reader - config_reader.py:73)
Using SCH file: for-science.sch
DEBUG:Using schematic: `/home/hoijui/src/for-science-keyboard/for-science.sch` (kibot - __main__.py:148)
DEBUG:Using PCB: `/home/hoijui/src/for-science-keyboard/for-science.kicad_pcb` (kibot - __main__.py:198)
DEBUG:Starting outputs for board /home/hoijui/src/for-science-keyboard/for-science.kicad_pcb (kibot.kibot.kiplot - kiplot.py:216)
DEBUG:Preflight checks (kibot.kibot.kiplot - kiplot.py:172)
DEBUG:Skipping all pre-flight actions (kibot.kibot.kiplot - kiplot.py:176)
DEBUG:Board loaded (kibot.kibot.kiplot - kiplot.py:145)
- 'Print F.Cu+Dwgs.User' (print_front) [pdf_pcb_print]
DEBUG:Output destination: /home/hoijui/src/for-science-keyboard/build (kibot.kibot.kiplot - kiplot.py:202)
DEBUG:Running: ['pcbnew_do', '--version'] (kibot.kibot.kiplot - kiplot.py:89)
DEBUG:PCB title: `for-science` (kibot.kibot.gs - gs.py:129)
DEBUG:PCB date: `2020-07-14_00-52-34` (kibot.kibot.gs - gs.py:130)
DEBUG:PCB revision: `` (kibot.kibot.gs - gs.py:131)
DEBUG:PCB company: `` (kibot.kibot.gs - gs.py:132)
DEBUG:Executing: ['pcbnew_do', '-r', '-vv', 'export', '--output_name', '/home/hoijui/src/for-science-keyboard/build/for-science-F_Cu+Dwgs_User_.pdf', '/home/hoijui/src/for-science-keyboard/for-science.kicad_pcb', '/home/hoijui/src/for-science-keyboard/build', 'F.Cu', 'Dwgs.User'] (kibot.kibot.kiplot - kiplot.py:120)
DEBUG:Select a filename -> Select a filename (pcbnew_do - pcbnew_do:482)
DEBUG:Print -> Print (pcbnew_do - pcbnew_do:483)
DEBUG:Current pcb (/home/hoijui/src/for-science-keyboard/for-science.kicad_pcb) size: 384928 date: Tue Jul 14 00:52:34 2020 (pcbnew_do - pcbnew_do:430)
DEBUG:PCBnew config: /home/hoijui/.config/kicad/pcbnew (pcbnew_do - pcbnew_do:516)
DEBUG:Moving current config to /home/hoijui/.config/kicad/pcbnew.pre_script (pcbnew_do - pcbnew_do:523)
DEBUG:Waiting for virtual X server ... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:75)
DEBUG:Current DISPLAY is :560027617 (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:76)
DEBUG:Checking using ['setxkbmap', '-query'] (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:86)
DEBUG:Recording session with: ['recordmydesktop', '--overwrite', '--no-sound', '--no-frame', '--on-the-fly-encoding', '-o', '/home/hoijui/src/for-science-keyboard/build/pcbnew_print_layers_screencast.ogv'] (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:139)
DEBUG:Clipboard store "/home/hoijui/src/for-science-keyboard/build/for-science-F_Cu+Dwgs_User_.pdf" (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:191)
INFO:Waiting for "Main pcbnew window" ...
DEBUG:Found "^Confirmation$" window instead of pcbnew (pcbnew_do - pcbnew_do:146)
INFO:Waiting for "^Confirmation$" ...
DEBUG:Found ^Confirmation$ window (1) (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:279)
DEBUG:Window id: b'6291459' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:284)
DEBUG:Waiting for b'6291459' window to get focus... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:241)
DEBUG:Currently focused id: b'6291459' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:244)
INFO:Dismiss pcbnew already running
INFO:Waiting for "Main pcbnew window" ...
ERROR:Time-out waiting for pcbnew, giving up (pcbnew_do - pcbnew_do:161)

plugin_001
plugin_002
plugin_003

relevant part of the config:

preflight:
  run_erc: true
  run_drc: true
  check_zone_fills: false
  ignore_unconnected: false

outputs:

  - name: 'print_front'
    comment: "Print F.Cu+Dwgs.User"
    type: pdf_pcb_print
    dir: build
    layers:
      - layer: F.Cu
      - layer: Dwgs.User

without plugin

$ kibot -s all -v
DEBUG:Python cache dir: /home/hoijui/.local/lib/python3.8/site-packages/kibot/__pycache__ (kibot - __main__.py:223)
DEBUG:Importing from /home/hoijui/.local/lib/python3.8/site-packages/kibot (kibot.kibot.kiplot - kiplot.py:58)
DEBUG:- Importing out_ibom (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_any_layer (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_any_drill (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_pdf (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_gerber (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_excellon (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_ps (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_gerb_drill (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_pcbdraw (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_pdf_pcb_print (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_kibom (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_pdf_sch_print (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_position (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_step (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_svg (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_dxf (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_svg_sch_print (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_hpgl (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_base (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing out_bom (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing pre_base (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing pre_filters (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing pre_ignore_unconnected (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing pre_erc (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing pre_check_zone_fills (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing pre_update_xml (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:- Importing pre_drc (kibot.kibot.kiplot - kiplot.py:62)
DEBUG:Deactivating macros (kibot.kibot.kiplot - kiplot.py:80)
Using config file: for-science.kibot.yaml
DEBUG:Using configuration file: `for-science.kibot.yaml` (kibot - __main__.py:171)
DEBUG:Parsing preflight options: {'run_erc': True, 'run_drc': True, 'check_zone_fills': False, 'ignore_unconnected': False} (kibot.kibot.config_reader - config_reader.py:84)
DEBUG:Parsing preflight run_erc (kibot.kibot.config_reader - config_reader.py:92)
DEBUG:Parsing preflight run_drc (kibot.kibot.config_reader - config_reader.py:92)
DEBUG:Parsing preflight check_zone_fills (kibot.kibot.config_reader - config_reader.py:92)
DEBUG:Parsing preflight ignore_unconnected (kibot.kibot.config_reader - config_reader.py:92)
DEBUG:Parsing global options: {'output': '%f-%i_%r.%x'} (kibot.kibot.config_reader - config_reader.py:100)
DEBUG:Pre-parsing output options for `print_front` (pdf_pcb_print) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `print_bottom` (pdf_pcb_print) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `interactive_bom` (ibom) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `bom_html` (bom) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `bom_csv` (bom) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `gerbers` (gerber) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `excellon_drill` (excellon) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `gerber_drills` (gerb_drill) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `position` (position) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `pcb_top_g` (pcbdraw) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `pcb_bot_g` (pcbdraw) (kibot.kibot.config_reader - config_reader.py:73)
DEBUG:Pre-parsing output options for `step` (step) (kibot.kibot.config_reader - config_reader.py:73)
Using SCH file: for-science.sch
DEBUG:Using schematic: `/home/hoijui/src/for-science-keyboard/for-science.sch` (kibot - __main__.py:148)
DEBUG:Using PCB: `/home/hoijui/src/for-science-keyboard/for-science.kicad_pcb` (kibot - __main__.py:198)
DEBUG:Starting outputs for board /home/hoijui/src/for-science-keyboard/for-science.kicad_pcb (kibot.kibot.kiplot - kiplot.py:216)
DEBUG:Preflight checks (kibot.kibot.kiplot - kiplot.py:172)
DEBUG:Skipping all pre-flight actions (kibot.kibot.kiplot - kiplot.py:176)
DEBUG:Board loaded (kibot.kibot.kiplot - kiplot.py:145)
- 'Print F.Cu+Dwgs.User' (print_front) [pdf_pcb_print]
DEBUG:Output destination: /home/hoijui/src/for-science-keyboard/build (kibot.kibot.kiplot - kiplot.py:202)
DEBUG:Running: ['pcbnew_do', '--version'] (kibot.kibot.kiplot - kiplot.py:89)
DEBUG:PCB title: `for-science` (kibot.kibot.gs - gs.py:129)
DEBUG:PCB date: `2020-07-14_00-52-34` (kibot.kibot.gs - gs.py:130)
DEBUG:PCB revision: `` (kibot.kibot.gs - gs.py:131)
DEBUG:PCB company: `` (kibot.kibot.gs - gs.py:132)
DEBUG:Executing: ['pcbnew_do', '-r', '-vv', 'export', '--output_name', '/home/hoijui/src/for-science-keyboard/build/for-science-F_Cu+Dwgs_User_.pdf', '/home/hoijui/src/for-science-keyboard/for-science.kicad_pcb', '/home/hoijui/src/for-science-keyboard/build', 'F.Cu', 'Dwgs.User'] (kibot.kibot.kiplot - kiplot.py:120)
DEBUG:Select a filename -> Select a filename (pcbnew_do - pcbnew_do:482)
DEBUG:Print -> Print (pcbnew_do - pcbnew_do:483)
DEBUG:Current pcb (/home/hoijui/src/for-science-keyboard/for-science.kicad_pcb) size: 384928 date: Tue Jul 14 00:52:34 2020 (pcbnew_do - pcbnew_do:430)
DEBUG:PCBnew config: /home/hoijui/.config/kicad/pcbnew (pcbnew_do - pcbnew_do:516)
DEBUG:Moving current config to /home/hoijui/.config/kicad/pcbnew.pre_script (pcbnew_do - pcbnew_do:523)
DEBUG:Waiting for virtual X server ... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:75)
DEBUG:Current DISPLAY is :1266975603 (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:76)
DEBUG:Checking using ['setxkbmap', '-query'] (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:86)
DEBUG:Recording session with: ['recordmydesktop', '--overwrite', '--no-sound', '--no-frame', '--on-the-fly-encoding', '-o', '/home/hoijui/src/for-science-keyboard/build/pcbnew_print_layers_screencast.ogv'] (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:139)
DEBUG:Clipboard store "/home/hoijui/src/for-science-keyboard/build/for-science-F_Cu+Dwgs_User_.pdf" (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:191)
INFO:Waiting for "Main pcbnew window" ...
DEBUG:Found Main pcbnew window window (1) (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:279)
DEBUG:Window id: b'6291588' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:284)
DEBUG:Waiting for b'6291588' window to get focus... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:241)
DEBUG:Currently focused id: b'6291588' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:244)
INFO:Open File->Print
INFO:Waiting for "Print dialog" ...
DEBUG:Found Print dialog window (1) (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:279)
DEBUG:Window id: b'6292243' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:284)
DEBUG:Waiting for b'6292243' window to get focus... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:241)
DEBUG:Currently focused id: b'6292243' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:244)
INFO:Waiting for "Printer dialog" ...
DEBUG:Will skip b'6292243' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:273)
DEBUG:Found Printer dialog window (1) (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:279)
DEBUG:Window id: b'6292243' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:284)
DEBUG:Skipped (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:292)
DEBUG:Found Printer dialog window (2) (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:279)
DEBUG:Window id: b'6293745' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:284)
DEBUG:Waiting for b'6293745' window to get focus... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:241)
DEBUG:Currently focused id: b'6293745' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:244)
INFO:Waiting for "Select a filename" ...
DEBUG:Found Select a filename window (1) (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:279)
DEBUG:Window id: b'6296119' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:284)
DEBUG:Waiting for b'6296119' window to get focus... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:241)
DEBUG:Currently focused id: b'6296119' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:244)
INFO:Pasting output dir
DEBUG:Waiting for b'6296119' window to lose focus... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:254)
DEBUG:Currently focused id: b'6296119' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:261)
DEBUG:Currently focused id: b'6296119' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:261)
DEBUG:Currently focused id: b'904' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:261)
INFO:Waiting for "Printer dialog" ...
DEBUG:Will skip b'6292243' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:273)
DEBUG:Found Printer dialog window (2) (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:279)
DEBUG:Window id: b'6293745' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:284)
DEBUG:Waiting for b'6293745' window to get focus... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:241)
DEBUG:Currently focused id: b'6293745' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:244)
DEBUG:Waiting for file /home/hoijui/src/for-science-keyboard/build/for-science-F_Cu+Dwgs_User_.pdf (pcbnew_do.kicad_auto.file_util - file_util.py:24)
DEBUG:[popenfile(path='/run/user/1000/kicad/pcbnew-hoijui', fd=8, position=7, mode='w', flags=32769), popenfile(path='/run/user/1000/kicad/_home_hoijui_src_for-science-keyboard_for-science.kicad_pcb.lock', fd=13, position=7, mode='w', flags=32769)] (pcbnew_do.kicad_auto.file_util - file_util.py:27)
DEBUG:Waiting for process to create file (pcbnew_do.kicad_auto.file_util - file_util.py:38)
DEBUG:[popenfile(path='/run/user/1000/kicad/pcbnew-hoijui', fd=8, position=7, mode='w', flags=32769), popenfile(path='/run/user/1000/kicad/_home_hoijui_src_for-science-keyboard_for-science.kicad_pcb.lock', fd=13, position=7, mode='w', flags=32769)] (pcbnew_do.kicad_auto.file_util - file_util.py:27)
DEBUG:Waiting for process to create file (pcbnew_do.kicad_auto.file_util - file_util.py:38)
DEBUG:[popenfile(path='/run/user/1000/kicad/pcbnew-hoijui', fd=8, position=7, mode='w', flags=32769), popenfile(path='/run/user/1000/kicad/_home_hoijui_src_for-science-keyboard_for-science.kicad_pcb.lock', fd=13, position=7, mode='w', flags=32769)] (pcbnew_do.kicad_auto.file_util - file_util.py:27)
DEBUG:Waiting for b'6293745' window to lose focus... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:254)
DEBUG:Currently focused id: b'904' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:261)
INFO:Waiting for "Print dialog" ...
DEBUG:Found Print dialog window (1) (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:279)
DEBUG:Window id: b'6292243' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:284)
DEBUG:Waiting for b'6292243' window to get focus... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:241)
DEBUG:Currently focused id: b'6292243' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:244)
DEBUG:Waiting for b'6292243' window to lose focus... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:254)
DEBUG:Currently focused id: b'904' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:261)
INFO:Waiting for "Main pcbnew window" ...
DEBUG:Found Main pcbnew window window (1) (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:279)
DEBUG:Window id: b'6291588' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:284)
DEBUG:Waiting for b'6291588' window to get focus... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:241)
DEBUG:Currently focused id: b'6291588' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:244)
INFO:Exiting pcbnew
DEBUG:Waiting for b'6291588' window to lose focus... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:254)
DEBUG:Currently focused id: b'6291588' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:261)
DEBUG:Currently focused id: b'904' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:261)
INFO:Retry pcbnew exit
DEBUG:Waiting for b'6291588' window to lose focus... (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:254)
DEBUG:Currently focused id: b'904' (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:261)
DEBUG:Terminating the session recorder (pcbnew_do.kicad_auto.ui_automation - ui_automation.py:144)

no_plugin

Windows support

Is there currently a support for kibot under windows?

I can install kibot using pip but it can't import pcbnew. I tried installing kibot with pip with the bundled python version of kicad but scince my kicad version uses Python2 it can't install kibot.

(Feature request) Integrate "-e" CLI flag into yaml file

So, the -e flag is used to specify the schematic file to pick when the KiCAD project has more than 1 schematic sheet.

Would it be possible to include this information in the yaml file instead?

I'm envisioning something under "kibot:" or "preflight:" that would be "schematic_root: top_sheet.sch", so we can just type in kibot into the command line to run it.

pdf_pcb_print lacks output options

In current state, pdf_pcb_print is almost useless because it has no options to control output. There are no options to toggle title block, mirror, and scaling, although they exist in KiCad.

It lead to bad situation that there is no good way to create fabrication/documentation outputs:

  • Manually in KiCad, I can do almost perfect output - at fit-to-page scale, excluding title block, mirroring bottom layers. But no support for variants.
  • In kibot, variants are handled properly (unfit components are crossed out), but prints itself are at default options, ugly and useless - tiny board inside title block which is impossible to turn off, prints of bottom layers are unreadable because they're not mirrored.

Allow for adjustment of rotation in pick and place file

Not all fab houses follow the same standards for rotation in the pick and place process. The example that brought this up for me is that KiCad follows a left/upper left Pin 1 convention where as JLCPCB considers 0 degree rotation based on the components are oriented in the tape and reel and these two don't always match. This causes the need for a lot of manual editing to get things right which is time consuming and error prone.

I came across this blog post which call out a tool (I think written by the author) that will use some filters to automatically adjust the rotation based on pad name. I think this would be a nice feature to add to kibot.

I could see adding a rotation_fix entry in the position output. You could create regular expressions to match footprint names and then apply a rotation correction. If just footprint feels a little restrictive, we could add another key called field that lets you specifiy the field to filter on. This way you could exclude cretin components from getting modified based on designator or part number.

- name: 'position_example'
    comment: 'Generates the file with position information for the PCB components, used by the pick and place machine.'
    type: 'position'
    dir: 'Example/position_dir'
    options:
      # [list(dict)] Rotation fixes to apply based on a footprint regular expression match
      # Only the first match is applied.
      rotation_fix:
        - name: Do not correct Q4, this part is special
          field: Reference
          regex: "^Q4$"
          rotation: 0
        - regex: "^SOT-223"
          rotation: 180
        - regex: "^SOT-23"
          rotation: 180
        - regex: "^SOT-353"
          rotation: 180
        - name: All QFNs need to be corrected
          regex: ""^(.*?_|V)?QFN-(16|20|24|28|40)(-|_|$)"
          rotation: 270
...

I could take a stab at implementing this, but wanted to check before putting the effort in to see if this has a shoot at getting accepted upstream and to get any feedback on the design.

Error while installed deb package on WSL2 / Ubuntu 20.04

Once I try to install Kibot on Ubuntu 20.04 LTS which is set on WSL2 windows environment I get the following error msg:

Setting up kibot (0.8.1-1) ...
Traceback (most recent call last):
  File "/usr/bin/kibot", line 15, in <module>
    from kibot.__main__ import main
  File "/usr/lib/python3/dist-packages/kibot/__main__.py", line 71, in <module>
    from .kiplot import (generate_outputs, load_actions, config_output)
  File "/usr/lib/python3/dist-packages/kibot/kiplot.py", line 47, in <module>
    m = re.search(r'(\d+)\.(\d+)\.(\d+)', pcbnew.GetBuildVersion())
AttributeError: module 'pcbnew' has no attribute 'GetBuildVersion'
dpkg: error processing package kibot (--configure):
 installed kibot package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 kibot
E: Sub-process /usr/bin/dpkg returned an error code (1)

Unexplained Time Out

I am having problems running KiBot using Gitlab CI.

I know my kibot.yaml is valid because I can pull the setsoft/kicad_auto:latest Docker image and run all of the kibot commands from by gitlab-ci.yml file to generate my output files.

I know my gitlab-ci.yml is valid because the script do execute but fail.

An example of the failure when the script runs on the Gitlab CI Runner:

Running with gitlab-runner 13.9.0-rc2 (69c049fd)
on docker-auto-scale 72989761
feature flags: FF_GITLAB_REGISTRY_HELPER_IMAGE:true
Preparing the "docker+machine" executor 00:31
Using Docker executor with image setsoft/kicad_auto:latest ...
Pulling docker image setsoft/kicad_auto:latest ...
Using docker image sha256:ac7637e4ecae41781c2e99b022c458231f30de074c3bb6fa6a7715de321384d4 for setsoft/kicad_auto:latest with digest setsoft/kicad_auto@sha256:5f73825ba33e1df618e766a86004e008bf19e4377618a9f5f131e6c50403419f ...
Preparing environment 00:03
Running on runner-72989761-project-24167928-concurrent-0 via runner-72989761-srm-1613881361-c3130243...
Getting source from Git repository 00:02
$ eval "$CI_PRE_CLONE_SCRIPT"
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/joelbrunetti/heated-socks-battery-hardware/.git/
Created fresh repository.
Checking out cda63971 as 3-add-ci-checks-generation...
Skipping Git submodules setup
Executing "step_script" stage of the job script 02:47
Using docker image sha256:ac7637e4ecae41781c2e99b022c458231f30de074c3bb6fa6a7715de321384d4 for setsoft/kicad_auto:latest with digest setsoft/kicad_auto@sha256:5f73825ba33e1df618e766a86004e008bf19e4377618a9f5f131e6c50403419f ...
$ [ -f *.sch ] && kibot -d report/ -s run_drc -i
Using config file: kicad_ci.kibot.yaml
Using SCH file: HeatedSocksBattery.sch
WARNING:(W008) Unable to find KiCad configuration file (/root/.config/kicad/kicad_common) (kibot.kibot.kicad.config - log.py:82)
WARNING:(W011) Missing default symbol library table (kibot.kibot.kicad.config - log.py:82)

  • Running the ERC
    ERROR:Output from command:

ERROR:Time-out waiting for eeschema, giving up (eeschema_do - eeschema_do:156)
(kibot.kibot.kiplot - kiplot.py:146)
ERROR:ERC returned 10 (kibot.kibot.pre_erc - pre_erc.py:58)
Cleaning up file based variables 00:01
ERROR: Job failed: exit code 1

The duration for this to execute is 3 minutes and 27 seconds.

So I know:

  • My kibot.yaml file is correct and does what I want.
  • My gitlab-ci.yml file is correct and does what I want.
  • The kicad_auto:latest (as of a couple days ago) functions without errors.

I am left suspecting the Gitlab CI servers. The duration seems very high and I suspect KiBot is taking longer to execute on the Gitlab CI servers than on my test machine and thus timing out.

My questions to you are:

  • How do I verify my suspicion?
  • If I'm correct, how do I change the timeout to be more forgiving of the shared CI runner?
  • If I'm wrong, any ideas?

I'm relatively new to KiCad but your project is great. Thank you for the lovely automation tools.

Feature request: ability to set column names in pick and place (position)

Currently the "position" type for pick and place data fixes the column names as follows:

Ref,Val,Package,PosX,PosY,Rot,Side

Some manufacturers do not automatically correctly recognise these headings correctly when importing the data and must be manually changed. For example PosX may need to be changed to Center X.

If there was an option to allow specifying what each column is called, then it could be adjusted to meet manufacturer requirements.

A way to pass XML to IBOM automatically

Currently, if I specify extra_fields, but not netlist_file, the fields do not appear in the ibom output.
The problem is that the path to netlist file is obviously different for different boards, so I cannot use the same config for all.

So it would be nice to have a way to pass the netlist file to IBOM automatically, without modifying the config for each board.

Support for list type in variant option?

I'm testing with two variants: DEV and PROD.

Following the variant documentation, I've setup my example.kibot.yaml as follow:

variants:
  - name: 'default'
    comment: 'Default Variant'
    type: kibom
  - name: 'DEV'
    comment: 'Development Variant'
    type: kibom
    file_id: _DEV
    variant: DEV
  - name: 'PROD'
    comment: 'Production Variant'
    type: kibom
    file_id: _PROD
    variant: PROD

and the output to:

outputs:
  - name: 'pdf_sch_print_example'
    comment: 'Exports the PCB to the most common exhange format. Suitable for printing.'
    type: 'pdf_sch_print'
    dir: 'Example/pdf_sch_print_dir'
    options:
      # [string|list(string)=''] Name of the filter to mark components as not fitted.
      # A short-cut to use for simple cases where a variant is an overkill
      dnf_filter: ''
      # [string='%f-%i%v.%x'] filename for the output PDF (%i=schematic %x=pdf). Affected by global options
      output: '%f-%i%v.%x'
      # [string=''] Board variant to apply.
      # Not fitted components are crossed
      variant: 'DEV'
  - name: 'pdf_sch_print_example'
    comment: 'Exports the PCB to the most common exhange format. Suitable for printing.'
    type: 'pdf_sch_print'
    dir: 'Example/pdf_sch_print_dir'
    options:
      # [string|list(string)=''] Name of the filter to mark components as not fitted.
      # A short-cut to use for simple cases where a variant is an overkill
      dnf_filter: ''
      # [string='%f-%i%v.%x'] filename for the output PDF (%i=schematic %x=pdf). Affected by global options
      output: '%f-%i%v.%x'
      # [string=''] Board variant to apply.
      # Not fitted components are crossed
      variant: 'PROD'

Running kibot -s all -d Generated pdf_sch_print_example works, it creates PDF files for both DEV and PROD variants.

Now, let's say we moved to production and want only the PROD variant, I've tried to run KiBot with the -g argument:

$ kibot -s all -d Generated -g variant=PROD pdf_sch_print_example

Unfortunately, it still creates two PDF files instead of just the one for the PROD variant...
I don't know a better way than just removing the output for DEV from the example.kibot.yaml file, is there any other?

Could the better way be to support a list in the variant option of each output?
Something in those lines (similar to KiBOM but in YAML format):

outputs:
  - name: 'pdf_sch_print_example'
      ...
      variant: 
        - 'DEV'
        - 'PROD'

Then it just a matter of updating this variant list to - 'PROD' only.

There is a chance I'm not using this right from the start, please let me know!

GitHub Actions: kicad-git-filters.py: No such file or directory

v0.8.1 runs into this error when executing the Docker image:

/entrypoint.sh: line 144: /usr/bin/kicad-git-filters.py: No such file or directory
Traceback (most recent call last):
  File "/usr/bin/kibot", line 16, in <module>
    main()
  File "/usr/lib/python3/dist-packages/kibot/__main__.py", line 254, in main
    outputs = cr.read(cf_file)
  File "/usr/lib/python3/dist-packages/kibot/config_reader.py", line 196, in read
    outputs = self._parse_outputs(v)
  File "/usr/lib/python3/dist-packages/kibot/config_reader.py", line 87, in _parse_outputs
    outputs.append(self._parse_output(o))
  File "/usr/lib/python3/dist-packages/kibot/config_reader.py", line 67, in _parse_output
    name_type = "`"+name+"` ("+otype+")"
TypeError: can only concatenate str (not "NoneType") to str

This is the GitHub action used:

name: Hardware Checks

on:
  push:

jobs:
  KiBot:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: INTI-CMNB/[email protected]
      with:
        config: 'test.kibot.yaml'
        schema: 'test.sch'
        board: 'test.kicad_pcb'
        dir: output
    - name: upload results
      uses: actions/upload-artifact@v2
      with:
        name: output
        path: output

Close the "libraries not found" window.

I'm trying to use the tool for one of my old projects, but the eeschema becomes stuck at "Not found window":
image
This window also appears in the normal EEschema, and once it and the "remap symbols" windows are closed, the schematic looks fine.

So I think this window should be closed

Expansions in dir

Thank you for the awesome work. More a feature request than an issue.

`outputs:

  • name: 'gerbers'
    comment: 'gerbers'
    type: gerber
    dir: gerber/%i`

creates a folder named %i instead of applying the expansion

Install error 0.10.0-2 AttributeError: 'StreamHandler' object has no attribute 'setStream'

Version 0.9.0-3 working great, tried to update to 0.10.0-2, fails during install on Ubuntu 18.04

$ sudo apt install ./kibot_0.10.0-2_all.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'kibot' instead of './kibot_0.10.0-2_all.deb'
The following packages were automatically installed and are no longer required:
  docutils-common python-babel-localedata python3-alabaster python3-babel python3-docutils python3-imagesize python3-jinja2 python3-markupsafe python3-roman sphinx-common
Use 'sudo apt autoremove' to remove them.
Recommended packages:
  kibom.inti-cmnb pcbdraw
The following NEW packages will be installed:
  kibot
0 upgraded, 1 newly installed, 0 to remove and 62 not upgraded.
Need to get 0 B/249 kB of archives.
After this operation, 1,071 kB of additional disk space will be used.
Get:1 /home/paul/Downloads/kibot_0.10.0-2_all.deb kibot all 0.10.0-2 [249 kB]
Selecting previously unselected package kibot.
(Reading database ... 330020 files and directories currently installed.)
Preparing to unpack .../kibot_0.10.0-2_all.deb ...
Unpacking kibot (0.10.0-2) ...
Setting up kibot (0.10.0-2) ...
Traceback (most recent call last):
  File "/usr/bin/kibot", line 15, in <module>
    from kibot.__main__ import main
  File "/usr/lib/python3/dist-packages/kibot/__main__.py", line 72, in <module>
    logger = log.init()
  File "/usr/lib/python3/dist-packages/kibot/log.py", line 126, in init
    ch.setStream(sys.stdout)
AttributeError: 'StreamHandler' object has no attribute 'setStream'
dpkg: error processing package kibot (--configure):
 installed kibot package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 kibot
E: Sub-process /usr/bin/dpkg returned an error code (1)

PCB print leads to `pcbnew_do: error: unrecognized arguments: --scaling --pads`

I have checked out KiAuto from https://github.com/INTI-CMNB/KiAuto and used the command alias pcbnew_do=PATH_TO_REPO/src/pcbnew_do as per instruction (with PATH_TO_REPO replaced).

However when running the latest head of KiBot (67d879e) with KiBot/src/kibot it prints this error when it gets to pdf printout of the PCB:

[pdf_pcb_print]
usage: pcbnew_do [-h] [--record] [--rec_width REC_WIDTH] [--rec_height REC_HEIGHT] [--start_x11vnc] [--use_wm] [--verbose] [--version] [--wait_key] [--wait_start WAIT_START]
                 {export,run_drc} ...
pcbnew_do: error: unrecognized arguments: --scaling --pads
usage: pcbnew_do [-h] [--record] [--rec_width REC_WIDTH] [--rec_height REC_HEIGHT] [--start_x11vnc] [--use_wm] [--verbose] [--version] [--wait_key] [--wait_start WAIT_START]
                 {export,run_drc} ...
pcbnew_do: error: unrecognized arguments: --scaling --pads
ERROR:pcbnew_do returned 2 (kibot.kibot.out_pdf_pcb_print - out_pdf_pcb_print.py:108)

I'm not sure what the issue is.

Running KiAuto/src/pcbnew_do --scaling --pads just to see what happens, it prints out the same:

usage: pcbnew_do [-h] [--record] [--rec_width REC_WIDTH] [--rec_height REC_HEIGHT] [--start_x11vnc] [--use_wm] [--verbose] [--version] [--wait_key]
                 [--wait_start WAIT_START]
                 {export,run_drc} ...
pcbnew_do: error: unrecognized arguments: --scaling --pads

ibom extra_fields and xml

Awesome project! I ran into a small hiccup when first setting this up where I was getting cryptic error messages when I attempted to use extra_fields with ibom outputs. It turns out that it relies on the bom xml to pull those extra fields, which I don't normally generate, so the fix was to add update_xml to the preflight. It might be nice if extra_fields automatically set update_xml to true, or perhaps just print an error/warning if extra_fields is set without update_xml?

It also seemed like the netlist_file was defaulting to the working directory path instead of the xml file; not sure if this is intentional or if it would be possible/reasonable to default to '%F.xml' instead?

Separately, but kind of related to my debugging process for this issue, is there a way to enable verbose output via the github action? Would be nice to make CI verbose so it's easier to track down failures without having to re-run and reproduce the issue.

Thanks!

PCB without schematics

In my for-science-keyboard example, there are 3 PCBs, but only one of them has a schematics file (the others are just "casing", basically). when I run kibot with a PCB file that has no schematics, kibot grabs the schematics file of the other PCB, from the same directory. it does so, even if I set the schematics file to "" with the command line argument. This can also be seen in the latest CI build output.

.. I am sorry I.. don't work cleanly these days. maybe this is also just a simple oversight by me.

**Cards**

Cards can be added to your board to track the progress of issues and pull requests. You can also add note cards, like this one!

ERROR:Time-out waiting for eeschema, giving up (eeschema_do - eeschema_do:137)

Do you have an idea why this might happen?

The project at the relevant commit:
hoijui/for-science-keyboard@bbc5629

Run [ -f *.sch ] && kiplot -d Fabrication -s update_xml,run_drc -i
Using config file: for-science.kibot.yaml
Using SCH file: for-science.sch
WARNING:`update_xml` preflight is not in use, no need to skip (kibot.kibot.kiplot - kiplot.py:191)
- Running the ERC
ERROR:Time-out waiting for eeschema, giving up (eeschema_do - eeschema_do:137)
Traceback (most recent call last):
  File "/usr/bin/eeschema_do", line 574, in <module>
    erc_file = eeschema_run_erc_schematic(output_file_no_ext, eeschema_proc.pid)
  File "/usr/bin/eeschema_do", line 254, in eeschema_run_erc_schematic
    wait_eeschema_start()
  File "/usr/bin/eeschema_do", line 135, in wait_eeschema_start
    wait_eeschema(5)
  File "/usr/bin/eeschema_do", line 104, in wait_eeschema
    return wait_for_window('Main eeschema window', r'Eeschema.*\.sch', time, others=others)
  File "/usr/lib/python3/dist-packages/kicad_auto/ui_automation.py", line 306, in wait_for_window
    raise RuntimeError('Timed out waiting for %s window' % name)
RuntimeError: Timed out waiting for Main eeschema window window
ERROR:Time-out waiting for eeschema, giving up (eeschema_do - eeschema_do:137)
Traceback (most recent call last):
  File "/usr/bin/eeschema_do", line 574, in <module>
    erc_file = eeschema_run_erc_schematic(output_file_no_ext, eeschema_proc.pid)
  File "/usr/bin/eeschema_do", line 254, in eeschema_run_erc_schematic
    wait_eeschema_start()
  File "/usr/bin/eeschema_do", line 135, in wait_eeschema_start
    wait_eeschema(5)
  File "/usr/bin/eeschema_do", line 104, in wait_eeschema
    return wait_for_window('Main eeschema window', r'Eeschema.*\.sch', time, others=others)
  File "/usr/lib/python3/dist-packages/kicad_auto/ui_automation.py", line 306, in wait_for_window
    raise RuntimeError('Timed out waiting for %s window' % name)
RuntimeError: Timed out waiting for Main eeschema window window
ERROR:ERC returned 1 (kibot.kibot.pre_erc - pre_erc.py:45)
##[error]Process completed with exit code 10.

Import error when running

I'm trying to run Kibot on my laptop (after getting it to run with #30 on my desktop), and now I'm getting:

21:40:59 $ kibot
ERROR:Unable to import plug-ins: cannot import name 'macros' from 'kibot.macros' (/home/stavros/.local/lib/python3.8/site-packages/kibot/macros.py) (kibot.kibot.kiplot - kiplot.py:64)

Unfortunately the import system is so opaque that it takes quite a while to figure out exactly what the problem is, so I can't file a PR at the moment, if anyone knows why this is happening please let me know.

Using pth_and_npth_single_file causes KiBot to crash

When I export with the following config snippet:

  - name: "Drill files"
    type: excellon
    dir: pcb_output
    options:
      pth_and_npth_single_file: True

I get the following error:

Traceback (most recent call last):
  File "/usr/bin/kibot", line 16, in <module>
    main()
  File "/usr/lib/python3/dist-packages/kibot/__main__.py", line 319, in main
    generate_outputs(outputs, args.target, args.invert_sel, args.skip_pre)
  File "/usr/lib/python3/dist-packages/kibot/kiplot.py", line 262, in generate_outputs
    out.run(get_output_dir(out.dir), board)
  File "/usr/lib/python3/dist-packages/kibot/out_base.py", line 55, in run
    self.options.run(output_dir, board)
  File "/usr/lib/python3/dist-packages/kibot/out_any_drill.py", line 106, in run
    os.rename(k_file, file)
FileNotFoundError: [Errno 2] No such file or directory: '<dir>/HEARP_PCB-PTH.drl' -> '<dir>/HEARP_PCB-PTH_drill.drl'

Using Kibot 0.7.0 from the docker image setsoft/kicad_auto

Excellon output not working

The excellon output is not working for me. I have found that if I generate the files using KiCAD's GUI, the kibot script works without complaint. However, if I run it after that it throws this exception.

From the looks of it, it's either that the excellon portion doesn't instruct pcbnew to generate that initial file OR there is a mismatch in file namings with and without "-drill".

Setup:
KiCad 5.1.7-a382d34a887ubuntu20.04.1
KiBot 0.7.0 installed using .deb file
Python 3.8
OS: Ubuntu 20.04.1

Yaml:

  - name: Drill file
    comment: "Create the drill file"
    type: excellon
    dir: outputs/gerbers

Command Line Output:

(Executed kibot without any prep to show error is present)

seth@seth-[comp-name]-5:~/dev/[project name]$ kibot -e [project name].sch
Using config file: outputs.kibot.yaml
- 'Create the schematic PDF' (Schematic_PDF) [pdf_sch_print]
- 'A PDF of the PCB layers with them all combined.' (PCB_PDF_combined_layers) [pdf_pcb_print]
- 'Generate the gerber files for fab. Per PCBWay' (Gerber files) [gerber]
- 'Create the drill file' (Drill file) [excellon]
Traceback (most recent call last):
  File "/usr/bin/kibot", line 16, in <module>
    main()
  File "/home/seth/.local/lib/python3.8/site-packages/kibot/__main__.py", line 319, in main
    generate_outputs(outputs, args.target, args.invert_sel, args.skip_pre)
  File "/home/seth/.local/lib/python3.8/site-packages/kibot/kiplot.py", line 262, in generate_outputs
    out.run(get_output_dir(out.dir), board)
  File "/home/seth/.local/lib/python3.8/site-packages/kibot/out_base.py", line 55, in run
    self.options.run(output_dir, board)
  File "/home/seth/.local/lib/python3.8/site-packages/kibot/out_any_drill.py", line 106, in run
    os.rename(k_file, file)
FileNotFoundError: [Errno 2] No such file or directory: '/home/seth/dev/[project name]/outputs/gerbers/[project name]-PTH.drl' -> '/home/seth/dev/[project name]/outputs/gerbers/[project name]-PTH_drill.drl'

(Generated drill files from KiCAD GUI. kibot executes without error)

seth@seth-[comp name]-5:~/dev/[project name]$ kibot -e [project name].sch
Using config file: outputs.kibot.yaml
- 'Create the schematic PDF' (Schematic_PDF) [pdf_sch_print]
- 'A PDF of the PCB layers with them all combined.' (PCB_PDF_combined_layers) [pdf_pcb_print]
- 'Generate the gerber files for fab. Per PCBWay' (Gerber files) [gerber]
- 'Create the drill file' (Drill file) [excellon]
- 'File for Assembly house.  Also called Centroid file' (Pick n place file) [position]
- 'Generate a step file to import into Solidworks' (Step file) [step]
- 'Generate a BOM for the SMT Assembly House' (BOM_SMT) [bom]
- 'Generate the BOM to be fed into PartsBox.' (BOM for Partsbox) [bom]
- 'Generating a BOM with all meta-data.' (Bom, Complete) [bom]

(Running kibot again immediately without doing anything)

seth@seth-[comp name]-5:~/dev/raspi-carrier-pcb$ kibot -e [project name].sch
Using config file: outputs.kibot.yaml
- 'Create the schematic PDF' (Schematic_PDF) [pdf_sch_print]
- 'A PDF of the PCB layers with them all combined.' (PCB_PDF_combined_layers) [pdf_pcb_print]
- 'Generate the gerber files for fab. Per PCBWay' (Gerber files) [gerber]
- 'Create the drill file' (Drill file) [excellon]
Traceback (most recent call last):
  File "/usr/bin/kibot", line 16, in <module>
    main()
  File "/home/seth/.local/lib/python3.8/site-packages/kibot/__main__.py", line 319, in main
    generate_outputs(outputs, args.target, args.invert_sel, args.skip_pre)
  File "/home/seth/.local/lib/python3.8/site-packages/kibot/kiplot.py", line 262, in generate_outputs
    out.run(get_output_dir(out.dir), board)
  File "/home/seth/.local/lib/python3.8/site-packages/kibot/out_base.py", line 55, in run
    self.options.run(output_dir, board)
  File "/home/seth/.local/lib/python3.8/site-packages/kibot/out_any_drill.py", line 106, in run
    os.rename(k_file, file)
FileNotFoundError: [Errno 2] No such file or directory: '/home/seth/dev/[project name]/outputs/gerbers/[project name]-PTH.drl' -> '/home/seth/dev/[project name]/outputs/gerbers/[project name]-PTH_drill.drl'

PDF files generation fails for sym-lib-table error

I have a very simple project setup to test KiBot, that you can download here.
The KiBot configuration was mostly generated with kibot --example command (I commented out some of the preflight section + some formatting fixes).

However, I'm consistently getting this error when trying to generate PDF outputs:

$ kibot pdf_sch_print_example
Using config file: example.kibot.yaml
Using SCH file: test_project.sch
- Running the ERC
- Updating BoM in XML format
ERROR:At line 11 of `sym-lib-table`: Unknown symbol table entry (kibot.kibot.kiplot - kiplot.py:186)
ERROR:Line content: `
` (kibot.kibot.kiplot - kiplot.py:187)

Running pdf_example gave me this output:

$ kibot pdf_example
Using config file: example.kibot.yaml
Using SCH file: test_project.sch
- Running the ERC
- Updating BoM in XML format
- 'Exports the PCB to the most common exhange format. Suitable for printing.' (pdf_example) [pdf]
WARNING:(W009) KiCad config without EnvironmentVariables section (kibot.kibot.kicad.config - log.py:82)
WARNING:(W010) Unable to find KiCad libraries (kibot.kibot.kicad.config - log.py:82)
ERROR:Unable to expand `KICAD_SYMBOL_DIR` in `${KICAD_SYMBOL_DIR}/Modules.lib` (kibot.kibot.kicad.config - config.py:63)
ERROR:At line 11 of `sym-lib-table`: Unknown symbol table entry (kibot.kibot.kiplot - kiplot.py:186)
ERROR:Line content: `
` (kibot.kibot.kiplot - kiplot.py:187)

So I set the KICAD_SYMBOL_DIR environmental variable the same way as in my KiCad paths ("Preferences>Configure Paths..."), there was some progress but it is still unsuccessful to generate any PDF output:

$ kibot pdf_example
Using config file: example.kibot.yaml
Using SCH file: test_project.sch
- Running the ERC
- Updating BoM in XML format
- 'Exports the PCB to the most common exhange format. Suitable for printing.' (pdf_example) [pdf]
WARNING:(W009) KiCad config without EnvironmentVariables section (kibot.kibot.kicad.config - log.py:82)
ERROR:At line 11 of `sym-lib-table`: Unknown symbol table entry (kibot.kibot.kiplot - kiplot.py:186)
ERROR:Line content: `
` (kibot.kibot.kiplot - kiplot.py:187)

What am I missing? Hopefully you can reproduce on your side.

Also, how do I tell KiBot where my KiCad environmental variables are set?

kicost ist not recognized as a valid output

I am running KiBot on the docker container: setsoft/kicad_auto:latest, which has KiCost v1.1.5 installed. My config.kibot.yaml file includes the following output:
- name: kicost
comment: "KiCost of non JLC components"
type: kicost
options:
currency: EUR

Unfortunately, it produces the following error:
ERROR:Unknown output type: kicost (kibot.kibot.error - error.py:40)

Linux Mint install failure

I have tried to install the kibot_0.9.0-1_all.deb on a couple of Linux Mint 20.1 (Ulyssa) workstations. One was a freshly set up system with minimal addtional packages installed. KiCAD 5.1.5 was installed using the package manager.

The error I am seeing is:

david@xps:~$ kibot
Traceback (most recent call last):
File "/usr/bin/kibot", line 15, in
from kibot.main import main
File "/usr/lib/python3/dist-packages/kibot/main.py", line 71, in
from .kiplot import (generate_outputs, load_actions, config_output)
File "/usr/lib/python3/dist-packages/kibot/kiplot.py", line 47, in
m = re.search(r'(\d+).(\d+).(\d+)', pcbnew.GetBuildVersion())
AttributeError: module 'pcbnew' has no attribute 'GetBuildVersion'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_kibot.1000.crash'

Original exception was:
Traceback (most recent call last):
File "/usr/bin/kibot", line 15, in
from kibot.main import main
File "/usr/lib/python3/dist-packages/kibot/main.py", line 71, in
from .kiplot import (generate_outputs, load_actions, config_output)
File "/usr/lib/python3/dist-packages/kibot/kiplot.py", line 47, in
m = re.search(r'(\d+).(\d+).(\d+)', pcbnew.GetBuildVersion())
AttributeError: module 'pcbnew' has no attribute 'GetBuildVersion'

I have tried searching for existing solutions with out luck. The above error is seen when I try to run kibot with no arguments but also appeared when I installed git using apt.

I apologise if this the wrong place to request help but could not see anywhere else that seemed appropriate.

Is there a way to point to a KiBOM config file?

I'm currently trying to generate BOMs using KiBOM and I see a config.kibom.ini file being generated.
The problem is KiBot never reads this file, it just overwrites it everytime it runs.
By any chance, is there a way to tell KiBot to use a pre-defined KiBOM config file?

Something in those lines could work:

$ kibot -s all -d Generated -g kibom_config=bom.ini kibom_example

Interactive HTML Bom plug in not found

I have the Interactive HTML Bom plug in installed and it working correctly from inside the KiCAD application. However KiBot throws this error:

ERROR:No generate_interactive_bom.py command found.
Please install it, visit: https://github.com/INTI-CMNB/InteractiveHtmlBom (kibot.kibot.kiplot - kiplot.py:126)

The install instructions suggest running:
import pcbnew
print(pcbnew.PLUGIN_DIRECTORIES_SEARCH)
And inside KiCAD this shows the path where I have installed the plugin, which is ~/.kicad_plugins.

I tried modifying kiplot.py with extra output:

def check_script(cmd, url, version=None):
import pcbnew
print('Plugins directories = [' + pcbnew.PLUGIN_DIRECTORIES_SEARCH + ']')
if which(cmd) is None:

The relevant output before the error is thrown is:
Plugins directories = []

Please let me know if you need any further information.

Thanks
David

Malformed wire ERROR

Hi,

While using Kibot to generate my project output files I ran into this error:

ERROR:At line 304 of /home/cferrer/Desktop/PCBs/safety_switch.sch: Malformed wire (kibot.kibot.kiplot - kiplot.py:202) ERROR:Line content: Wire Notes Line rgb(255, 0, 0) (kibot.kibot.kiplot - kiplot.py:203)

It seems Kiplot doesn't support colored Wire Notes Line/Graphic Polyline.
I traced back the error to line 1174 in the v5_sch.py file,

KiBot/kibot/kicad/v5_sch.py

Lines 1174 to 1176 in 1d44a6a

res = _split_space(line)
if len(res) != 3:
raise SchFileError('Malformed wire', line, f)

Because "Wire Notes Line rgb(255, 0, 0)" have an extra argument specifying the line color, the length doesn't match 3.
I fixed the issue by adding an additional condition:

        if len(res) != 3:
            if len(res) > 3:
                print(res, "rgb" in res[3] or "width" in res[3])
                if not("rgb" in res[3] or "width" in res[3]):
                    raise SchFileError('Malformed wire', line, f)
            else:
                raise SchFileError('Malformed wire', line, f)

It would be nice if colored Wire Notes Line would be supported.

Change 3D model with filter or variant

Is it possible to change the 3D Model of some components based on a filter which can be applied to a variant?

Lets say we have a board with different connectors, which share the same footprint but have different 3D models. Is it possible to change the displayed 3D models for this connectors or should there be two footprints on the board which are overlapping and we filter out all footprints that don't have the right 3D model?

timeout in DRC on fairly complicated board

Hi, thanks for an awesome tool.

I'm seeing a timeout running DRC on a 4 layer board (https://github.com/TomKeddie/prj-artix7-pcie/tree/master/hardware/v2).

  File "/usr/local/lib/python3.8/dist-packages/kiauto/ui_automation.py", line 313, in wait_for_window
    raise RuntimeError('Timed out waiting for %s window' % name)
RuntimeError: Timed out waiting for Report completed dialog window

I couldn't see an option to extend this time, if I hack the script as below it passes (with expected warnings). If we don't already have one, perhaps we need an option to extend the timeout for more complicated boards (and/or slower PCs).

def wait_for_window(name, window_regex, timeout=20, focus=True, skip_id=0, others=None):
tom@z400:~/git/TomKeddie/prj-artix7-pcie/hardware/v2$ kibot --version
KiBot 0.9.0 - Copyright 2018-2020, Salvador E. Tropea/INTI/John Beard - License: GPL v3+

Make the example.kibot.yaml ready to use?

I have KiBot 0.9 up and running on Ubuntu 18.04, here is what I get after generating the example KiBot config:

$ kibot -x
Creating /<my-path>/./example.kibot.yaml example configuration

$ kibot --list
Using config file: example.kibot.yaml
ERROR:Error loading YAML while parsing a block mapping
  in "example.kibot.yaml", line 6, column 3
expected <block end>, but found '<scalar>'
  in "example.kibot.yaml", line 19, column 9 (kibot.kibot.error - error.py:40)

The issue is with those lines in the example.kibot.yaml config files:

preflight:
  ...
  # [boolean=false] Update the XML version of the BoM (Bill of Materials).
        To ensure our generated BoM is up to date.
        Note that this isn't needed when using the internal BoM generator (`bom`)
  update_xml: true

After commenting them:

preflight:
  ...
  # [boolean=false] Update the XML version of the BoM (Bill of Materials).
  # To ensure our generated BoM is up to date.
  # Note that this isn't needed when using the internal BoM generator (`bom`)
  update_xml: true

It works fine!

$ kibot --list
Using config file: example.kibot.yaml
Available actions:

Pre-flight:
- check_zone_fills: True
- filters: True
- ignore_unconnected: False
- run_drc: True
- run_erc: True
- update_xml: True
Outputs:
ERROR:In section 'bom_example' (bom): Option `columns` must be any of ['list(dict)', 'list(string)'] not `dict` (kibot.kibot.error - error.py:40)

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.