Setting up development environment, installing and running Eclipse Kura

In this post I will write about my first experiences when I started using Eclipse Kura. Generally speaking apart from the few poorly documented or hard to find in the documentation things about which I will write later in this post, it has been really pleasant and joyful experience. Kura is a great peace of software which makes a lot of things in the development of IoT Gateways much, much easier. I’m really greatful to all developers and supporters of the project and actually I’m thinking to start contributing to the project myself.😉

Eclipse Kura Overview

Kura logo
Eclipse Kura is a Java/OSGi based framework for building IoT Gateways. The project was first developed at a company called Eurotech under the name Everywhere Software Framework (ESF) and then it was released as an Eclipse Project under the name Kura. It’s a great framework which will get you going really fast and will enable you to concentrate on the things that your IoT Application should do. It provides a full fledged working IoT gateway with all the accompanying system things for network configuration and monitoring (with monit) apps. For the developers it provides the basic modular application architecture, components for communication with different hardware devices connected in different ways, for example: USB, General Purpose Input/Output Port (GPIO), Bluetooth. It also comes out of the box with implementations of some communication protocols like: MQTT, Modbus, CAN Bus and the best thing is that it can run on various popular hardware platforms such as: Raspberry Pi, BeagleBone Black , Intel Edison and some commercial industrial grade M2M Gateways.

If you want to start developing applications based on Eclipse Kura power up your Raspberry Pi or Beagle Board and head of to the project documentation and wiki pages. They, together with the homepage are the best resources to get you started with Kura.

Kura Installation on hardware platform (Raspberry Pi in my case)

The Kura installation on a hardware platform is fairly easy, but there are some things to be aware of. A detailed instruction on how to install Kura on specific hardware can be found in the project documentation pages (Raspberry Pi, BeagleBone Black). On the download page or when you compile Kura from source at the end you will get two install packages:

  • one with the network management functionality (kura_1.3.0-SNAPSHOT_raspberry-pi_armv6.deb)
  • one with “nn” in the name, which means “no net” (kura_1.3.0-SNAPSHOT_raspberry-pi-nn_armv6.deb)

In the first case, in the package name without “nn” (short from “no network”), Kura is  packed together firewall settings, dhcp server settings and other components to configure the network interfaces. This Kura package depends on few networking tools  like DHCP server and Firewall. The Linux kernel firewall is used and iptables is used for configuration. After you restart your hardware Kura will start automatically together with the DHCP server and will try to start and configure the network interfaces. Kura will try to configure the networking and secure the system it is running on, so before installing Kura you should backup your network settings because all your previous network settings will be overwritten. For more information what files are used in the configuration and what they do you can read the “Code Additions” chapter of the Hardware Targets part of the documentation. On that page are also listed the files which are used to configure the whole system. Depending on your target hardware, if you download the Kura source code, you will find the configuration files on the following system path:


I’m using Raspberry Pi B, so my files are under:


I highly recommend you to go through each file and see what in it, in order to see how the whole system is configured and installed. The Kura contributors have done a great job by putting comments in the files and documenting each configuration parameter.

If you check the “firewall.init” and “snapshot_0.xml” you will find out what’s happening with your iptables rules and network settings when you install Kura. In “snapshot_0.xml” it can be clearly seen that Kura checks what kind of network connection is available ethernet or wlan and starts a DHCP server on the active network interface. The IP address of your device will be set to “” and the IP range for the DHCP server IP addresses start from:

The package with “nn” in the name doesn’t contain the network management components and settings, so it won’t change your network settings. The network management and the safety of the whole system is let to the users, and they should adjust the network settings according to their needs.

The “nn” (no net) mark in the package names is not well explained on the first sight in the documentation, and the users or developers must read the Hardware targets page in order to find out more. So, you shouldn’t be lazy and you should RTFM😉

In case where you only want to install Kura on a test system in order to play a bit with it and see what is going I recommend that you install the “nn” package.

Actually there is also an emulator available which you can start from you Eclipse IDE. I will write more about the emulator later in this post.

Compiling Kura from Source

To compile Kura from source you can follow the Getting Started Guide on the Kura Wiki Page. The guide explains in details what you should do to compile Kura and to setup your Eclipse IDE. Apart from the specific JDK+Maven+Tycho Plugin combination there is nothing special in it, just follow the steps and your good.

I personally use Arch Linux with JDK 8 and Maven 3.3, but Kura and the Tycho plugin need JDK 7 and Maven 3.0.5 (I don’t know if this is a must, but I set up my development environment by the book ;)). Because of the special versions of JDK and Maven which are needed, based on my previous blog post about a wrapper which enables running Java apps with a specific version of the JDK, I wrote a small shell script which I use to setup the Java environment before doing anything. It’s a small script which I call before calling any command when compiling Kura or running Eclipse for Kura development.

I called the script kura-env and it’s content are (cat /usr/local/bin/kura-env):

export M2_HOME=/opt/development/sdk/java/apache-maven-3.0.5
export JAVA_HOME

When I work with the Kura code I prepend every command with kura-env.
For example:

$ kura-env mvn clean install
$ kura-env eclipse &

By prepending each command I’m sure that I’m compiling the source code with the
appropriate version of the JDK.

Using the Emulator

Using the Emulator is quite simple and good documented in the Emulator section on the Getting Started Wiki Page.

I use the latest version of Eclipse aka Eclipse Mars and  I compiled myself Kura from source from the “develop” branch. I needed some time to discover which bundles I don’t need, and which make me problems when trying to run the emulator. I notices that the OSGi console could not be found, so in the “Run Configurations” window on the arguments tab in the “VM Arguments” field I added ” -Dosgi.console.enable.builtin=true” . I also deselected the “org.eclipse.kura.deployment.*” bundles. After that the emulator was started successfully without any problems.

Setting up the development environment

To setup the development environment just follow the Getting Started Guide in the documentation.

I’m still trying to configure a workspace which will work with Kura develop branch.  I started analyzing the user workspace for Kura 1.2.2 and tried to build one from the source code and the built files from the develop branch, but it wasn’t successful. I guess I need to read and learn more about building Eclipse Plugin Projects. I had problems to add the dependencies in the manifest, “org.eclipse.osgi.service” in particular. I would be greatful if someone writes a comment to help me how to do that. Till than I will use the stable version of Kura 1.2.2.

Final words

Kura is great software and it worth using it in your next IoT project. I hope you find this post interesting and useful. If you find some things which are wrong in the post, please write a comment and I will update it. I would also like to invite you to comment and describe your experiences with Eclipse Kura.

Till the next time,

Happy hacking IoT gateways🙂

Running Java Apps with a specific version of JRE or JDK on Arch Linux

Sometimes when we use,test or develop some Java applications there might be a requirement to use a specific version of JRE or JDK. By different versions I mean Java 7 (JRE 7  or JDK 7) or Java 8 (JRE 8  or JDK 8). Sometimes depending on the server setup even a specific minor version. For example when our application should run on a server on which we don’t have admin privileges to install different version of Java not and because of some policies the server admins don’t allowed another version to be installed.

On my machine (GNU/Linux Arch distribution) I’m usually running the latest version of the JDK (at the moment of writing this post JDK 1.8.0_60 (build 1.8.0_60-b27).
Till now, I had a small script “/etc/profile.d/” which was defining the JAVA_HOME parameter and when I need to use a different version of the JDK i would just open the terminal edit the file, reload the profile and start the Java app.

The contents of “/etc/profile.d/” were:

$ export PATH=$PATH:$JAVA_HOME/bin

I was doing this for a while… I was a bit lazy to find a better solution, but I wanted to save myself from doing this over and over again. Recently I did a fresh install of my GNU/Linux so I thought it was time to fix this problem too.
When I was searching for a solution for this problem I came across this answer on Stack Exchange. The answer was good enough, but I didn’t want to write the whole path to the Java installation so I edited it this way:

case "$1" in

export JAVA_HOME; shift

I named this script “”. To test if it works try executing the following commands in the terminal

$ ./ 7 java -version
$ ./ 8 java -version

You will see the version of your Java 7 or 8🙂

Someone my ask why does this work because after the second JAVA_HOME we have two java versions defined in our PATH. It works because we are adding the new, temporal JAVA_HOME at beginning of the PATH variable and when the GNU/Linux operating system processes the PATH variable value the first java executable that will be found and executed is in our newly added JAVA_HOME path.

After adding this script my “/etc/profile.d/” looks like this:

$ export PATH=$PATH:$JAVA_HOME/bin

I hope this helps and I would like to hear how did the other solve this problem. Just one more quick note for the Debian users who will probably suggest using “update-alternatives”: there is no such thing in Arch Linix.

Happy hacking🙂

Categories: Development Tags: , , , ,

Eclipsecon Europe 2015

My talk proposal for the Eclipse Conference Europe 2015 in Ludwigsburg, Germany was accepted. YEY!!!!🙂 And the best thing was that I got the confirmation E-Mail on my birthday. So I consider it as one of my best birthday gifts this year😉

EclipseCon Europe 2015

The name of the session is Building Smart Grids with Eclipse IoT Technology: Electrical Substation Automation Revisited. During my talk I will:

  • give a short overview of Smart Grids and Electrical Substation Automation;
  • share my experiences in building  automation systems for Electrical Substation
  • propose a system solution based on Eclipse IoT technologies like Eclipse Kura and Eclipse SCADA
  • discuss the advantages of the proposed solution and using IoT in Electrical Substation Automation in general.
  • Show a demonstration of the proposed system

In the next few days I will start publishing series of blog post in which I will describe the my system solution and will publish the source code and all the specification for the demonstration system as Free Software (free as in freedom of speech ;)).

I’m really excited that I will participate at the conference and meet the other people who are contributing or using to the Eclipse Projects.

See you all in Ludwigsburg🙂

Android: How to Backup Contacts and SMS Messages

In this post I’m presenting a “quick and dirty” way to backup your contacts and SMS messages. “Quick and dirty” not because I’ll show you some illegal or impractical method for doing backups, but because this method doesn’t involve taping any application that you can get from the Android Market to get the job done. Here I will present how to backup your contacts and SMS (and MMS) messages by using standard tools which come with the Android SDK.

If you ever played with the Android SDK you probably know that the contacts and the SMS messages are available to the other applications via Content Providers. The messages are available via the Telephony and contacts via the Contacts provider. The data is stored in SQLite databases in the following locations:


If you have the Android SDK installed and the phone connected to you computer, to do the backup, you simply need to copy these files from the phone to the computer. You can do this with the “adb pull” command. Here are the commands:

cd <android-sdk-dir>/platform-tools
./adb pull /data/data/
./adb pull /data/data/

After executing this commands you’ll have the databases in your “<android-sdk-dir>/platform-tools” folder. If you want to examine the databases you can use some SQLite browser. I’m using the SQLite Manager addon for Firefox.

If you want to put the backed up files back on the phone, you’ll have to remount the /system partition in read-write mode, delete the present database files (if there are [present) and push the files back on the phone.

First check to see where the which physical partition is mounted on “/system” to know where you should remount it:

./adb shell mount

Search for the “/dev/block/” part on the line with “/system”. On my phone which is running CyanogenMod 6 it is “/dev/block/mtdblock3”.

After discovering which physical partition is mounted at “/system” you will have to remount that partition as read-write, delete the databases and push the backed up ones.

./adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
./adb shell rm /data/data/
./adb shell rm /data/data/
./adb push mmssms.db /data/data/
./adb push ~/Desktop/phone/contacts2.db /data/data/

After doing the restoration of the databases if it happens that you don’t see either your SMS messages or your contacts you can try copying the databases to your SD card and then by using some file manager with root privileges to place them on the appropriate places. I had this problem with my contacts database and I solved it this way.

Links of the week 30.09.2012

This week I’m starting a new category on my blog. It is intended as a log for the articles that I’ve read and I think they are useful. Basically the things I read and I want to share them with you.😉


GNU/Linux CPU Load Analysis:



Source Code Version Control Systems:



That’s all for this week.🙂

SVN Fix Conflicts Without Merging

The current web site project I’m working on with PHP has a setup where we have our development machines, staging server and production server. We’re developing the code on our local machines, than we push the code to the staging server for testing and if all goes well we’re pushing the changes on the production server. We use SVN as a source version control system. Because the web site has very big traffic and it has many visitors and registered users we have to fix the bugs as fast as we can and deploy the fixes on the production servers as fast as possible. The prompt bugfixing form time to time forces us to make the changes directly on the production. This is done usually by our project manager (who luckily  has good technical background) and although he’s aware that he doesn’t commit the changes to the SVN repository, he’s making changes directly on the production servers and he doesn’t inform us.

Last week I’ve encountered one conflict situation. I was working on a bugfix and the time came to commit the changes to the SVN repo. I did the normal procedure:

$ svn up
$ svn st

I’ve updated the code from the SVN and a saw that there were no conflicts so I committed it back to the repo with my changes included

$ svn ci -m "Bugix: .........."

After committing the changes to the repo, I ssh-ed to the production server to pull the updated files from the repo. I issued:

$ svn st

to check the status of this folder and I saw that there was a file which was changed but not committed to the repo. Unfortunately the changed file was the one that I changed and committed to the repo. So this was obvious conflict which had to be solved.
The normal solution is cases like this is to update the code fix the conflict and and commit the changes back to the repo. The problem was that doing this on the production server means that the web site will work with errors, the code will brake. I mustn’t pull down the site for maintenance so I had to think of another solution. If I tried updating the SVN would’ve marked the differences in the files like:

<<<<<<< filename
    your changes
    code merged from repository
>>>>>>> revision

And the PHP code would’ve not been parsed correctly which means troubles and web site down. I knew I had to do something, to implement the needed changes, commit them to the SVN repo and do an update of the production server code so that it will have the latest code revision, and I had to do all that without pulling down the site

This is what I did. This solution should work with any other script language (any deployment which does not require compiling of the source code).
On the production server I issued:

$ svn status

to see which files have been modified localy, and then

$  svn status --show-updates

to see which files have been changed in the repo. I saw which files have been outdated (which files have newer versions in the repo) and I started looking for the differences and updated the files in the repo one by one. I found the differences with the repo HEAD with:

$ svn diff <filename> -r HEAD

After finding the changes made on the production server, I made all them on my local machine and committed the code back to the SVN repo.

The last operation which had to be done was to checkout the new code on the production server and force to overwrite the locally changed files.

svn checkout --force svn://repo website.dir
svn revert -R website.dir

The first command will check out on top of existing files in website.dir, but not overwrite them. Then the revert will overwrite them.

This is how I fixed the problem with our web site without taking the site down. I hope someone will find this small guide useful. Please write comments if you have suggestions to improve this method or if you have some better solution.

Categories: Development Tags: , , ,

NSND Struga 2012 my point of view

The gang🙂 by anaris_

At first, I must say that I haven’t blogged for ages, so starting again feels really good and fun especially because I’m writing about an event which has a great meaning for the hacker and free software community in the Balkan region.

This year’s cyrillic NSND was held in Struga at the shore of the Ohrid Lake. NSND, translated in English with google translate (blame Google for bad translation :P) – the original is O Nista Se Nece Dogoditi, is a hacker and geek gathering in the Balkan region. NSND is an acronym for “Nista Se Nece Dogoditi” in Serbian/Croatian translated in English is Nothing Will Happen. The name suggests that nothing will happen, but the truth is that on this weekend meetings of hacker and geeks in various cities in the Balkans very interesting things are happening and if you happen to be around you are kindly invited to participate. These are the meetings of the top geeks and members of the hackerspaces from the region. If you participate in these meetings the main thing not to do is to be shy to ask what you want to know/hear about and what knowledge would you like to share with the others. There is no strict program, the program is made on the face of the place by voting. The participants are asking for specific topics what they want to hear about, others say what they can talk about, match is made and topics are voted. This adds a specific nice flavour to these meetings. You have experienced professionals who want to share their knowledge and you don’t have a program made in advanced. This is what makes these meetings unique, you never know what will happen and how will it happen (ok you know bits: we have laptops, projectors, Internet connection, but we never know how will we use them :)) And of course, I must not forget to tell, geeks and hackers might party in a specific way, but they party hard🙂.

For me, the journey to Struga started pretty rough because I had a large deployment the night before, so I haven’t slept well and I needed rest. I knew that I’ll have a great weekend, but I was afraid that I might get sleepy and miss all the fun. I was not my first NSND so I knew that I will leave out the sleeping part🙂. We arrived late in Struga so we went directly to the restaurant to meet the others. It was a great start.

The next morning started with testing the Internet connection and laying down the extension power cords so we all enough electrical power for our computers. The Internet connection was a good test for the WiMAX network of our Internet provider Neotel. We tried connecting three different WiMAX modems/routers and we tested the speed. When we had all the infrastructure up and running we started the fun part. We started with the standard “introduce yourself circle” than we voted the program. You can see the whole program on PiratePad.


Discussion by anaris_

The first session was an introductory and overview speech about Raspberry Pi and was held by my self and Glisha. We were talking about the Raspberry Pi features and our experiences with the RPi, we show the boards and ran XMBC and Debian. We go few interesting questions regarding the audio and video capabilities, which system (pulseaudio, alsa…) it’s using, what kind of OpenGL support does it have. We got a lot of homework to do, so I’ll write another blog post specifically on the questions from our presentation.

The second session was held by Andrea and was about growing healthy food, potatoes in this particular case. It was about a group of people in Germany who are growing potatoes, it was about “non-commercial agriculture” (nicht kommerzielle Landwirtschaft – NKL) is an experiment that was started by a collective on a former agricultural cooperative (GDR), in Brandenburg, a north-eastern Part of Germany.

The next session was also about growing healthy food without pesticides. Luca had a so powerful presentation called “Happy Food Production”. He was talking about his experiments for growing healthy food. He spoke about various different ways to prepare and maintain the soil for production of various vegetables. For me the best part was when he spoke about Aquafonics and his journey back to the traditional plant growing in the search for better and healthier food. I thik this was the best talk at the event.

After these two non technical presentations we got back with some programming and some sensor networks technology. Baze spoke about magic methods in Python and why should we use them. After him Valent and Valentino talked about their project for Wireless Mash Sensor Networks and the “Open Network” project. As a part of their talk they talked about organizing

OpenStreetMap mapping parties. Check the PiratePad it has a ton of links on the subject. This was an interesting presentation for me because we have a situation in our city. The web site “Skopje breathes” which was showing the pollution in Skopje is being upgraded to long after the public started complaining about the pollution, so this talk made us think how we can add pollution sensors here and there to measure the pollution. On the other side, for me as a OpenStreetMap supporter, me and Ilina were thinking to organize a mapping party, so it was a great experience to share knowledge with the people who have already done that.

The day ended with a discussion about the Hacklab collaboration. It was a long discussion about how hacklabs in the region work, what do their members do, how to open new hacklabs and how to help each other in order to make hacklabsbetter.

The atmosphere by V. Sefer

It was great to hear different points of view on the same subjects that we’re all working on in the hacklabs. The two things that made a big impression on me were: the initiative “Hackers travel around” which is couch surfing around the region and the confessions of the “new” members of the hacklab about their first impressions when they got in our Skopje Hacklab Kika. It is widely known that the geeks are antisocial and that they will make a fool of you if you ask stupid questions. That’s not like that we’re only testing the people who are asking questions what will do next and will they be persistent enough🙂 If you come and ask something and you say that you’ve already tried few alternatives, than the situation is completely different, you’ve learned that you first need to try fix it yourself and then ask for help. if you go to someone and ask precise question and say that you’ve tried few solutions everyone will help you😉 It was good to see how the people who started visiting KIKA, because of the GSoC this summer have seen us the hacklab rats and why besides all the “troubles” we’ve made them, they’re still visiting the hacklab.

When the session ended we all went in a traditional Macedonian restaurant for supper. After that we wanted to go somewhere for a drink, but the pubs were closing and because of the stupid law in Macedonia which forbids selling alcohol after 9pm we couldn’t find any beer so we went back to the hotel. luckily me and Ilina were driving around few fireworks (we forgot to fire them at the new years eve celebration) so we went at the beach and played with fire. Too bad we only had three of them😦

The second day started relaxed with free time so most of the group went to Ohrid for sightseeing. After this Ivo held a workshop for F-Droid an android market alternative which serves only apps which are free software. Too bad I did get only a glimpse on this😦

After this, Baze and Damjan were talkin about 0MQ and Zlatko was sharing his knowledge about his play with different filesystems in his fight for more IOPS in his high demanding network at work.

On the pauses people played Ilina’s games developed for her’s master thesis or they went out to enjoy the sun, play frisbee in the grass or play basketball.

This was one great weekend, meeting with friends meeting new friends, learning and having great time by playing with technology🙂 Once again if you are on the Balkans find a way to be on one of these NSND meetings, you’ll love it.

Categories: Community Tags: , , , , ,
%d bloggers like this: