Installed GPIO Binding in OH2 and GPIO pins are not woring

openhab2
Tags: #<Tag:0x00007fe058a0c4f0>

(Praveen Kumar) #1

i have problems in GPIO binding i’m trying a simple example to turn ON and OFF LED with my raspberry pi3 by connecting GPIO pins to relay board
1- i have installed OH2 in raspbian
2- I have installed GPIO binding (paper UI)
3- My item code is

 //------------------------------------------------------------------------
// Raspberry Pi
// GPIO
//------------------------------------------------------------------------
Switch RaspiLED { gpio="pin:4" }

4- My sitemap is

sitemap home label="Home"
{
 //------------------------------------------------------------------------
 // Raspberry Pi
 // GPIO
 //------------------------------------------------------------------------
 Frame label="Rasperry Pi GPIO"
 {
   Switch item=RaspiLED
 }
}

But,its not working when i install GPIO Binding.Please help me out.TIA


(Vincent Regaud) #2

Please use the code fences


(Praveen Kumar) #3

yeah I have modified with code fence please actually I have referenced many documentation and websites.Please give me a solution


(Vincent Regaud) #4

Show me the logs events.log and openhab.log when you action the switch in the sitemap


(Praveen Kumar) #5

I cannot find log file can you tell me where will be logfile folder? :frowning:


(Vincent Regaud) #6

https://docs.openhab.org/installation/linux.html#file-locations


(Praveen Kumar) #7

log has more lines shall I copy and paste here?


(Vincent Regaud) #8

Just like 10 lines before during and after you action the switch on the sitemap


(Praveen Kumar) #9

log

018-05-24 05:38:38.539 [ItemCommandEvent          ] - Item 'RaspiLED' received command ON
2018-05-24 05:38:38.550 [ItemStateChangedEvent     ] - RaspiLED changed from NULL to ON
2018-05-24 05:38:38.984 [ItemCommandEvent          ] - Item 'RaspiLED' received command OFF
2018-05-24 05:38:38.991 [ItemStateChangedEvent     ] - RaspiLED changed from ON to OFF
2018-05-24 05:38:39.382 [ItemCommandEvent          ] - Item 'RaspiLED' received command ON
2018-05-24 05:38:39.395 [ItemStateChangedEvent     ] - RaspiLED changed from OFF to ON
2018-05-24 05:38:39.663 [ItemCommandEvent          ] - Item 'RaspiLED' received command OFF
2018-05-24 05:38:39.673 [ItemStateChangedEvent     ] - RaspiLED changed from ON to OFF
2018-05-24 05:38:39.862 [ItemCommandEvent          ] - Item 'RaspiLED' received command ON
2018-05-24 05:38:39.880 [ItemStateChangedEvent     ] - RaspiLED changed from OFF to ON

But,Its not turning ON/OFF gpio pin


(Praveen Kumar) #10

Is there any permission problems? as I have install /opt/openhab2 I have installed in /etc/openhab2


(Vincent Regaud) #11

I asked for openhab.log too


(Vincent Regaud) #12

What?


(Praveen Kumar) #13

openhab.log

2018-05-24 05:50:33.038 [ERROR] [ab.binding.gpio.internal.GPIOBinding] - Error occured while creating backend object for item RaspiLED, exception: /sys/class/gpio/export
2018-05-24 05:50:35.127 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled astro job-daily-sun at midnight for thing astro:sun:home
2018-05-24 05:50:35.127 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled astro job-daily-moon at midnight for thing astro:moon:home
2018-05-24 05:50:35.303 [INFO ] [.astro.internal.job.AbstractDailyJob] - Scheduled astro event-jobs for thing astro:moon:home
2018-05-24 05:50:35.311 [INFO ] [.astro.internal.job.AbstractDailyJob] - Scheduled astro event-jobs for thing astro:sun:home
2018-05-24 05:50:40.007 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:50:40.032 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:50:50.008 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:51:00.008 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:51:00.017 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:51:10.009 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:51:20.006 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:51:20.020 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:51:30.010 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:51:40.006 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:51:40.028 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:51:50.012 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:52:00.007 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:52:00.014 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:52:10.008 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:52:20.009 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:52:20.018 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:52:30.008 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:52:40.005 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:52:40.009 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:52:50.008 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:53:00.012 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:53:00.016 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:53:10.012 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:53:20.010 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:53:20.015 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:53:30.014 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:53:40.008 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:53:40.017 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:53:50.014 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:54:00.004 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:54:00.009 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:54:10.009 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:54:20.005 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:54:20.029 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:54:30.008 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:54:40.005 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:54:40.009 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:54:50.012 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:55:00.008 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:55:00.017 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:55:00.025 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random room temperatures: An error occured during the script execution: The name 'Temperature' cannot be resolved to an item or type.
2018-05-24 05:55:10.012 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:55:20.010 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:55:20.029 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:55:30.009 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:55:40.008 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:55:40.019 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:55:50.012 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:56:00.008 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:56:00.017 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:56:10.008 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:56:20.006 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:56:20.013 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:56:30.007 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:56:40.006 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:56:40.013 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:56:50.016 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:57:00.009 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:57:00.016 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:57:10.025 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:57:20.010 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:57:20.023 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:57:30.012 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:57:40.011 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:57:40.013 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:57:50.109 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:57:50.568 [INFO ] [b.core.service.AbstractActiveService] - HTTP Refresh Service has been started
2018-05-24 05:58:00.021 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:58:00.021 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:58:10.021 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:58:17.500 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-binding-mqtt1'
2018-05-24 05:58:20.016 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random wifi variations: An error occured during the script execution: The name 'Wifi_Level' cannot be resolved to an item or type.
2018-05-24 05:58:20.047 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.
2018-05-24 05:58:30.031 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Set random image URLs: An error occured during the script execution: The name 'ImageURL' cannot be resolved to an item or type.


(Vincent Regaud) #14

There is nothing about the GPIO.

Did you do?

sudo adduser openhab gpio


(Vincent Regaud) #15

How did you install OH, apt-get method or manual method?

https://docs.openhab.org/installation/linux.html


(Praveen Kumar) #16

used apt-get method
sudo apt-get install openhab2-offline


(Vincent Regaud) #17
2018-05-24 05:50:33.038 [ERROR] [ab.binding.gpio.internal.GPIOBinding] - Error occured while creating backend object for item RaspiLED, exception: /sys/class/gpio/export

sudo nano /etc/openhab/configurations/openhab.cfg
uncomment “gpio:sysfs=/sys”


(Praveen Kumar) #18

Sorry for disturbing, There is no folder like configurations in openhab2 folder.


(Vincent Regaud) #19

conf


(Praveen Kumar) #20

no…I think everything problem with installation, can you suggest me another way of installing openhab not using apt-get