Mixology Bot: Talking to Arduino

Since my last post I’ve been doing a lot of work on the linux command line on the raspberry pi.
I hope my notes are complete. Let me know if I missed something?

Several people have suggested using the GPIO pins on the RPI to talk to the Arduino. Personally? This is a terrible solution to a non-problem. The RPI runs at a different voltage from the Arduino, which means you need a third thing in between to “translate” between each voltage or you fry the RPI. No thank you! I’m connected to the Arduino over the USB hub.

sudo apt-get install picocom arduino python-serial python3-serial

In one line I install about 175mb of stuff on the SD card, all of it tools.

Then I used python easy setup to install inotools, linux command line tools that make it easy to compile and upload sketches.

I would not have known about inotools if it weren’t for kline and the other kind members of Freenode IRC #arduino channel. Linux is a bottomless pit of mystery and my only saving grace is that I know how to is ask questions politely.

Now that I’ve got intools installed uploading a script is a breeze.

ino build
ino upload
ino serial

That last line lets me see any serial messages coming back from the Arduino. That’s how I know it’s working, even though my pi is at the other end of the lab.

Next up I’ll open a persistent two-way connection and send commands from the RPI to the Arduino when a button is clicked on an RPI web page. this should be interesting – I’ve never written a mini server before!

Tags: , ,

Leave a Reply