Day 192 – Using the UDOO x86’s Arduino with Arduino-CLI

In a previous blog post, I wrote about using the official Arduino IDE with the on-board Arduino 101 on the UDOO x86 Ultra. Since our robot is headless, i.e. doesn’t run a display server, we wanted the IDE to run from the command line. While the IDE had support for using its functionality from the command line, it still, for some reason, required a display server to run. I solved this by creating a virtual X11 wrapper and running it inside that. Which was fine, but slow and pretty dodgy.

Day 158 – Arduino and UDOO Communication

Since then however, an official Arduino command line tool has been released! Which means it’s time for another tutorial!

Download the arduino-cli binary. I’m using the Linux 64 binary, since the UDOO uses a 64 bit x86 CPU, but binaries are available for ARM and a few other platforms as well, just replace the last bit of the URL.

Extract it with:

Rename the file with:

You’ll likely want to move it somewhere in your $PATH, such as /usr/local/bin

The first thing we want to do is install support for the Intel Curie / 101 board. We can do this with the board manager:

The arduino-cli program is easy to use. To install libraries, which we need to do for any sensor we use, we can just do this:

This installs the Adafruit libraries for most of the sensors we use. You can also use arduino-cli lib search to search for libraries.

To compile a sketch, move to the sketch directory and use:

Finally to upload a sketch, you should be able to run:

That’s all there is to it. This is naturally much quicker than the old method and should be easier to debug, not to mention much easier to set up.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.