Loading arduino programs from headless raspberry pi

A couple years ago, I built with an arduino, a peristaltic pump, an LCD display and an H-Bridge motor controller, a watering machine for the orchid I keep at the office.

arduino

The other day I pressed a button I had put in place to be able to configure the timing for the watering and I must have pressed the sequence wrong (was it push, hold, push, push? or was it push ,push, hold, push…) so now instead of watering for 10 minutes in order to fill the pot and empty it, it just waters for 1 minute. To avoid my orchid from drying up I’ve reverted to the manual workaround of taking it to the kitchen by hand, but this is no way to water a plant…

I could take the whole system home, connect it to my computer and test it out of course, but it would be much cooler to go to the office with a raspberry pi-wifi hotspot, connect to it with my iphone and reload the (simplified) program.

To do it I’ve prepared my raspberry pi the following way:

  1. set up the wifi hotspot
  2. Install arduino
    1. sudo apt-get update
    2. sudo apt-get install arduino
    3. sudo apt-get install python-dev
    4. sudo apt-get install python-setuptools
    5. git clone git://github.com/amperka/ino.git
    6. cd ino
    7. sudo python setup.py install
    8. sudo apt-get install picocom
      1. to exit picocom serial [CTRL + A] followed by [CTRL + X]

  3. Connect the arduino to the raspberry pi via usb
  4. Load the program
    1. mkdir blink && cd blink #we must work on an empty directory
    2. ino init -t blink # initiates a project using “blink” as a template, copy libraries into
    3. ino build # compiles the sketch, creating .hex file (default Arduino uno -m atmega328 for duemilanove)
    4. ino upload # uploads the .hex file
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s