using Gpio with new kernel 6.6
Posted: Sunday 19 May 2024 17:20
Hi all!
After having done
a sudo apt update && sudo apt update -y on my pi
=> Kernel update to 6.6 and above all no more GPIO management via SysFs as before....
it is necessary to execute
to have the new GPIO numbers
So I modify my "declar_gpio.sh" file which is located in /etc/init.d and which is executed at the beginning of Domoticz.sh (the one located in etc/init.d)
Here is the type of modification made
After restarting the pi, everything is taken into account and the command
displays my gpio in sysfs active low etc
So when restarting, new devices appear in domoticz, I activate them but when I click on them
it gives me an error
"error sending switch command, check device/hardware(idx102)
Where is my mistake?
THANKS
After having done
a sudo apt update && sudo apt update -y on my pi
=> Kernel update to 6.6 and above all no more GPIO management via SysFs as before....
it is necessary to execute
Code: Select all
cat /sys/kernel/debug/gpi
So I modify my "declar_gpio.sh" file which is located in /etc/init.d and which is executed at the beginning of Domoticz.sh (the one located in etc/init.d)
Here is the type of modification made
Code: Select all
#Pin GPIO 27 (OUT) --Forces the water heater relay
#echo 27 > /sys/class/gpio/export
#echo out >/sys/class/gpio/gpio27/direction
#echo 1 > /sys/class/gpio/gpio27/active_low
#echo 0 > /sys/class/gpio/gpio27/value
echo 539 > /sys/class/gpio/export
echo out >/sys/class/gpio/gpio539/direction
echo 1 > /sys/class/gpio/gpio539/active_low
echo 0 > /sys/class/gpio/gpio539/value
Code: Select all
cat /sys/kernel/debug/gpi
Code: Select all
gpio-512 (ID_SDA)
gpio-513 (ID_SCL)
gpio-514 (GPIO2)
gpio-515 (GPIO3)
gpio-516 (GPIO4 |sysfs ) out hi ACTIVE LOW
gpio-517 (GPIO5 |sysfs) in hi
gpio-518 (GPIO6)
gpio-519 (GPIO7 |spi0 CS1 ) out hi ACTIVE LOW
gpio-520 (GPIO8 |spi0 CS0 ) out hi ACTIVE LOW
gpio-521 (GPIO9)
gpio-522 (GPIO10)
gpio-523 (GPIO11)
gpio-524 (GPIO12)
gpio-525 (GPIO13)
gpio-526 (GPIO14)
gpio-527 (GPIO15)
gpio-528 (GPIO16)
gpio-529 (GPIO17 |sysfs ) out hi ACTIVE LOW
gpio-530 (GPIO18)
gpio-531 (GPIO19)
gpio-532 (GPIO20)
gpio-533 (GPIO21)
gpio-534 (GPIO22)
gpio-535 (GPIO23)
gpio-536 (GPIO24)
gpio-537 (GPIO25)
gpio-538 (GPIO26)
gpio-539 (GPIO27 |sysfs ) out hi ACTIVE LOW
gpio-540 (NC)
gpio-541 (LAN_RUN_BOOT)
it gives me an error
"error sending switch command, check device/hardware(idx102)
Where is my mistake?
THANKS