Cant get Domoticz to Add GPIO

Moderator: leecollings

Post Reply
DanM
Posts: 79
Joined: Thursday 23 October 2014 22:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Cant get Domoticz to Add GPIO

Post by DanM »

Hi,

I have the following in my rc.local:

Code: Select all

sudo sh -c 'echo 26 > /sys/class/gpio/export'
sudo sh -c 'echo in > /sys/class/gpio/gpio26/direction' 
sudo sh -c 'echo both > /sys/class/gpio/gpio26/edge'
I can see the files in /sys/class/gpio/ and applying voltage to the pin changes the value there as it should. In spite of this Domoticz always starts saying GPIO has 0 inputs. Any ideas?

Thanks,

Dan
DanM
Posts: 79
Joined: Thursday 23 October 2014 22:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cant get Domoticz to Add GPIO

Post by DanM »

I know replying to myself is bad form.. but I've done some further digging and it seems that restarting (i.e enabling and they disabling the 'Generic sysfs GPIO') finds the GPIO correctly. My Log entry ends up as follows:

Code: Select all

2018-09-17 13:33:53.303 Status: Sysfs GPIO: Startup - polling:no interrupts:no debounce:50msec inputs:0 outputs:0
2018-09-17 13:34:19.923 Status: Sysfs GPIO: Worker stopped   <- this is the enable / disable
2018-09-17 13:34:22.561 Status: Sysfs GPIO: Startup - polling:no interrupts:yes debounce:50msec inputs:1 outputs:0
2018-09-17 13:34:22.561 Status: Sysfs GPIO: Edge detection started 
It seems like domoticz may be starting before rc.local is finished, is there any way to delay the domoticz start (that wont be overwritten when I update - I'm assuming domoticz.sh gets replaced). Or is there a way to enable and disable hardware in LUA?
knielen
Posts: 46
Joined: Sunday 10 September 2017 9:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cant get Domoticz to Add GPIO

Post by knielen »

/etc/init.d/domoticz.sh doesn't get replaced during an upgrade, so maybe that's the place for you.

Also the Wiki tells you to use this folder, did you read it?
steve01
Posts: 5
Joined: Saturday 09 February 2019 16:22
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.7900
Contact:

Re: Cant get Domoticz to Add GPIO

Post by steve01 »

@DanM, any luck?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests