Gpio on openhab2

I have just started openhanded so please bear with me. I have got my hue lights working but now I am trying to yet the Gpio pins to work. I am running openhabian on my raspberry pi, I have downloaded the Gpio binding using paper and have the item Switch RaspiLED { Gpio=“pin:4” } as it said to do on and have altered my site at to show the switch but when I try to turn it on nothing happens. Can Anyone help?

Look for errors in the log.

Make sure that the user openHAB is running under has permission to read/write to the GPIO pins (e.g. is a member of the GPIO group).

Thanks for the quick reply, how would I do that?

I have set the permissions but that hasn’t solved the problem

same here. I migrated from 1.8 and I haven’t had time to take a look into the log. I’ll inform you, when I have a solution :wink:

Thanks I’m still playing so if I manage to get it sorted I will update the post

I have the same problem, I think its due to that no file is for the gpio in the addin folder

I have the same problem

Hi, I am also new to openhabian. Did anybody solved this issue yet?

I have added openhab to gpio group and this fixed the problem!

Hi Dan,
can you tell me how did you add openhabe to gpio group?

sure, here you go

Could somebody explain mechanics of how OpenHABIAN(OH2) GPIO root access works?

I don’t have gpio group, but I can access GPIO.
How is that?

I am using gpio on openhabian on two RPI, both with root access because i could not get the openhab user to work

@skatun I have the same problem, I’ve created group gave needed privileges and still it does not work. When I start Openhabian as a root it works :slight_smile:

I can now use GPIO as Input on OpenHAB 2 using Snapshot 2.1.0 Build #887
For GPIO Bindig i am using GPIO Binding Snapshot

  1. The first you need install libjna 3.2.7 on your raspberry:
sudo apt-get autoremove libjna-java
sudo wget
sudo dpkg -i libjna-java_3.2.7-d_armhf.deb

2 . You need take a new file gpio.cfg into the folder: /etc/openhab2/services with this code:


3 . edit file : /etc/default/openhab2


4 . add gpio to openhab group:

sudo adduser openhab gpio

5 . Example for items file:

Contact	ws_hall 		{gpio="pin:17 debounce:10 activelow:yes"}

6 . Example for rules file:

rule "hall light"
	Item ws_hall received update CLOSED
	if (hall_light.state==OFF) {
	} else {

i hope this info can help someone :slight_smile:


May I ask where did you download the GPIO binding snapshot?

Did you try from this document:

From OH Paper UI you can remove GPIO Binding and then install it again.

After Installing you should restart your RPI for taking effect.



I am trying to do this with my Pi also. I’m not sure where to but the code above

Contact ws_hall

and the rule

rull “hall light”…

I have an 8 channel relay setup on various GPIO ports on the raspberry Pi. I need to set the ports to enable (high) in order to switch the relay on and turn a light on.

Any help really appreciated.