user3666672
user3666672

Reputation: 19

cat /dev/ttyUSB - Why does this work, also why doesn't it work

I have an devive blasting some data continiously into an FTDI that's connected to my PC over USB. I want to log the data into a CSV using a simple bash script.

When I cat /dev/ttyUSB0 I'm getting some characters that I want (1023) and also some malformed random character.

  1. How does the phy reciving the data know the baud rate?
  2. Where are the malformed packets coming from?

Running: Debian GNU/Linux 8 (jessie) 64-bit

Screencap of output

Upvotes: 1

Views: 3550

Answers (1)

J. P. Petersen
J. P. Petersen

Reputation: 5031

  1. You can set the baud rate using stty. For example to set the baudrate to 9600 do:

    stty -F /dev/ttyUSB0 9600
    
  2. This could because ground has not been connected between the devices. Loose connections. Noise if you use long serial wires. There could be many reasons.

Upvotes: 2

Related Questions