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

Jetson Orin AGX #69

Open
notnil opened this issue Jan 15, 2024 · 5 comments
Open

Jetson Orin AGX #69

notnil opened this issue Jan 15, 2024 · 5 comments

Comments

@notnil
Copy link

notnil commented Jan 15, 2024

What kind of new feature are you looking for?
(Keep the one that applies, please describe)

  • Hardware: Jetson Orin AGX

Do you plan to:

The Jetson Orin AGX has the RPi GPIO layout. Does this mean it will just work?

_, err := host.Init()
if err != nil {
    panic(err)
}

outputPin := rpi.P1_13
outputPin.Out(gpio.High)

doesn't work while the equivalent on https://github.com/NVIDIA/jetson-gpio does:

import RPi.GPIO as GPIO
import time

# Pin Definitons:
led_pin = 13  # BOARD pin 13

def main():
    # Pin Setup:
    GPIO.setmode(GPIO.BOARD)  # BOARD pin-numbering scheme
    GPIO.setup(led_pin, GPIO.OUT)  # LED pin set as output

    GPIO.output(led_pin, GPIO.HIGH)

if __name__ == '__main__':
    main()
@notnil
Copy link
Author

notnil commented Jan 15, 2024

I get when logging the outputPin.Out error:

panic: bcm283x-gpio (GPIO27): subsystem gpiomem not initialized and sysfs not accessible

@notnil
Copy link
Author

notnil commented Jan 15, 2024

Ok just to confirm it won't work and I'll have to figure out another way to run?

@maruel
Copy link
Member

maruel commented Jan 15, 2024

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

@notnil
Copy link
Author

notnil commented Jan 15, 2024

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"}

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

No branches or pull requests

2 participants