2015-01-14 03:53:30 +00:00
|
|
|
# docker-ino
|
|
|
|
|
|
|
|
Ino is a command line toolkit for working with Arduino hardware.
|
|
|
|
|
|
|
|
The docker image helps you to run ino in docker to serve the purpose.
|
|
|
|
|
|
|
|
## Quickstart
|
|
|
|
|
2015-01-14 11:00:02 +00:00
|
|
|
Save the alias setting below in ~/.profile or ~/.bashrc:
|
2015-01-14 03:53:30 +00:00
|
|
|
|
2015-01-14 11:00:02 +00:00
|
|
|
$ alias ino='sudo docker run --privileged \
|
2015-01-14 03:53:30 +00:00
|
|
|
-v /dev/ttyS1:/dev/ttyS1 \
|
|
|
|
-v $(pwd):/app \
|
|
|
|
coopermaa/ino'
|
|
|
|
|
2015-01-14 11:00:02 +00:00
|
|
|
Run "source ~/.profile" or "source ~/.bashrc" to make it take effect.
|
2015-01-14 03:53:30 +00:00
|
|
|
|
|
|
|
Create a simple project and use blink as a project template which will create a simple sketch for LED blinking on pin 13:
|
|
|
|
|
2015-01-14 11:00:02 +00:00
|
|
|
$ mkdir blink && cd blink
|
2015-01-14 03:53:30 +00:00
|
|
|
$ ino init -t blink
|
|
|
|
|
2015-01-14 03:57:52 +00:00
|
|
|
If you look at the contents of your blink directory, you should see a lib and a src directory. Within src, there will be a file called sketch.ino
|
2015-01-14 03:53:30 +00:00
|
|
|
|
|
|
|
Let's build it and upload it:
|
|
|
|
|
|
|
|
$ ino build
|
|
|
|
$ ino upload -p /dev/ttyS1
|
|
|
|
|
2015-01-16 02:38:43 +00:00
|
|
|
When the job is done, Arduino flashes with its built-in LED on pin 13.
|
2015-01-14 03:53:30 +00:00
|
|
|
|
|
|
|
## Tweaking parameters
|
|
|
|
|
|
|
|
All examples were done in assumption that you have Arduino Uno.
|
|
|
|
If you have Arduino Mega 2560 and it is available on port /dev/ttyACM1.
|
|
|
|
We have to specify this for our build steps as command-line switches (You have to update the alias setting too):
|
|
|
|
|
|
|
|
$ ino build -m mega2560
|
|
|
|
$ ino upload -m mega2560 -p /dev/ttyACM1
|
|
|
|
|
2015-01-14 13:08:27 +00:00
|
|
|
See [official ino documentation](http://inotool.org/quickstart) for more information.
|
2015-01-14 03:53:30 +00:00
|
|
|
|
|
|
|
## For boot2docker user on Windows
|
|
|
|
|
|
|
|
First, get the serial port number associated with your Arduino board (use Device Manager).
|
|
|
|
|
|
|
|
Shutdown your VM if you still have it open. Don't save the state - completely shut it down:
|
|
|
|
|
|
|
|
$ boot2docker halt
|
|
|
|
|
|
|
|
Now navigate to VirtualBox, select the VM "boot2docker-vm" and then click settings.
|
|
|
|
Select the "Serial Ports" option on the left hand side.
|
|
|
|
|
|
|
|
Click the "Port 2" tab, and then select "Enable Serial Port". For the Port Number, set to COM2.
|
|
|
|
This tells VirtualBox to have the Arduino board mounted at /dev/ttyS1. For the Port Mode, select "Host Device".
|
|
|
|
For "Port/File Path:", Enter in COM#. The colon needs to be there.
|
|
|
|
|
|
|
|
![screencut](virtualbox-serialport.png)
|
|
|
|
|
|
|
|
That's it for configuring VirtualBox. Bring your VM back up and start to play ino.
|