[SOLVED] GPIO not responding to Basic UI commands

I am new to openHab and relatively new to Raspberry Pi so my problem is probably an easy one to solve, but it has me stumped.

I have a Raspberry Pi ver 3B+ with openHab 2.5.0 (stable) installed using the openHab preconfigured image.

I was using an online tutorial to learn how to use openHab to monitor/control the GPIO pins on my RPi. I installed the GPIO binding. I created the items file and the sitemap file, and they appear to be OK. The sitemap populates the Basic UI properly. I have a pair of Switch items and a pair of Contact items created in my items file. When I command the switches from the Basic UI, the GPIO do not respond. The log shows that the commands are sent and there are no errors. When I open/close the contacts, the Basic UI does not respond at all.

I went through the prerequisites. I made sure openhab is a member of gpio.

I saw a comment about verifying the operation of the GPIO from the terminal. Just to show my ignorance, would I write a python script to do that?

Any suggestions as to what the problem is?

I’ve seen several comments online about the GPIO binding being one of the more difficult. Is there a better way to control GPIO on an RPi ?


You can visit the raspberry pi website (and many others) for a tutorial on using gpio from the command line. OH runs on raspbian so there shouldn’t be an issue regarding other guides.

If planing to work with gpio pins I would become familiar with pull-up/pull-down resistors. Can’t say it’s your issue but you will need to learn when and where to use them.

Thanks. I found my problem, and it was quite simple as I suspected it would be. In my Item file, when I defined each item I used the board pin number rather than the GPIO number. It was probably in the documentation, but the term “pin” in the item definition fooled me. If it had said “gpio” perhaps I would have caught it sooner.

After I made the changes in my Item file, some of the gpio started responding/indicating properly, but not all. I did a reboot, and everything started working properly.

Now I’m off to learn about rules.