Announcing kicad_freerouting-plugin

kicad_freerouting-plugin

  1. based on the previous work
    Pcbnew export/import scripting functions

  2. an endless saga of “To route free or Not to be”
    https://forum.kicad.info/search?q=freeroute

  3. now receives a new chapter
    https://github.com/random-builder/kicad_freerouting-plugin

  4. plugin currently requires a build from master:
    https://github.com/random-builder/kicad_freerouting-plugin/blob/master/doc/build-options.md

  5. please test and post any issues
    https://github.com/random-builder/kicad_freerouting-plugin/issues

4 Likes

Nicely done. The icon seems inspired by google maps :smiley:
I actually have a board to do soon and will give this a try.

1 Like

Question about wx.CallAfter, wx.App() and zombie process issue.
Do you really need to do export/subprocess/import it in gui-safe thread? I thought you only have to do it when you are actually touching any of wx gui but your plugin doesn’t.

1 Like

will give this a try

great, please do

when you are actually touching any of wx gui

you are right about wx.App()

but your plugin doesn’t touch any of wx gui

that happens in PCB_EDIT_FRAME::ImportSpecctraSession//Refresh()

I see. That is actually issue of gui and app logic separation in KiCad. Refresh call should be factored out into whatever the caller of ImportSpecctraSession() is.
Pcbnew does refresh automatically on action script completion so that would just work for your plugins.

FYI: Plugin Update: release version v2

Improvements

  • Better error handling #3

Bug Fixes

  • Test for accessible pcbnew API, prompt to update kicad if needed #2

Special thanks to @qu1ck for help with this release.

1 Like

I installed the freerouting plugin from git and it does show up as an extra tool button. However, I have two issues:

  1. When I try to invoke the freerouting plugin by clicking on the tool button, I get an error message that python plugins for exporting DSN files and importing SES files are missing, with the recommendation to try the nightly (potentially unstable?) build, which I am not about to do. However, I still can export the layout as a DSN file manually. No biggie, though, because I can start up the freerouting plugin manually.

  2. When I tried to import the DSN into the freerouting plugin (after starting the latter manually from the ‘~/.kicad_plugins’ directory), I got an error message that freerouting found the illegal character “μ”, which I indeed use in a couple of net names. Aren’t today’s environments supposed to be fully UTF-8 compatible?

Information about my KiCAD:

Application: kicad
Version: 5.1.2-f72e74a~84~ubuntu16.04.1, release build
Libraries:
wxWidgets 3.0.2
libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.15.0-50-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
Boost: 1.58.0
OpenCASCADE Community Edition: 6.8.0
Curl: 7.47.0
Compiler: GCC 5.4.0 with C++ ABI 1009

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
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=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

build settings:

issue tracking:

2 Likes

resolved: v3

Hello,

I’m trying to use your plug-in, thank you for developing it! However, I found it very difficult to set up the building environment like yours. Is it possible for you to share a docker file for easily set up a KiCAD for your plug-in? Or, is there a way to use your plug-in without building the KiCAD from scratch? Thanks!

You can just install a prebuilt nightly from kicad download page.

Hi qu1ck,

Thanks for the quick reply! I do find the Python API in the nightly build, but when I try to export DSN, it always reports False…

The Python console showing below stuff, and my environment is Windows. Any idea about this? Thank you!

$ ‘/c/Program Files/KiCad/bin/python.exe’
Python 2.7.15 (default, Oct 11 2018, 12:09:51) [GCC 8.2.0 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

import pcbnew
pcbnew.LoadBoard(“bm3.unrouted.kicad_pcb”)
<pcbnew.BOARD; proxy of <Swig Object of type ‘BOARD *’ at 0x0000000003ff6150> >

pcbnew.ExportSpecctraDSN(“test.dsn”)
False

You have to do it from pcbnew scripting console, that API doesn’t work if there is no pcbnew window.

1 Like

Got it. It works on the pcbnew scripting console! Is there a way to make it work on the pure command line environment, like a workaround? I’m looking for a command-line solution that can translate from .kicad_pcb or .brd to .dsn. Originally, I think KiCAD-python can do so, but it seems not…

Currently there is no way to do it from cli only. (Unless you are willing to do what some mad lads at kicon did with launching pcbnew in fake X server and emulating hid events to navigate the ui).

You can file a bug/feature request on launchpad to refactor that API to make it usable without active pcbnew window. Or if you are comfortable with cpp you can fix this method so that it doesn’t need a valid s_PcbEditFrame pointer.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.