1

I'm reading data from /dev/ttyACM0 using cat /dev/ttyACM0 on a Raspberry Pi. The data comes from a device, which sends lines in the form

15.00   1316013 15

where the first number is a value, the second a millisecond timestamp from the device.

When I do cat /dev/ttyACM0 > file.csv I receive one value every 12~13ms, but when I do the exact same thing over the network, I get a 1~2 second gap every 5 seconds.

Is it possible that there is lost data somewhere? Or that the OS blocks the serial device so it has to wait a couple of seconds to send more data? Is there any relation between a serial device and a piped network command?

I'm using either netcat or ssh to pipe the data. The device is sending data at 9600 bps

jasonwryan
  • 73,126
marianov
  • 173
  • 1
    Some of the links at http://unix.stackexchange.com/questions/33650/why-does-awk-do-full-buffering-when-reading-from-a-pipe may help you – cpugeniusmv Nov 17 '13 at 11:43

1 Answers1

0

Turns out cat /dev/ttyACM0 | awk is not exactly the same as </dev/ttyACM awk

And awk does buffering too, as cpugeniusmv commented.

marianov
  • 173