Install Freerouting on Ubuntu 14.04 – 16.04

Introduction

Freerouting was a web application created and maintained by Alfons Wirtz at his website, here.  It allowed us to import a design file from kicad and then auto-route the project based on some design preferences.  It was basically a free auto-router for kicad.  Hence the name!

For “various reasons” the author has decided to drop the project, and it is no longer available as a web application at his site.  However, he has been kind enough to open-source the project and he encourages users to run it as a local application.

There are some wikibooks instructions for installation of the Freerouting application here.  I have recently attempted to follow these instructions, but there are some stumbling-blocks which prevented me from being able to run a working application.  I believe these same stumbling blocks will face lots of people; at least those who decide to install it on a recent Ubuntu variant.

This blog will detail all of the instruction steps necessary to run a working local copy of Freerouting.  My instructions are based on those at Wikibooks, but with some extra steps to get around the stumbling blocks.

The Pre-Requisites

You can skip this part if you already have installed a recent version of:

  1. Git
  2. Java JDK
  3. Netbeans

Otherwise, read on!

Installation of Git

Use your package manager, as follows:

sudo apt-get install git

Installation of Java JDK & Netbeans

This post used to direct you to install the JDK and Netbeans packages separately, but all of a sudden this method stopped working.  When I queried it with the Netbeans team they refused to admit any problem, but suggested the “combined package” instead.  Well, I don’t agree there isn’t a problem but the combined package does work so let’s do that instead!

First you need to locate the JDK & Netbeans combined package.  At the time of writing this post, you can get it here.

Once you’ve downloaded it, you need to make sure that you have permissions to execute it.  To do that, ‘cd’ to the directory where you downloaded the installer, and then type the following command, substituting for your version of netbeans if it’s different from mine:

chmod u+x jdk-8u111-nb-8_2-linux-x64.sh

Then execute the installer:

./jdk-8u111-nb-8_2-linux-x64.sh

You should see a screen something like this:

JDK & Netbeans Combined Installer
JDK & Netbeans Combined Installer

Walk through the installer dialogue to completion.

Installation of Freerouting Dependancies

The freerouting application depends on a couple of things to work.  It requires jh.jar and netx.jar.  To get those, install the following:

sudo apt-get install javahelp2 icedtea-netx-common

Installing FreeRouting & Running in NetBeans

Downloading FreeRouting

Now you need to download freerouting.  It’s available on github, so you just need to ‘cd’ to a directory where you want to download the project, and then enter the following command:

git clone https://github.com/nikropht/FreeRouting

Loading FreeRouting into NetBeans, Compiling and Running

Now you need to start netbeans (should be under ‘Development’ in the application launcher) and import the FreeRouting project.

  1. With netbeans open, select File -> New Project or use the keyboard shortcut CTRL-SHIFT-N.
  2. In the Categories window, select ‘Java’.  In the Projects window, select ‘Java Project with Existing Sources’.
    Select Next.
  3. Give your project a name.  e.g. FreeRouter, and choose a path.  e.g. $HOME/programming/netbeans_projects/
    Select Next.
  4. In the Source Package Folders area, select Add Folder and browse to the place where you downloaded the FreeRouting sourcecode from git.
    Select Finish.  Netbeans will create the project.
  5. Select File->Project Properties.
    In the categories area, select Libraries.  Then, with the compile tab displayed in the area on the right, select ‘Add JAR/Folder’.  Browse to and choose /usr/share/java/jh.jar.
  6. This next part is not explained in the wikibooks instructions I linked to at the beginning of the post.  But it is absolutely necessary in order for FreeRouting to work.  While still in the Libraries area, Select ‘Add JAR/Folder’ again.  Now browse to /usr/share/icedtea-web/netx.jar.
  7. Now, contrary to the instructions in the wikibooks link, we are NOT going to use Web Start:
    While still in project properties (File->Project Properties), select from the categories area, underneath Application, ‘Web Start’.   Make sure this check box is NOT enabled.  Then Select ‘Run’ from the categories area and make sure the Configuration pull down menu is set to <default config>
    Select OK to exit Project Properties.
  8. Now from the netbeans main menu, choose Run and select “clean and build project”.  If all has gone well, it will conclude with “BUILD SUCCESSFUL”.  Now you can run the application: select the green triangle or press F6 to run the project.  You should see the following:

Freerouter_004

Success!

Now you just need to learn how to use Freerouter! I got it routing a PCB pretty quickly without instructions so I think it is pretty intuitive to run.  However, it may not be so intuitive to choose all the correct options for your PCB.  That’s for another post, maybe.

Installing daily build of KiCAD [Ubuntu]

I noticed, recently, that KiCAD footprint libraries now carry the .pretty extension, and that these files cannot be read by the latest stable release of KiCAD.  In order to make use of these libraries it is necessary to install a recent build of KiCAD, which has undergone a significant overhaul of its footprint library support.

As a new Ubuntu user, it was not clear to me how one would go about installing a daily build of KiCAD.  The instructions on the KiCAD website state:

Old stable should be in the official Ubuntu repo. Daily builds are available in js-reynaud’s PPA.

But how can you go about adding this PPA? And, once the PPA has been added, how do you then use it to install a new-build of KiCAD?

Here are the steps you need to take.

Adding the PPA

First you need to add the PPA.  You are going to run a command that will add a new PPA for KiCAD to your linux sources list, so that apt-get will use it to install future versions of KiCAD.  To add the PPA, open a terminal and type:

sudo add-apt-repository ppa:js-reynaud/ppa-kicad

Follow the on-screen instructions, and your result should look something like:

Add reynaud PPA
Add reynaud PPA

 

Install daily build

Once the PPA has been added, you first need to update apt so that it knows about the new versions of KiCAD in your PPA.  To do that, type:

sudo apt-get update

You will see a lot of output in the console.  Don’t worry; the apt service is just busy hitting all of your sources and updating itself so that it knows about all the latest software.  When it gets to the PPA you just added, it’ll update its knowledge of available KiCAD versions.

Once apt has updated, installing the daily build is then as simple as typing the following into your terminal:

sudo apt-get install kicad

Follow the instructions, agreeing where necessary, and then you should be up and running with a new version of KiCAD