Skip to content

Arduino CLI Usage

Luke Goertzen edited this page Sep 19, 2019 · 1 revision

Although still in beta, the Arduino command line interface can be used to replace the IDE.

This guide is for developers / advanced users.

Install Arduino-CLI

Follow the instructions on the Arduino CLI GitHub repository for details on installation.

Install Loom Board Dependencies

Make sure SAMD board profiles are installed (this step is not necessary if you've already setup Loom through the IDE).

arduino-cli core install adafruit:samd --additional-urls https://adafruit.github.io/arduino-board-index/package_adafruit_index.json

Compile

Replace "SomeSketch" below with your sketch name.

arduino-cli compile --fqbn adafruit:samd:adafruit_feather_m0 SomeSketch

Find Board Port

arduino-cli board list

Upload

Replace "SomeSketch" below with your sketch name, and "/dev/cu.usbmodem14401" with your device's port.

arduino-cli upload -p /dev/cu.usbmodem14401 -t -v --fqbn adafruit:samd:adafruit_feather_m0 SomeSketch --additional-urls https://adafruit.github.io/arduino-board-index/package_adafruit_index.json

Send Config Over Serial

Sending a config to the device via Serial may look like:

Replace "/dev/cu.usbmodem14401" with your device's port.

cat config.txt > /dev/cu.usbmodem14101 
cat JsonTest.json | jq --compact-output '.' | tr -d '\n' > /dev/cu.usbmodem14101 

View Serial Output

You can use whatever Serial viewer you want, including the Serial monitor of the Arduino IDE.

From the command line, one option is screen:

screen <port> <baud_rate>

e.g:

screen /dev/cu.usbmodem14101 115200

To exit the screen display, enter Ctrl+A, Ctrl+K, then y to confirm