using Gpio with new kernel 6.6

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

Moderators: leecollings, remb0

Post Reply
vwstepha
Posts: 23
Joined: Saturday 17 March 2018 12:18
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Marseille
Contact:

using Gpio with new kernel 6.6

Post 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
Rpi Master 2022.2 Beta 14905 (Broadlink ok.....)
Rpi slave 2020.2 (since 10days but with error...) with 2 rflink(rts 433 + 833)
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: using Gpio with new kernel 6.6

Post by waltervl »

You are not doing anything wrong. It is a known issue https://github.com/domoticz/domoticz/issues/6040

Not solved unfortunately.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
vwstepha
Posts: 23
Joined: Saturday 17 March 2018 12:18
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Marseille
Contact:

Re: using Gpio with new kernel 6.6

Post 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.....
Rpi Master 2022.2 Beta 14905 (Broadlink ok.....)
Rpi slave 2020.2 (since 10days but with error...) with 2 rflink(rts 433 + 833)
vwstepha
Posts: 23
Joined: Saturday 17 March 2018 12:18
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Marseille
Contact:

Re: using Gpio with new kernel 6.6

Post by vwstepha »

Will I have to switch via Esp32 or Esp8266 to control these relays....
If a solution is not proposed quickly enough
Rpi Master 2022.2 Beta 14905 (Broadlink ok.....)
Rpi slave 2020.2 (since 10days but with error...) with 2 rflink(rts 433 + 833)
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: using Gpio with new kernel 6.6

Post by waltervl »

It seems it is not easily fixed in Domoticz without maintaining backwards compatibility. So you better invest in an alternative.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
simat
Posts: 33
Joined: Thursday 04 November 2021 21:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: UK
Contact:

Re: using Gpio with new kernel 6.6

Post by simat »

Could you use wiringpi ?

Its now unofficially maintained on Github

https://github.com/WiringPi
Raspberry Pi4, Sunny Boy 4000TL, Victron Multiplus II 10kw ESS, 44kWh LiFEPO4, Batrium BMS, NodeRED on Cerbo GX
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: using Gpio with new kernel 6.6

Post 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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
vwstepha
Posts: 23
Joined: Saturday 17 March 2018 12:18
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Marseille
Contact:

Re: using Gpio with new kernel 6.6

Post 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
Rpi Master 2022.2 Beta 14905 (Broadlink ok.....)
Rpi slave 2020.2 (since 10days but with error...) with 2 rflink(rts 433 + 833)
akamming
Posts: 337
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: using Gpio with new kernel 6.6

Post 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 ;-)
vwstepha
Posts: 23
Joined: Saturday 17 March 2018 12:18
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Marseille
Contact:

Re: using Gpio with new kernel 6.6

Post 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!!!
Rpi Master 2022.2 Beta 14905 (Broadlink ok.....)
Rpi slave 2020.2 (since 10days but with error...) with 2 rflink(rts 433 + 833)
vwstepha
Posts: 23
Joined: Saturday 17 March 2018 12:18
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Marseille
Contact:

Re: using Gpio with new kernel 6.6

Post 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
Rpi Master 2022.2 Beta 14905 (Broadlink ok.....)
Rpi slave 2020.2 (since 10days but with error...) with 2 rflink(rts 433 + 833)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest