Dependency sudo pip install Jetson.GPIO
Setting User Permissions In order to use the Jetson GPIO Library, the correct user permissions/groups must be set first.
Create a new gpio user group. Then add your user to the newly created group.
sudo groupadd -f -r gpio
sudo usermod -a -G gpio $USER
Install custom udev rules by copying the 99-gpio.rules file into the rules.d directory:
sudo cp /opt/nvidia/jetson-gpio/etc/99-gpio.rules /etc/udev/rules.d/
Please note that for the new rule to take place, you may either need to reboot or reload the udev rules by issuing this command:
sudo udevadm control --reload-rules && sudo udevadm trigger
sudo reboot
Run the Demo
sudo python JetsonNanoAdapterTestDemo.py
This demo will capture an image from each camera and save it to a local folder.
Setting User Permissions In order to use the Jetson GPIO Library, the correct user permissions/groups must be set first.
import RPi.GPIO as gp # sudo pip install Jetson.GPIO #https://pypi.org/project/Jetson.GPIO/#description import os gp.setwarnings(False) gp.setmode(gp.BOARD) gp.setup(7, gp.OUT) gp.setup(11, gp.OUT) gp.setup(12, gp.OUT) def main(): print"Start testing the camera A" i2c = "i2cset -y 1 0x70 0x00 0x04" os.system(i2c) gp.output(7, False) gp.output(11, False) gp.output(12, True) capture(1) print"Start testing the camera B" i2c = "i2cset -y 1 0x70 0x00 0x05" os.system(i2c) gp.output(7, True) gp.output(11, False) gp.output(12, True) capture(2) print"Start testing the camera C" i2c = "i2cset -y 1 0x70 0x00 0x06" os.system(i2c) gp.output(7, False) gp.output(11, True) gp.output(12, False) capture(3) print"Start testing the camera D" i2c = "i2cset -y 1 0x70 0x00 0x07" os.system(i2c) gp.output(7, True) gp.output(11, True) gp.output(12, False) capture(4) def capture(cam): #cmd = "raspistill -o capture_%d.jpg" % cam cmd = "nvgstcapture-1.0 -A --capture-auto -S 0 --image-res=3 --file-name=capture_%d.jpg" % cam os.system(cmd) if __name__ == "__main__": main() gp.output(7, False) gp.output(11, False) gp.output(12, True)