Saturday, August 02, 2014

Raspberry Pi GPIO using OSGi Services

I've created an API that abstracts individual GPIO Pins as OSGi services, and made it available via the ECF github repository.  This allows applications to easily use the Raspberry Pi's GPIO to send output to or receive input from peripherals.

I've also created a short tutorial on how to use these services to control a single LED.

This tutorial now has a short demonstration of how to use OSGi Remote Services to do remote control of a single GPIO Pin with Eclipse as the user interface.


David Bosschaert said...

Hi Scott, I like it a lot! The nice thing about using OSGi services to represent physical devices is also that the fact that these devices may have some unreliability associated with them which is perfectly modeled via OSGi Services, which can come and go dynamically.
/me is getting my soldering iron out :)

Scott Lewis said...

Hi David,

I agree. If we can all get past the bump in the Internet of Things hype cycle, OSGi services provides an ideal infrastructure.

LuísCM said...

Great Scott!

Kuba said...

Hello Scott,
Thank you for interesting materials and code about using osgi with rpi. This seems very interesting indeed.

Unfortunatelly I have to say tutorial is very confusing.

I am Java EE developer and I have basic knowledge of OSGI development, but I still have no clue how to use your code :S

I was able to pull code from github and build it using maven. I could not get it building in eclipse as pin0 and pin1 projects cannot find required package.

My question here is: Would you be able to post some information how to run/use your code?

I mean: which jars should I run on RPI and what should be run on PC. How I can get this nice GPIO console working in my eclipse? assuming I just downloaded IDE. And get everything building using maven.

I installed ECF and Equinox SDK but I dont know how to get your plugins running :(

Would you be able to shed some light on the topic?

Many thanks in advance.

Scott Lewis said...

Hi Kuba

> I could not get it building in eclipse as pin0 and pin1 projects cannot find required package.

All that's necessary to get these projects to build is to close (or remove from workspace) this project:


This project was added for testing by another committer and should probably be removed to prevent what you experienced, but since I didn't add it I'll need to consult with the other committer (whose name is Wim Jongman BTW).

>I mean: which jars should I run on RPI and what should be run on PC

The Eclipse IDE plugin (UI shown in tutorial) is in this project:


You can see by examining this plugin, that the only raspberrypi dependency is on this API bundle:


All the other dependencies for this bundle are either on Eclipse or ECF Remote Services

In order to get support on things from Wim (who is responsible for the pin0/pin1 projects, and all the Maven pom.xmls) please join and send an email to the ecf-dev mailing list:

I monitor this list, as does you should be able to have your questions answered.

We will try to make additions/improvements to the usage documentation, but are resource constrained so contributions of desired additions would be welcomed. Or if you want professional support or development feel free to contact me at


jjroman said...

Thanks Scott,
Closing mock project helped indeed.

I will try to figure out next steps if no luck I will use mailing list.

Thanks for great project.

(sorry for nick confusion im not sure where blogger pull my old nick from ;-) )