How to send data through Linux TTY without running tail?

Hi all,

I use Linux TTY to send data to Arduino UNO.
It seems that another terminal has to run tail command, during sending data through Linux TTY.
tail -f /dev/ttyS0
Otherwise, Arduino doesn’t response to data I sent to it (even though the TX/RX LED is blinking during sending data).

I would like to execute the data transfer in a shell script. Thus I want to avoid running tail.
Could you please tell me if I can only send data to Arduino without running tail

Thank you.
Best regards.

I don't understand how "tail -f /dev/ttyS0" comes into this. /dev/ttyS0 is normally an inbuilt serial RS232 port on your computer and not a Uno. My Uno USB serial device is of the form /dev/ttyACMx where the 'x' may changes every time the Uno is connected. What am I missing?

Hi stowite,

Actually it is the same. I map the Arduino serial port to COM1 of my Ubuntu. Both ttyACMx and ttyS0 meet the same issue.

stowite: I don't understand how "tail -f /dev/ttyS0" comes into this. /dev/ttyS0 is normally an inbuilt serial RS232 port on your computer and not a Uno. My Uno USB serial device is of the form /dev/ttyACMx where the 'x' may changes every time the Uno is connected. What am I missing?

tbacarrot: Hi stowite,

Actually it is the same. I map the Arduino serial port to COM1 of my Ubuntu. Both ttyACMx and ttyS0 meet the same issue.

How have you done the mapping? Using udev? I still don't see where 'tail' comes in. What makes you think some process is using 'tail' on that device? Anything that opens that device could be the source of your problem.

Note - if you do actually have a 'COM1' then you can't sensibly map another port to it. Why not map it to something like ttyS99 ?

Hi stowite,

The key point is not about the port number. ttyACM0 also has the same problem.

This topic meet the similar issue as mine. However the solution cannot solve my issue.
http://forum.arduino.cc/index.php/topic,38838.0.html#1

stowite:
How have you done the mapping? Using udev? I still don’t see where ‘tail’ comes in. What makes you think some process is using ‘tail’ on that device? Anything that opens that device could be the source of your problem.

Note - if you do actually have a ‘COM1’ then you can’t sensibly map another port to it. Why not map it to something like ttyS99 ?

I really don't understand the relevance of 'tail' to your problem. It seems to me that 'tail' is a red herring and that you just need to make sure you have the correct access rights to your serial devices.

I use Java, Python and Perl to access serial devices. When I use hardware RS232 devices I have to configure them with stty but that is the only difference to using USB based pseudo serial devices. It is important to make sure that you have full access rights to the devices and adding group 'dialout' to your list of groups should give you all the rights you need.

You have not told us how you are trying to communicate with the Arduino (i.e. the code you are using) nor have you told us what Arduino you are using.

With an Uno or Mega the Arduino resets when the PC opens the serial port and the PC code must allow for that.

It may be a good idea to write a short Python program to communicate with the Arduino and call that from the command line if required.

...R

tbacarrot: I would like to execute the data transfer in a shell script. Thus I want to avoid running tail. Could you please tell me if I can only send data to Arduino without running tail

Hi.

I use to send data over linux terminal or even shell script like this:

echo -ne "hello arduino" > /dev/ttySXXX

And I use a usb to serial-ttl converter attached to my linux box, with RX and TX GND connected to arduino TX RX GND pin.

arssant:
Hi.

I use to send data over linux terminal or even shell script like this:

echo -ne "hello arduino" > /dev/ttySXXX

And I use a usb to serial-ttl converter attached to my linux box, with RX and TX GND connected to arduino TX RX GND pin.

I suspect the use of the serial-ttl converter (rather than the regular USB connection) is important to the success of this.

…R