Rpi5 GPIO with Domoticz
Posted: Sunday 14 January 2024 10:28
Hello, I hope I am writting this question in the right section.
I have a rpi4B running with latest stable released Domoticz (2024.01)which among other things is using GPIO (pin 4) to detect if someone attempt to ring the bell at the entrance of my house.
This works very well using GPIO Sysfs and this declaration made at each boot:
sudo sh -c 'echo 4 > /sys/class/gpio/export'
sudo sh -c 'echo in > /sys/class/gpio/gpio4/direction'
sudo sh -c 'echo both > /sys/class/gpio/gpio4/edge'
My surprise comes from the rpi5 ). I found on it the gpio are completely changed but after many tries and error, it seems converting my 3 lines from the pi4 to:
sudo sh -c 'echo 403 > /sys/class/gpio/export'
sudo sh -c 'echo in > /sys/class/gpio/gpio403/direction'
sudo sh -c 'echo both > /sys/class/gpio/gpio403/edge'
gives the expected result at least using commands to check the state of my gpio:
pi@Pie5B:~ $ cat /sys/class/gpio/gpio403/value
1
pi@Pie5B:~ $ cat /sys/class/gpio/gpio403/value
0
pi@Pie5B:~ $ cat /sys/class/gpio/gpio403/value
0
pi@Pie5B:~ $ cat /sys/class/gpio/gpio403/value
1
The problem seems to come from Domoticz where it seems to detect 2 entries but none are working (change state when I put my GPIO to ground):
Has anyone already successfully used GPIO on Pi5 with Domoticz ? I read here and there that everything changed that Sysfs is depreciated but I see no alternative to it and second I get the impression the sysfs works when I run the command for my GPIO from a terminal so cannot see why Domoticz would not work.
Any help will be greatly apprecaited.
I have a rpi4B running with latest stable released Domoticz (2024.01)which among other things is using GPIO (pin 4) to detect if someone attempt to ring the bell at the entrance of my house.
This works very well using GPIO Sysfs and this declaration made at each boot:
sudo sh -c 'echo 4 > /sys/class/gpio/export'
sudo sh -c 'echo in > /sys/class/gpio/gpio4/direction'
sudo sh -c 'echo both > /sys/class/gpio/gpio4/edge'
My surprise comes from the rpi5 ). I found on it the gpio are completely changed but after many tries and error, it seems converting my 3 lines from the pi4 to:
sudo sh -c 'echo 403 > /sys/class/gpio/export'
sudo sh -c 'echo in > /sys/class/gpio/gpio403/direction'
sudo sh -c 'echo both > /sys/class/gpio/gpio403/edge'
gives the expected result at least using commands to check the state of my gpio:
pi@Pie5B:~ $ cat /sys/class/gpio/gpio403/value
1
pi@Pie5B:~ $ cat /sys/class/gpio/gpio403/value
0
pi@Pie5B:~ $ cat /sys/class/gpio/gpio403/value
0
pi@Pie5B:~ $ cat /sys/class/gpio/gpio403/value
1
The problem seems to come from Domoticz where it seems to detect 2 entries but none are working (change state when I put my GPIO to ground):
Has anyone already successfully used GPIO on Pi5 with Domoticz ? I read here and there that everything changed that Sysfs is depreciated but I see no alternative to it and second I get the impression the sysfs works when I run the command for my GPIO from a terminal so cannot see why Domoticz would not work.
Any help will be greatly apprecaited.