Blog
OpenEnergyMonitor

Developing for Arduino remotely on a Raspberry Pi

I found myself tonight requiring the ability to develop for Arduino remotely on a Raspberry Pi. The use case is connecting an Arduino Uno to a Raspberry Pi to receive data from my Bee Hive Temperature Monitor setup. The Arduino posts data received from the Bee Monitor as a serial string onto ttyUSB0, EmoncmsPythonLink script is used to post the data to the emoncms server running locally on the Raspberry Pi with the file system on an external hard drive. The Pi also has an RFM12Pi fitted receiving data from an emonTx and a couple of emonTH's

I wanted to be able to access the Arduino, and upload a new sketch to fix bugs etc remotely since I will not always have local access to the system.

I came across a great Arduino command line build environment called inotool

http://inotool.org/


$ sudo apt-get update 
$ sudo apt-get install arduino
$ sudo apt-get install python-dev&&python-setuptools
$ git clone git://github.com/amperka/ino.git
$ cd ino
$ sudo python setup.py install

if you want to use ino's built in serial terminal

$ sudo apt-get install picocom

to exit picocom serial [CTRL + A] followed by [CTRL + X]

$ ino init -t blink      # initiates a project using "blink" as a template, copy libraries into 
$ ino build               # compiles the sketch, creating .hex file (default Arduino uno -m atmega328 for duemilanove)
$ ino upload             # uploads the .hex file

The setup works well, opening the port on the router I can now ssh into the Pi and upload new sketches to the Arduino from anywhere on the web,

To engage in discussion regarding this post, please post on our Community Forum.