maandag 16 februari 2015

Use SCREEN to connect to a serial device on OSX with a USB-Serial adapter

Use SCREEN to connect to a serial device on OSX 

How to use the SCREEN command how to connect to a serial device with a USB-serial adapter. Plug in your USB-serial adapter and install the driver.
To start you open a terminal, Applications->Utilities->Terminal.app

First we need to find out where the USB-serial is located.
ls /dev/tty.*

This gives an output like:
/dev/tty.Bluetooth-Modem /dev/tty.PL2303-0000201A   /dev/tty.Bluetooth-PDA-Sync

You can ignore the bluetooth devices. Mostly you see something like  PL2303-xxxxxxxx of USBxxxxxxxx those are most common. PL2303 stands for a Profilic chipset. To connect to this device use this command.

screen /dev/tty.PL2303-0000201A 9600

In this case we use a baudrate of 9600 bps (Cisco) in other cases you can fill in another baudrate, the most common are:
9600
38400
115200

The standard values are: 9600/8-N-1
9600
8 bits
Parity None
1 stopbit

These values are very usefull in most cases but you can change them with the following
cs7 / cs8 = 7 databits / 8 databits
parodd / -parodd = Parity odd / Parity even
cstopb / -cstopb = 2 stopbits / 1 stopbit

For example if you would want to use 38400 7E2 we fill in:
screen /dev/tty.PL2303-0000201A 38400,cs7,-parrodd,cstopb
To disconnect use ctrl-a followed by ctrl-k

Geen opmerkingen:

Een reactie posten