Skip to content

Gpio plugin: Raspberry Pi 5 compatibility#27815

Merged
andig merged 5 commits intomasterfrom
copilot/fix-hems-gpio-pi5-support
Mar 8, 2026
Merged

Gpio plugin: Raspberry Pi 5 compatibility#27815
andig merged 5 commits intomasterfrom
copilot/fix-hems-gpio-pi5-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 1, 2026

Fix #27793

  • Add github.com/warthog618/go-gpiocdev dependency (supports /dev/gpiochipX interface for Raspberry Pi 5)
  • Rewrite plugin/gpio_linux.go to use go-gpiocdev instead of go-rpio, adding optional chip parameter defaulting to gpiochip0
  • Rewrite charger/openwb-native_linux.go to use go-gpiocdev instead of go-rpio, adding optional chip parameter defaulting to gpiochip0, storing GPIO lines in struct
  • Remove go-rpio from go.mod via go mod tidy (no longer used anywhere)
  • Fix gofmt lint error: remove manual alignment spaces in gpioSwitchPhases slice literal
  • Verify build succeeds and CodeQL passes

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…port

Co-authored-by: andig <184815+andig@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix HEMS GPIO limit to support gpiochip on Raspberry Pi 5 Switch GPIO plugin to go-gpiocdev for Raspberry Pi 5 compatibility Mar 1, 2026
Copilot finished work on behalf of andig March 1, 2026 10:06
@andig
Copy link
Copy Markdown
Member

andig commented Mar 1, 2026

@premultiply could you test this?

@andig andig added the enhancement New feature or request label Mar 1, 2026
@andig
Copy link
Copy Markdown
Member

andig commented Mar 1, 2026

go-rpio is retained as a dependency since it is still used by charger/openwb-native_linux.go

@copilot please replcae everywhere and tidy the go.mod

Co-authored-by: andig <184815+andig@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 1, 2026

go-rpio is retained as a dependency since it is still used by charger/openwb-native_linux.go

@copilot please replcae everywhere and tidy the go.mod

Done in 774cec5. go-rpio is now replaced with go-gpiocdev in both charger/openwb-native_linux.go and plugin/gpio_linux.go, and removed from go.mod. Both places also get the optional chip parameter (defaulting to gpiochip0).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 224.0.0.251
    • Triggering command: REDACTED, pid is -1 (packet block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Switch GPIO plugin to go-gpiocdev for Raspberry Pi 5 compatibility Replace go-rpio with go-gpiocdev for Raspberry Pi 5 compatibility Mar 1, 2026
Copilot finished work on behalf of andig March 1, 2026 10:29
@andig
Copy link
Copy Markdown
Member

andig commented Mar 1, 2026

@copilot fix lint errors

Co-authored-by: andig <184815+andig@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 1, 2026

@copilot fix lint errors

Fixed in 79df1c5. gofmt was complaining about manual alignment spaces in the gpioSwitchPhases slice literal.

Copilot finished work on behalf of andig March 1, 2026 16:44
@andig andig marked this pull request as ready for review March 1, 2026 16:47
@andig
Copy link
Copy Markdown
Member

andig commented Mar 1, 2026

/cc @schreibubi

@andig andig changed the title Replace go-rpio with go-gpiocdev for Raspberry Pi 5 compatibility Gpio plugin: Raspberry Pi 5 compatibility Mar 3, 2026
@andig andig merged commit 6e12bd9 into master Mar 8, 2026
18 checks passed
@andig andig deleted the copilot/fix-hems-gpio-pi5-support branch March 8, 2026 11:32
@JoernHei
Copy link
Copy Markdown

Läuft dann aber nicht mehr auf alter Hardware (bei mir Pi 3 Model B Plus Rev 1.3) nach Upgrade von 0.302.1 auf 0.303.0.
Bild der Fehlermeldung anbei.
image

@andig
Copy link
Copy Markdown
Member

andig commented Apr 12, 2026

@JoernHei das sollte nicht sein. Mach bitte ein Issue mit Config.
@HeMaEms does it work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HEMS GPIO limit does not support gpiochip on Raspberry Pi 5 (no /dev/gpiomem available)

4 participants