Go Down

Topic: Opening serial connection to Arduino through Bash script/shell (Read 1 time) previous topic - next topic


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?

Arduino Uno rev3
OS X 10.8.4

Many thanks,



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 :)

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131