I’m using Gentoo and using Arduino on Gentoo isn’t very easy: Arduino on Gentoo Linux.
It is easy with Docker though. Let’s see how we can upload our first program to Arduino Uno without installing anything apart from Docker.
For Arduino Uno I need to enable
Device Drivers -> USB support -> USB Modem (CDC ACM) support
Then I compiling and loading it with
make modules && make modules_install && modprobe cdc-acm
/usr/src/linux. At last I connect Arduino and see it as
For this we just need image from
docker pull coopermaa/ino
It’s slightly outdated, but I sent PR to use new base image, because that’s how we do this in opensource world. Anyway it works great. Let’s create script for calling ino through Docker, add next script to your $PATH
#!/bin/sh docker run --rm --privileged --device=/dev/ttyACM0 -v $(pwd):/app coopermaa/ino $@
and call it ino. Don’t forget
chmod +x ino
Alternatively you can use alias in
alias ino='docker run --privileged \ --rm \ --device=/dev/ttyACM0 \ -v $(pwd):/app \ coopermaa/ino'
but script worked better with my vim.
Let’s create program from template and upload it to board:
$ mkdir blink && cd blink $ ino init -t blink $ ino build && ino upload
Whoa! It’s alive!
I’m using Vim plugin for ino, you
can easily install it with any plugin manager for vim. You don’t need anything
special, it’ll just work. You can compile and upload your sketch with
ino serial you need to add
docker run arguments to your
script. It works pretty weird though, you need to kill process
/usr/bin/python /usr/local/bin/ino serial by hands every time, but it works
and looks not so bad.
Also files created by
ino init will belong to root, which isn’t very
Thank you for reading and special thanks to coopermaa for ino image.