Page 1 of 1

Cant get Domoticz to Add GPIO

Posted: Sunday 16 September 2018 21:30
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

Re: Cant get Domoticz to Add GPIO

Posted: Monday 17 September 2018 14:36
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?

Re: Cant get Domoticz to Add GPIO

Posted: Friday 08 February 2019 11:25
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?

Re: Cant get Domoticz to Add GPIO

Posted: Monday 11 February 2019 1:09
by steve01
@DanM, any luck?