Manually Controlling GPIO Pins (Pucks) - Carleton-SRL/SPOT GitHub Wiki
[!WARNING] The following steps are only valid for Jetson Xavier boards. For some reason, in their infinite wisdom NVIDIA decided to completely change the process on the Jetson Orin boards. For now, very few things are connected to the Orin computer GPIO pins, so this should be a non-issue.
Sometimes, it can be convenient to circumvent the GUI and directly control the GPIO pins on the platforms. This can be done using the following commands while being remotely connected to the platforms. In the following sample code, 428
corresponds to the GPIO pin; changing this number will change with pin you are controlling. Here is a map of the pins, taken from this link:
Enabling Pins
echo 428 > /sys/class/gpio/export
Setting Pin Direction
To write to a pin:
echo out > /sys/class/gpio/gpio428/direction
To Read the state of a pin:
echo in > /sys/class/gpio/gpio428/direction
Set Pin State
To set a pin HIGH:
echo 1 > /sys/class/gpio/gpio428/value
To set a pin LOW:
echo 0 > /sys/class/gpio/gpio428/value
Checking which Pins are Active
ls /sys/class/gpio/
Disabling Pins
echo 428 > /sys/class/gpio/unexport