CircuitPython & Jetson Nano

CircuitPython Libraries on Linux & NVIDIA Jetson Nano

The next obvious step is to bring CircuitPython ease of use back to 'desktop Python'. We've got tons of projects, libraries and example code for CircuitPython on microcontrollers, and thanks to the flexibility and power of Python its pretty easy to get it working with microcomputers like the Jetson Nano or other 'Linux with GPIO pins available' single board computers.

We'll use a special library called adafruit_blinka (named after Blinka, the CircuitPython mascot) to provide the layer that translates the CircuitPython hardware API to whatever library the Linux board provides. For example, on the Jetson Nano we use the python libgpiod bindings. For any I2C interfacing we'll use ioctl messages to the /dev/i2c device. These details don't matter so much because they all happen underneath the adafruit_blinka layer.

The upshot is that any code we have for CircuitPython will be instantly and easily runnable on Linux computers like the Jetson Nano.

In particular, we'll be able to use all of our device drivers - the sensors, led controllers, motor drivers, HATs, bonnets, etc. And nearly all of these use I2C or SPI!

Wait, isn't there already something that does this - Jetson.GPIO?

Jetson.GPIO is a pure python hardware interface class for the Jetson Nano. It works just fine for I2C, SPI and GPIO but doesn't work with our drivers as it's a different API

By letting you use CircuitPython libraries on the Jetson Nano via adafruit_blinka, you can unlock all of the drivers and example code we wrote! And you can keep using Jetson.GPIO if you like. We save time and effort so we can focus on getting code that works in one place, and you get to reuse all the code we've written already.

What about other Linux SBCs?

Yep! Blinka can easily be updated to add other boards. We've started with the ones we've got, so we could test them thoroughly. If you have other SBC board you'd like to adapt check out the adafruit_blinka code on github, pull requests are welcome as there's a ton of different Linux boards out there!

This guide was first published on Sep 10, 2019. It was last updated on 2019-09-10 23:16:10 -0400. This page (CircuitPython & Jetson Nano) was last updated on Sep 16, 2019.