Newbie: Help needed on Domoticz GPIO

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
steve01
Posts: 12
Joined: Saturday 09 February 2019 16:22
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.7900
Contact:

Newbie: Help needed on Domoticz GPIO

Post by steve01 »

Hi folks, just started on Domoticz-Raspberry Pi. Great stuff.
Now I want to read a GPIO pin.

Followed the https://www.domoticz.com/wiki/GPIO but cannot get to read an input.

I used the SYSFS methode in the wiki for exporting a pin

echo 4 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio4/direction

Added Generic sysfs GPIO in the Domoticz hardware. Now when I add a manual switch with sysfs hardware using "type: Sysfs GPIO" I get "Sysfs GPIO: No sysfs-gpio exports" and cannot select any pin there.

Seems the export is not correct any ideas?
steve01
Posts: 12
Joined: Saturday 09 February 2019 16:22
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.7900
Contact:

Re: Newbie: Help needed on Domoticz GPIO

Post by steve01 »

anybody?
q3q3
Posts: 3
Joined: Monday 18 February 2019 10:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Location: Mińsk Mazowiecki
Contact:

Re: Newbie: Help needed on Domoticz GPIO

Post by q3q3 »

Hi,

I have used the same method for GPIO 21. I connected the PIR sensor to the 21st pin and it works correctly - it changes status in Domoticz.
One issue (mentioned in wiki), to make it work after the reboot you have to place appropriate records in the rc.local or domoticz.sh file.
This is something that I have a problem with. Placing such (for example: echo 4 > /sys/class/gpio/export) text in the domoticz.sh causes error. Probably something is missing in the script, but I I haven't figured this out. Maybe someone could help with this.

Maybe you rebooted your pi before testing your GPIO port?
q3q3
Posts: 3
Joined: Monday 18 February 2019 10:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Location: Mińsk Mazowiecki
Contact:

Re: Newbie: Help needed on Domoticz GPIO

Post by q3q3 »

OK, resolved.
The export of GPIO pin, for example

echo 4 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio4/direction


should be added to the domoticz.sh file placed in the /etc/init.d/ directory.
After this everything works fine. Initially, I thought that domoticz.sh placed in the /~/domoticz/directory should be modified, but after some checks, I realized my mistake.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest