Open notnil opened 9 months ago
I get when logging the outputPin.Out error:
panic: bcm283x-gpio (GPIO27): subsystem gpiomem not initialized and sysfs not accessible
What is needed is a detection system, see https://github.com/periph/host/blob/main/rpi/rpi.go#L28 or https://github.com/periph/host/blob/main/beagle/black/black.go#L31 or https://github.com/periph/host/blob/main/orangepi/orangepi.go#L27 for example.
Ok just to confirm it won't work and I'll have to figure out another way to run?
Do not use the rpi package if you are not on a raspberry pi. Instead, use GPIOs as they are named, using the gpioreg package; https://pkg.go.dev/periph.io/x/conn/v3/gpio/gpioreg#ByName
package main
import (
"os"
"github.com/rs/zerolog"
"periph.io/x/conn/v3/driver/driverreg"
"periph.io/x/conn/v3/gpio/gpioreg"
)
func main() {
logger := zerolog.New(os.Stdout)
if _, err := driverreg.Init(); err != nil {
logger.Fatal().Err(err).Msg("failed to initialize periph.io")
}
for _, pin := range gpioreg.All() {
logger.Info().Interface("pin", pin).Msg("found pin")
}
if gpioreg.ByName("16") == nil {
logger.Fatal().Msg("Failed to find GPI16")
}
}
Doesn't find anything running on the Jetson AGX Orin. Command is run with sudo.
{"level":"fatal","message":"Failed to find GPI16"}
What kind of new feature are you looking for? (Keep the one that applies, please describe)
Do you plan to:
The Jetson Orin AGX has the RPi GPIO layout. Does this mean it will just work?
doesn't work while the equivalent on https://github.com/NVIDIA/jetson-gpio does: