This page contains the neccesary step to install a realtime linux system with EtherCAT
Installing a linux distribution
Ubuntu 10.04 LTS
Ubuntu is an operating system developed by the Ubuntu community. Based on Linux and GNU software Ubuntu is perfect for most PC's and laptops. It contains all the applications you need, a modern web browser, email package, programs for photo editing and important to us: all the tools for programming. Ubuntu is developed with focus on security. LTS (Long Term Support) versions will be three years provided with security updates. These LTS versions are free and available for everyone. Upgrades to new versions of Ubuntu will always be free.
This part describes how to install and configure Ubuntu 10.04LTS with rt-kernel. The last LTS (Long Term Support) version with rt support during the writing of this document is Ubuntu version 10.04 (Lucid Lynx). It is also possible to install Ubuntu Studio. This version for audio- and video editing is still equipped with the Linux kernel-rt
Download and install ubuntu-desktop-amd64.iso 10.04.2 (64 bits) or ubuntu-10.04.2-desktop-i386.iso (32 bits):
Download the latest updates via the Synaptic Package Manager. Package updates are allowed. Do not upgrade e to a higher Ubuntu version eg 10.10. Download and install Linux-rt via the Synapic Package Manager. Restart Ubuntu and repeatedly press the Shift button. You'll come into the Grub boot manager menu. Select the rt kernel version.
Check the kernel version in a terminal with:
Change standard kernel to start by installing the package startupmanager
A manual for installing Ubuntu on embedded pc's can be found here: Install manual for Ubuntu on embedded pc
Download and install via the Synaptic Package manager:
Nautilus file browser. (This is useful as superuser) gcc and g++ 4.1 (For Matlab 2007b) java-1.6.0-sun or sun-java6-bin (using Matlab and smartSVN) smbfs (for connection to Windows shares) libgtk2.0-0 (for future version of E-scope) libpq5 libpq-dev
Some packages are not available with the default settings. Check also: Pre-released updates (lucid Proposed) and unsupported updates. Also check the boxes at the tab other software.
After doing this, press reload at the main screen of Synaptic Package manager.
Check java version:
Unfortunately, the standard sun-java packages have been removed from the Ubuntu repositories (replaced by openJDK). To install Sun Java, do the following in a terminal window:
sudo add-apt-repository ppa:ferramroberto/java sudo apt-get update sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-plugin
If you accidently installed multiple java versions, you can use the command
sudo update-alternatives --config java
to choose the correct java version system wide.
Two versions of gcc and g++ are installed. These are gcc and g++ 4.1 and 4.3. The default version is probably the highest 4.3. Matlab2007b MEX only works with gcc and g++ version 4.0 to 4.2.
Check the default used version:
gcc --version g++ --version
Force a symbolic link to version 4.1 in the /usr/bin directory:
cd /usr/bin ln -sf gcc-4.1 gcc ln -sf g++-4.1 g++
Currently three versions of Matlab are supported: 2007b and 2010a (experimental support only), 2011b (preffered). Choose a supported version.
Installing Matlab 2007b
Matlab 2007b is availiable at:
Use samba to the connect the wtbfiler:
taskbar, places, connect to server, windows share (samba)
Type server wtbfiler, leave the other fields empty and connect. Domain Name, Username and Password should be filled on the next page otherwise it will not work.
Copy the Matlab folder temporarily to your Home directory.
Check your permissions:
Make sure the installation files are executable and change your permissions if necessary:
chmod 755-R /home/username/matlab2007b
Create a new directory to install Matlab:
Also make a directory for the license file
copy the licence.dat in this directory. The license.dat on the wtbfiler may be incorrect, please check that the keyword INCREMENT starts on a new line.
It's possible to do this on the commandline. It is more convienient to use the Nautilus file browser. Open a new terminal start nautilus and copy the file:
sudo nautilus Password:
Open a terminal and install Matlab2007b:
Create a symbolic link for matlab in /usr/bin (Matlab starts from any directory):
sudo su Password: cd /usr/bin ln -s /usr/local/matlab75/bin/./matlab /bin/matlab
Start Matlab (as root):
If your matlab code is invisible set the visual effects in Ubuntu to none:
System, Preferences, Appearance, Visual Effects
For MEX we need g++ and gcc 4.1. Force matlab to use the gcc compiler by:
>> mex -setup
Option 2: gcc MEX files
Matlab is installed and configured.
Different path or different matlab version
If a different version of matlab is installed, i.e. a different version than 2011b or matlab is installed in a different direction, then edit the following line in ec_main.c after obtaining the software
before running make_all_install.
Getting the software
It is possible to obtain the current software via our svn-server
What is svn? Svn, in full: Subversion is a tool to exchange files between members of a team. It ensures that all team members always have the latest versions of all project files available. With svn precious work is not lost: you can always fall back on earlier versions of your project. There are dozens svn clients. All open-source. Smartsvn is a handy java based svn client available at:
check out the following url into your svn client:
Link to the svn install-manual pdf: Install smartsvn
Copy the folders and files in:
Open a terminal and start matlab as a superuser:
sudo matlab password:
After updating your local copy, run
in Matlab (from /home/ebox/svn/trunk/src/E-box/) to obtain a fresh copy of the latest verion. The first time it might be required to restart Matlab.
What does make_all_install?
The Libs Timer_posix, ec, and Coin are build and the symbolic links are created
Soem EtherCAT master library C files are build. Output directory in:
Tagets: C mex files through are build by make.m subsequently the target mexglx files be installed in:
Ectarget is installed in:
Download the manual via this link.
Most recent compatibility issues - March 2017
There are some compatibility issues regarding the version of matlab, the version of Ubuntu and the version of the gcc compiler. Different combinations may not work. The most recent combination that enables to properly build the Simulink model and properly connect to the E-box is:
- Ubuntu 16.04, more specifically Ubuntu 16.04.2 LTS by xenial
- Matlab 2016a
- gcc version 5.4.0
For instance, Matlab 2016b with the above Ubuntu and gcc version doesn't enable the Simulink model to build properly and the error messages point to the fact that this version is not compatible with the E-box software and specifically with the ectarget.
Lastly, users of Ubuntu 16.04 must refer to the section Advanced, for connecting to Turtles in order to rename the network interfaces into eth0, eth1 etc, in case they have different names, before doing the step: Connecting the E/BOX, changing ethernet index number. The part until the phrase: Reboot necessary after doing this! is needed, the rest can be discarded.