4

Goal: configure serial to USB cable for 9600 8-N-1

Cable is plugged-in and observed:

root@OpenHAB:~# uname -a
Linux OpenHAB 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l GNU/Linux
root@OpenHAB:~# lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
root@OpenHAB:~# ls /dev/ttyUSB*
/dev/ttyUSB0

Is there a good reference for configuring a Manhattan Serial to USB cable

Is there a litmus test that can be performed from the command line to confirm that the serial port is online and at the ready?

Patrick Cook
  • 6,365
  • 8
  • 38
  • 63
gatorback
  • 637
  • 1
  • 6
  • 21

1 Answers1

4

If you mean configure the Linux end which is using /dev/ttyUSB0

stty -F /dev/ttyUSB0 -cstopb cs8 -parenb 9600

where

-cstopb is 1 stop bit
cs8 is 8 bits
-parenb is no parity
9600 is the baud rate

For full details man stty

Actually 9600-8-N-1 is the default.

The presence of /dev/ttyUSB0 implies the device is ready. Unless the device supports handshake signals that's the best you can do without actually trying to read/write to the device.

joan
  • 71,852
  • 5
  • 76
  • 108