There is another tool, at least for schematics. It is not web-based, though.
It would be useful to have a piece of Javascript to display a KiCAD schematic in the browser. Convert it to SVG and let the browser render the SVG. Great for discussion forums. Textbooks and how-to articles could use them. Github should have a viewer for them.
Board layout display isn’t as useful. People discuss and exchange schematics. Board design files go to the fab shop, and if there are problems, you need full EDA tools to deal with them. If you just want to show a board, you post an image.
eyrie is already pretty good displaying kicad boards, even very complex ones
It looks like stemn could handle the 3D assembly of a board, which eyrie doesn’t since its no easy task.
Thanks for the information everyone. I think I’ll start looking into what it would take to script the conversion of schematics to SVG.
This might help:
http://scottbezek.blogspot.si/2016/04/automated-kicad-schematic-export.html
https://scottbezek.blogspot.si/2016/04/scripting-kicad-pcbnew-exports.html
There is this project too which does some clever plotting of a visual diff to pngs between schematic revisions.
It seems that somebody was already working on eeschema and pcbnew command line interface, but their work has not been included in the release versions.
https://lists.launchpad.net/kicad-developers/msg06052.html
I am mostly posting this as a starting point for anybody looking for this feature and since not finding it has the time and means to implement it.
I experimented with UI automation and eeSchema (Scott Bezek’s blog post), and hit a major problem (for me anyway). UI automation will work in headless mode when a monitor is not installed, but not in a purely console-only environment. I suspected that when looking at the readme for Scott Bezek’s project, but I went ahead and tried it anyway.
I’m still working through the other links that have been posted, and will check out eeshow next.
I actually had to install xvfb to get the script to run. The script is supposed to handle running xvfb, but I also tried running it manually.
Xvfb :1 -screen 0 1600x1200x32
Maybe I’m just using xvfb wrong? I’ve tried several iterations of the command above, but I keep getting this:
Error: Can't open display: (null)
Sounds like maybe the DISPLAY
environment variable isn’t getting set?
Ah, remembered the DISPLAY environment variable after posting the last message.
export DISPLAY=":0.0"
After running this Xvfb line
Xvfb :0 -screen 0 1280x1024x32
I’m at least getting non-display related errors now.
@ppelleti I think you and I hit post at the same time. Thanks!
I’ll report back once I work through these other errors.
Here’s what I did to get the export_schematic.py script working on a headless Ubuntu 16.04 minimal VM.
1. sudo apt-get install kicad
2. sudo apt-get install xvfb
3. sudo apt-get install xdotool
4. sudo apt-get install imagemagick
5. Xvfb :0 -screen - 1280x1024x16&
6. export DISPLAY=":0.0"
Additionally, to run the generate_svg.py script that seems to export the PCB file, I had to install Inkscape.
7. sudo apt-get install inkscape
Next step is accepting an arbitrary file to convert. The existing scripts focus on the hardware project the scripts are embedded with.
I’ve got a script working on Ubuntu Server 16.04 (headless, text-only) which will convert a .sch file to a .svg file.
However, the eeschema file that I create on my Ubuntu 16.04 desktop throws an error about the motors library not being present. I’ve included the version info for each eeschema installation below. My question is how should I set the Ubuntu server KiCAD installation up to minimize the problems that users would have doing a conversion? Are there standard libraries that I need to install? Do I need to force the server to run the latest version of KiCAD? Once this script is working well the next step will be to wrap it in a sample Node.js app so that it can be used as a web service. I’d like to have instructions on how to install KiCAD available so that as many users as possible will be covered.
Ubuntu Server 16.04:
Ubuntu Desktop 16.04:
The -cache.lib file should come along the .sch file. All you need to do is parse .sch files and place the -cache.lib as the topmost library. You should also add -cache.lib to .pro file at the top of the list. This way the eeschema will find all of the symbols. It might still complain about not finding the rest of the libraries.
@MitjaN I’m showing my inexperience with KiCAD here. How do I place the *-cache.lib file as the “topmost library”? I tried creating a lib_sch directory and set the library search path as described in this Hack-a-day post.
When you talk about adding *-cache.lib to the .pro file, do mean adding it as the value for LibDir here in the text of the .pro file?
[eeschema]
version=1
LibDir=
[eeschema/libraries]
LibName1=power
LibName2=device
LibName3=switches
LibName4=relays
LibName5=motors
Or should there be a “LibName0” entry that points to the cache library file?
You need to set LibName1 as the highest priority library, and shuffle the rest down or remove them. The simple way is:
Leave LibDir blank and put the cache name in LibName1. e.g. for a project called “symgen”
[eeschema]
version=1
LibDir=
[eeschema/libraries]
LibName1=symgen-cache
Note that the path in LibName1 can also be full filesystem path, or relative to any of the library search paths, but always excludes “.lib” extension. KiCad automatically adds the path of the current project and standard KiCad installation libraries to the library search path. (I use Windows but the same principle applies, use forward slash “/” for Unix or Windows)
@bobc That worked great, thanks. I’ll have to figure out how to edit those library entries in the .pro file when it’s uploaded with the rest of the project files. I’ll probably use sed for that task.