Pages: [1]   Go Down
Author Topic: Opening serial connection to Arduino through Bash script/shell  (Read 925 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have set up my Arduino so when I send a "0" via the serial monitor, a stepper motor turns a given amount.

I want to include this in a bash script, but I can only get this to work when the arduino serial monitor is open and entering "echo 0 > /dev/tty.usbserial641" in bash. I assume this is because serial monitor is opening the connection for me.

In my struggle to open the connection in bash (without serial monitor open) I have tried all manner of options with "stty -f /dev/tty.usbserial641" and have also tried connecting reset to ground with a 10uF capacitor.

Can any help me open the connection in bash without the use of arduino serial monitor?

System:
Arduino Uno rev3
OS X 10.8.4

Many thanks,
hcaw
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SOLUTION!

I found a great binary written in C that solves my problem called Arduino-serial. Here's the link. I hope this helps people with similar problems!

ps. I should add, you will need that 10uF cap between reset & ground in order to stop the Arduino auto-resetting every time you send a string over serial smiley
Logged

Pages: [1]   Go Up
Jump to: