KiCad has some built-in auto routing capabilities for laying out PCB wires. More advanced version, online auto-router from www.freerouting.net, can cooperate with KiCad and gives better results. FreeRouter however does not work in offline even after copying Java Web Start resources to local system; auto-router still checks internet access on startup. Irritated I hacked binaries and got rid of online check. Now you can make your auto-router working anytime.
Last year I started my play with home-made PCBs with EaglePCB, very popular software among hobbyists. I am working on project that may go commercial so I decided to move to KiCad because of obvious reason: licensing. EaglePCB has spoiled me with auto routing capabilities which I was using in first attempts to lay out wires on prototype boards to save on time. Online auto-routing does no satisfy my needs so I decided to make my offline version inside KiCad installation.
First step was is get Java Web Start resources. Get these four resources downloaded:
and placed in ./bin of KiCad directory. You can find freeroute.jnlp existing in KiCad installation, this way GUI starts auto-router; we are about to replace it. Next, modify both JNLP files to make codebase referring to local resources i.e. replace codebase=”http://freerouting.net/java” with codebase=”file://localhost/your_path_to_kicad_bin”. Make sure you use absolute path and path does not contain white spaces, otherwise Java Web Start will not pick up JAR files; in my case it is codebase=”file://localhost/C:/Developer/KiCad/bin”.
At this point it will not work yet. You can disable network in your OS, run KiCad, enter pcbnew to open auto-router and after accepting Java security messages router will start just to display: Internet connection required to start the Freerouter application!
With network sniffer I have discovered it only accesses website at the beginning just to read http://www.freerouting.net/java/online_check.txt file. Whether the author intent was to make placeholder for some logic to be placed on server-side later, to collect some usage statistics, or whatever else, from user perspective working while traveling it is pain in the ass.
I took a look inside decompiled code just to confirm my observation: the application denies work if UserOnline class cannot reach out to text file on the web. Since the JARs are not sealed (signed) I have created replacement version of this class just to confirm it works fine in complete offline.
Last steps you need to do is to take this UserOnline.class, browse the router.jar content with any archive tool like 7-zip, replace original class router.jar!/gui/UserOnline.class and save. Voila! Launch auto-router again and it works in offline perfectly now.
Disclaimer: As of writing of this article I could not verify if hack breaks licensing model of FreeRouter in any way as the www.FreeRouting.net website does not verbalize license or limitations in any way.
The freerouting project is gone, could you please upload these files for us
I know project is gone and it is a pity. I am not comfortable spreading software I do not have rights to. Either contact Alfons Wirth, the author of this excellent software, or google for copy of freerouter which is still cached in the vast internet like here -> http://n8vem-sbc.pbworks.com/w/browse/#view=ViewFolder¶m=FreeRouting-net
At least in the KiCAD forum, Alfons has said repeatedly that he had GPL licensed the code.
I don’t know if he had the license posted on his website, or if he actually did all the steps in the instructions on how to mark the executables as GPL’d but that doesn’t really matter.
The important thing is that under the GPL, you DO have rights to the software as long as you post the source for any modifications. That is the point of the GPL.
At most, if you were to post the modified code with source is that it would be considered as a “fork” of the original project.
Oh, I missed the fact it was GPLed. I am not sure how it would adds to the story between Alfons and his ex-employer if someone republishes code/binaries that was asked to be removed. My own offline copy is nearly one year old and never updated as it works as expected that’s also why I redirect people to latest-greatest somewhere in the internet.
I searched and could not find the router files and such. It would be nice if you could share your files…I use freepcb.
You still can get source code like here –> https://github.com/nikropht/FreeRouting compile it and create own java jars. If you have no clue how to do this even with “readme” file, then you can get my copy from here –> https://www.sendspace.com/file/ibk1rl
Java 7. Unable to launch the application. I should use java 6 ? How can I pass this error?
It works with JDK7, I still use it (instead of Java8). What error do you have, just “unable to launch the application”? Have you enabled java console from java control panel?
Than you for your answer. The problem was like you sad. “codebase=”file://localhost/your_path_to_kicad_bin”. Make sure you use absolute path and path does not contain white spaces, otherwise Java Web Start will not pick up JAR files; in my case it is codebase=”file://localhost/C:/Developer/KiCad/bin”.”
More detailed this line “file://localhost/C:/Developer/KiCad/bin”. Instead of developer i had to put Program Files.
If i remember well there where 2 files where i did this minor modification.
how about in linux? i use debian.
i tried “codebase=”/usr/local/bin”” where kicad excutable is installed, but it didn’t work.
(java runtime 6 installed)
I guess protocol is missing i.e. file://usr/local/bin
i installed jdk 7 and it worked. i don’t know why but java webstart asked for version 7 of jdk.
thanks for the tutorial, it helped a lot.
I used freerouter in offline mode for a project, but, when I sent my gerbers to the PCB vendor they didn’t include the routing layer.
I had previously designed this board before freerouter went offline and swapped that layer. I didn’t change that part. I had to redo the gerbers because I had a couple extraneous drill holes outside the board area and was missing a board outline layer.
The PCB vender couldn’t use the old txt file for the routes.
I was told the output is a .ses file, but, gerbview can’t read it. I’m not really sure where standalone autorouter would have saved any output or what it might have been called.
Just to further complicate things, I had to re-install my OS (mint 17.2). I do have a file backup from when I did the autooute work. I just don’t know what to look for.
Can anyone help?
You do not need Freerouter to re-create gerber and drill files. Freerouter is about automatic traces generation and it co-works with Kicad — you export DSN file from Kicad to Freerouter, autoroute there and then import back SES file to Kicad pcbnew. All that is well covered here.
So if you have KiCAD project, you need to modify it as expected and regenerate drill files (using plot function in pcbnew). If you have lost PCB design (.kicad_pcb file) but you have session file from Freerouter, then you can open empty PCB design, import back .ses file and generate gerber again, as documentation says.