Pages: [1]   Go Down
Author Topic: arduino uno seen as /dev/ttyACM0: "echo" working only if "cat" is on?  (Read 2544 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi
I've connected an arduino uno (controlling fans and reading a temp. sensor) to a wireless router where openwrt is installed, the connection is through USB and openwrt mounts arduino as /dev/ttyACM0 (cdc acm driver)

the code running on arduino is a small interactive menu: e.g. if "A" is read on the serial port it switches on the fans and print out a message on the serial, etc.

on openwrt with "microcom -D/dev/ttyACM0" I can interact with arduino in a smooth way, sending characters and receiving messages

I would like to send characters directly through the commandline, e.g. "echo A > /dev/tyyACM0" but it does not work, i.e. nothing happens

the "echo" command only works when (on another terminal) I have a "cat" session opened, i.e. "cat < /dev/ttyACM0" is running: in this case when I send characters with "echo" I get the correct messages on the terminal where "cat" is running and arduino behaves correctly

it is however annoying that - to issue a command (send a character) - I have to open another terminal and keep cat open

any idea?

thanks

 Andrea

Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would think that the cat session is holding the Arduino serial port open. Without that, each time you echo a character to the port, the Arduino will be doing its serial port open auto-reset. http://arduino.cc/playground/Main/DisablingAutoResetOnSerialConnection might help.
Logged

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

hello, this is an old post but google is pointing here.

I found a workaround for this problem on the web.
On the openwrt console you must type :

cat /dev/ttyACM0 &

( the & symbol will keep executing this command but in background preventing the reset )

You can add it in a script at boot.
Logged

Pages: [1]   Go Up
Jump to: