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?
Newbie: Help needed on Domoticz GPIO
Moderator: leecollings
-
- 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
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?
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?
-
- 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
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.
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.
Who is online
Users browsing this forum: No registered users and 1 guest