Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPIO not working on newer OS versions #20

Closed
gotling opened this issue Mar 19, 2025 · 0 comments
Closed

GPIO not working on newer OS versions #20

gotling opened this issue Mar 19, 2025 · 0 comments
Labels
bug Something isn't working remote Issues relating to remote

Comments

@gotling
Copy link
Contributor

gotling commented Mar 19, 2025

When remote starts it logs an error.

Error: EINVAL: invalid argument, write
2025-03-19T14:35:09+01:00  remote      at Object.writeSync (node:fs:920:3)
2025-03-19T14:35:09+01:00  remote      at Object.writeFileSync (node:fs:2208:26)
2025-03-19T14:35:09+01:00  remote      at exportGpio (/usr/src/app/node_modules/onoff/onoff.js:18:8)
2025-03-19T14:35:09+01:00  remote      at new Gpio (/usr/src/app/node_modules/onoff/onoff.js:172:36)
2025-03-19T14:35:09+01:00  remote      at Object.<anonymous> (/usr/src/app/build/main.js:46:17)
2025-03-19T14:35:09+01:00  remote      at Module._compile (node:internal/modules/cjs/loader:1191:14)
2025-03-19T14:35:09+01:00  remote      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
2025-03-19T14:35:09+01:00  remote      at Module.load (node:internal/modules/cjs/loader:1069:32)
2025-03-19T14:35:09+01:00  remote      at Function.Module._load (node:internal/modules/cjs/loader:904:12)
2025-03-19T14:35:09+01:00  remote      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
2025-03-19T14:35:09+01:00  remote    errno: -22,
2025-03-19T14:35:09+01:00  remote    syscall: 'write',
2025-03-19T14:35:09+01:00  remote    code: 'EINVAL'
2025-03-19T14:35:09+01:00  remote  }

It seems that newer versions of OSes refer to GPIO numbers in a different way:

See

https://stackoverflow.com/a/78184108

fivdi/onoff#204

Simple solution

Add a GPIO Base address configuration that is added to the GPIO pin configured.

GPIO_BASE_ADDRESS = 512
LED_PIN = 3

Pin used: 515

@gotling gotling added bug Something isn't working remote Issues relating to remote labels Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working remote Issues relating to remote
Projects
None yet
Development

No branches or pull requests

1 participant