Openhab 1.7.1 problems accessing GPIO

214 views
Skip to first unread message

Joao Paulo Atila Rocha

unread,
Aug 26, 2015, 3:49:21 PM8/26/15
to ope...@googlegroups.com
Hello friends.

I read a few cases in the forum, but my problem is not equal to none.

I will give more details:
----------------------------------------------------------------

Hardware = Raspberry 2.
OS = I'm using linux distro based on OSMC (media center).
Openhab = version 1.7.1

I follow all possible steps in the link:



I tried to run with the root user, but the daemon don't start, i changed the Following file:


# / Etc / default / openhab

this is the file that manages this function in this version:

# /usr/share/openhab/bin/openhab.in.sh


log message----------------------------------------------------------------


[ERROR] [.o.b.gpio.internal.GPIOBinding] - Error occured while creating backend object for item Light_FF_Office_Ceiling, exception: /sys/class/gpio/gpio18/active_low

[ERROR] [.o.b.gpio.internal.GPIOBinding] - Error occured while creating backend object for item Light_FF_Office_Ceiling, exception: Device or resource busy


I understand that it is a permission issue on Linux because I ran the following commands with the openhab user:

echo "18" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio18/direction (Permission denied)
echo "1" > /sys/class/gpio/gpio18/value (Permission denied)

if they can help me with a little knowledge I will be very grateful.


thank you for attention

Joao Paulo Atila Rocha

unread,
Aug 27, 2015, 9:36:22 AM8/27/15
to openhab
Hello guys

I did some research and I resolved the problem of access to GPIO, follow details of how I resolved.

-------------------------------------------------------------------------------
nano /etc/udev/rules.d/998-fix-input.rules

KERNEL=="gpio18", SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="/usr/bin/java /bin/sh"

KERNEL=="gpio*", SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="/usr/bin/java gpio /sys%p"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c 'chown -R root:openhab /sys/class/gpio && chmod -R 770 /sys/class/gpio'"
-------------------------------------------------------------------------------

but I still can not turn on a lamp using openhab interface, I'll keep studying, if someone has an idea how to solve this problem, I will be very grateful.


-------------------------------------------------------------------------------
==> /var/log/openhab/events.log <==
2015-08-27 09:55:54 - Light_FF_Office_Ceiling received command OFF

==> /var/log/openhab/2015_08_27.request.log <==
192.168.222.11 -  -  [27/Aug/2015:12:55:54 +0000] "GET /CMD?Light_FF_Office_Ceiling=TOGGLE&__async=true&__source=waFF_Office HTTP/1.1" 200 13

==> /var/log/openhab/openhab.log <==
2015-08-27 09:55:54.926 [WARN ] [t.i.s.MapTransformationService] - Could not find a mapping for '-' in the file 'en.map'.
2015-08-27 09:55:54.937 [WARN ] [t.i.s.MapTransformationService] - Could not find a mapping for '-' in the file 'en.map'.

==> /var/log/openhab/2015_08_27.request.log <==
192.168.222.11 -  -  [27/Aug/2015:12:55:52 +0000] "GET /openhab.app?sitemap=demo&sitemap=demo&w=FF_Office&poll=true&__async=true&__source=waFF_Office HTTP/1.1" 200 3428

==> /var/log/openhab/events.log <==
2015-08-27 09:55:55 - Light_FF_Office_Ceiling received command ON

==> /var/log/openhab/2015_08_27.request.log <==
192.168.222.11 -  -  [27/Aug/2015:12:55:55 +0000] "GET /CMD?Light_FF_Office_Ceiling=TOGGLE&__async=true&__source=waFF_Office HTTP/1.1" 200 13

==> /var/log/openhab/openhab.log <==
2015-08-27 09:55:56.497 [WARN ] [t.i.s.MapTransformationService] - Could not find a mapping for '-' in the file 'en.map'.
2015-08-27 09:55:56.513 [WARN ] [t.i.s.MapTransformationService] - Could not find a mapping for '-' in the file 'en.map'.

==> /var/log/openhab/2015_08_27.request.log <==
192.168.222.11 -  -  [27/Aug/2015:12:55:54 +0000] "GET /openhab.app?sitemap=demo&sitemap=demo&w=FF_Office&poll=true&__async=true&__source=waFF_Office HTTP/1.1" 200 3439
-------------------------------------------------------------------------------

Att.

Fulvio Spelta

unread,
Sep 15, 2015, 6:11:02 AM9/15/15
to openhab
It seems a problem with openhab configration (are you using a mao file ?).
Try to post .items and .sitemap files
Reply all
Reply to author
Forward
0 new messages