Compiling Typica for Linux

Posted: April 24, 2016 in coffee roasting, linux, tech, Typica
Tags: ,

This blog is about compiling the 1.7 release of Typica and the Phidgets libaries for Linux. Neal is currently working and hoping to release 2.0 sometime in the future and all this will drastically change.

Linux is a fantastic community driven operating system. It is Free and Open Source Software (FOSS), meaning someone cannot charge for the software and also provide you the source code to do what you want with it.

Typica is also FOSS. Neal provides binaries that will run in the Mac OSX world and Windows world so that  you do not have to compile it. And this works for probably 90% of the people.

I like Linux for many reasons — the freeness, the freedom, the community driven development, and also the ability to re-use hardware that might not run the ever larger and slower Windows or Mac OSX operating systems. Sometime the cast away hardware from those operating system spheres still has good life left in it and it doesn’t have to be junked.

I was using the Mac Mini for my database server and am still using an Dell laptop for my Linux compile environment and roast-logger. It is a very old system, while this XT has a touch screen it is only a 32-bit CPU. If you follow my guide you will have to keep this in mind and figure out some of the 64-bitness differences. Feel free to leave those as comments to this article.

I am using Linux Mint, a debian/ubuntu based system.

Install Packages

You will need to update your system to the latest release. Following that, install some additional packages.

sudo apt-get update
sudo apt-get upgrade
(possibly reboot)
sudo apt-get install libqt4-sql-psql libqt4-dev libqt4-dev-bin \
 libusb-1.0-0-dev libc-dev-bin gcc-multilib g++-4.6 g++ \
 libqtwebkit-dev libqtwebkit4

 

Source Setup

You need a directory for source code if  you do not already have one. Make a directory called something like “src” in your home directory unless you have a preference already setup. In this directory you will setup two trees — one for Phidgets libraries and one for Typica itself.

Phidgets Library Compiling

Go ahead and open a terminal window and CD into your source (or src) directory. You need to download the latest  Phidgets source into this directory. I like to browse to their page for Linux support and copy the URL and then use “wget” to fetch the file to my current directory on the system where I will compile. It saves a step or two of having to copy it later.

The current directory is here, but that could change and you can use Google or whatever search engine you like best in the future… Once you have downloaded the file, extract it, cd into the new directory, and compile the libaries. Since you have installed all the packages listed above, it should just be as simple as the instructions on the Phidgets site, also included below:

wget http://www.phidgets.com/downloads/libraries/libphidget.tar.gz

tar xfvz libphidget.tar.gz

cd libphidget-2.1.8.20151217

./configure

make

sudo make install

If your Phidgets source directory looks differently than mine you will need to update that in the instructions below for Typica where we modify the project to include the headers for Typica.

Typica Compiling

You should “cd” up one directory to the “src” parent directory. Now download the Typica (probably 1.7) source code from the Git site. If you hover over the “Download Zip” link this should be a URL to a “master.zip”; copy the URL and use it with wget again. After downloading the zip we will uncompress it which will create many directories. We will “cd” into the first level and then into the src sub directory and we will create a backup file of one file that we will change.

 wget https://github.com/N3Roaster/typica/archive/master.zip


unzip master.zip


cd typica-master/src


cp Typica.pro Typica.pro.orig

Now we are ready to get nitty gritty. In previous blogs I was able to get around the Vi vs. Emacs vs. Nedit debate by having you use an echo command to append new statements to a file.  This appears to hold true. So even though I would really love to make sure you embrace the power of the Vi side, I will again use the echo-append statement in my examples for brevity’s sake. It is very important that the you add three separate and distinct lines to the file.

echo "include(3rdparty/qextserialport/src/qextserialport.pri)
INCLUDEPATH += /home/kevin/src/libphidget-2.1.8.20151217/
LIBS += -lphidget21
" >> Typica.pro

You are now ready to build the Makefile and then compile the program. First you execute the “qmake” program to create the Makefile, and then you run the “make” program to compile the code into executable binaries.

qmake

make

Bam! You are ready to execute the new compiled program. Unfortunately because of the libraries you will need root privilege again, so you must execute the “Typica” binary with sudo in order to run it as yourself but with root privileges.

sudo ./Typica

If everything worked successfully, the program is now running and asking how to connect to your database.

 

 

Advertisements
Comments
  1. n3roaster says:

    I’ve noted a couple of corrections at http://appliedcoffeetechnology.tumblr.com/post/143386855619

    Specifically, there’s no need to link libphidget at compile time and how to configure udev so you don’t need to run Typica as root.

    • kevincreason says:

      Thanks! The root privilege was definitely one of the next things to solve.
      I’ll defer to your knowledge on the erroneous linking. I may have added that to solve some other issue on my system, or more likely a non-issue.
      Once I’ve fixed the udev privilege information and update the instructions with those steps, I will look at that and hopefully strike it from the instructions.

  2. dan says:

    Thanks Neil and Kevin! This was the one thing keeping me from my workflow being 100% Linux 🙂

  3. kevincreason says:

    dan, I wasn’t familiar with that name but they look familiar. Though coffee roasters don’t differ too much in appearance.
    I’m a complete home roaster — old Sante Fe propane grill with an RK drum.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s