Talk:Arduino Communications

From Combustory
Revision as of 17:05, 1 December 2008 by Combustor (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

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, and it does not disconnect unless there is a power failure, so this is not an issue.

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 arduino.cc 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

 http://user.cavenet.com/rolandl

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 rolandl@cavenet.com. I hope you find this useful. -Roland Latour

Personal tools
Sponsers
Your Ad Here
Your Ad Here