Dockerized arduino-cli
sketch
compilation tool with per-project core and library dependencies support.
-
Install Docker Engine on your machine.
-
Go to your Arduino sketch folder which contains the main
.ino
file. -
Create
project.yaml
with the following content:# Filename of the project's main sketch sketch: Blink.ino # Sketch version (optional; appended to filename of compiled binary file) version: 1.0.0 # Compilation target target: # Arduino core name core: arduino:samd # Installs the latest version; or # core: arduino:samd==1.6.21 # Installs v1.6.21 # Arduino board FQBN string (obtained from `arduino-cli board list`) board: arduino:samd:mkrzero # Additional board manager URL for core installation (optional) url: https://arduino.esp8266.com/stable/package_esp8266com_index.json # Libraries to be included for compilation libraries: - Arduino Low Power # Installs the latest version; or # - Arduino Low Power==1.2.1 # Installs v1.2.1
-
Download
arduino-cli-compile
to aPATH
directory and make it executable. -
Run
arduino-cli-compile path/to/sketch/folder
. -
The compiled binary file will appear in
dist/
inside the sketch folder. -
Upload the compiled binary file to your Arduino board. This part is not (yet) Dockerized. For example, you can use
arduino-cli
installed on your machine connecting to the board:arduino-cli upload -p /dev/ttyACM0 -b arduino:samd:mkrzero -i path/to/bin/file
-
Watch your board blinking!