Talk:Arduino Communications

From Combustory
Revision as of 17:02, 1 December 2008 by Combustor (Talk | contribs)
Jump to: navigation, search

Notes from Creator

1 Dec 08 - Roland has provided an alternate solution that I have not investigated yet. By all means I recommend to look for a smoother way to accomplish this task, and please report any successes. Right now I have invested my time and my method works for my needs, some day I may evaluate other ways as well. I also want to give Roland credit for the inspiration of his SMS solution, which I reviewed before I made my solution. I liked his ideas and I used his basic concept to forge my method as well.

If you are like me and you are always on the lookout for a step by step that reduces your development time, then my method does work great and I built my specific windows Apps quite a bit since I authored this solution.

One note on his comment concerning the resetting of the board. My method does not reset the board as long as stty command remains active with the Arduino.

I would love to hear more comments.

22 Nov 08 Discussion From Roland Latour

Communication with Arduino Diecimila under linux is not that difficult. The instructions at recommend using 'screen', which actually forks a child of itself to handle responses from the board. You can do the same from the bash shell. First, start a helper program:

 cat /dev/ttyUSB0 >> logfile1.raw &

When you unplug the Diecimila, ttyUSB0 goes away, causing this job to exit. You also need this because without a process holding open the connection, the Diecimila resets itself after every command.

Then send commands to the unit. Here's a sample that sends 'r a' to Simple Message System on the Diecimila to read the analog ports:

 /bin/echo -e -n "r a\r" > /dev/ttyUSB0

Then get the results with this command:

 tail -1 logfile1.raw

That's it! Everything else is window dressing.

As proof of concept, check out my package of shell scripts to talk to Simple Message System. Full IO & PWM control. AD is scaled to milliVolts and formatted for import to most spreadsheets. Navigate to

and download SMS1.tgz, a tar gzip'd archive file. Unpack it with:

 tar xvzf SMS1.tgz

You can't (under GPLv2) remove my name and claim it as your own, but you can take it apart and re-assemble the pieces in new & interesting ways (I hope you do). Written under Kubuntu, other OSes may vary (especially Slackware!) Questions: contact I hope you find this useful. -Roland Latour

Personal tools
Your Ad Here
Your Ad Here