Page 1 of 1

using Gpio with new kernel 6.6

Posted: Sunday 19 May 2024 17:20
by vwstepha
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

Code: Select all

cat /sys/kernel/debug/gpi
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

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
After restarting the pi, everything is taken into account and the command

Code: Select all

cat /sys/kernel/debug/gpi
displays my gpio in sysfs active low etc

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)
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

Re: using Gpio with new kernel 6.6

Posted: Sunday 19 May 2024 18:17
by waltervl
You are not doing anything wrong. It is a known issue https://github.com/domoticz/domoticz/issues/6040

Not solved unfortunately.

Re: using Gpio with new kernel 6.6

Posted: Sunday 19 May 2024 18:36
by vwstepha
tks for your answer!


It's a real shame to have removed such simple functions that had worked since the beginning of the first Rpi.....

Re: using Gpio with new kernel 6.6

Posted: Sunday 19 May 2024 18:38
by vwstepha
Will I have to switch via Esp32 or Esp8266 to control these relays....
If a solution is not proposed quickly enough

Re: using Gpio with new kernel 6.6

Posted: Sunday 19 May 2024 23:46
by waltervl
It seems it is not easily fixed in Domoticz without maintaining backwards compatibility. So you better invest in an alternative.

Re: using Gpio with new kernel 6.6

Posted: Tuesday 21 May 2024 8:56
by simat
Could you use wiringpi ?

Its now unofficially maintained on Github

https://github.com/WiringPi

Re: using Gpio with new kernel 6.6

Posted: Tuesday 21 May 2024 9:31
by waltervl
There is a pull request prepared to fix so if you can build yourself you should be able to test this (on a test system). https://github.com/domoticz/domoticz/pull/6019

Re: using Gpio with new kernel 6.6

Posted: Wednesday 22 May 2024 10:50
by vwstepha
Hello. Thank you for your feedback!
I disabled SysFS and installed wiringpi
but a "Gpio readall" tells me that this is not okay...
I can't drive the pines like before
and the second solution to continue the code.... I am far from having the capabilities.
I'm going to force myself to go through an esp 8266 with Gpios to configure either under Espeasy or under Tasmota.
I don't know who the simple one is....
thanks again

Re: using Gpio with new kernel 6.6

Posted: Wednesday 22 May 2024 21:30
by akamming
I found a workaround some time ago:

https://www.domoticz.com/forum/viewtopi ... 91#p315391

EDIT: The fix was updated in the latest beta ;-)

Re: using Gpio with new kernel 6.6

Posted: Thursday 20 June 2024 11:49
by vwstepha
hi
For my part, I restored an old backup and I was able to recover SysGpio...!
What is the solution that is fixed in this Beta version?
THANKS!!!

Re: using Gpio with new kernel 6.6

Posted: Thursday 11 July 2024 9:26
by vwstepha
akamming wrote: Wednesday 22 May 2024 21:30 I found a workaround some time ago:

https://www.domoticz.com/forum/viewtopi ... 91#p315391

EDIT: The fix was updated in the latest beta ;-)
Hi!
With the new 2024.6, is it fixed?!!!! :ugeek:
tks a lot