Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using gnu screen to access serial port

I am trying to access a device which is attached to a USB-serial port. The settings are 57600 baud, 8 bit, 1 stop bit, no parity. The device outputs a status line every second and accepts typed commands.

I would like to use GNU screen to initiate 2 way communications, so I am using this command:

screen /dev/ttyS2 57600,cs8

However I just get a blank screen, nothing received from the device.

The communication is fine using teraterm, and I can also do this

stty -F /dev/ttyS2 57600 cs8
cat /dev/ttyS2

to see the status output from the device.

I've tried various combinations of ixon, ixoff, crtscts, and clocal but nothing makes any difference.

How can I determine what the correct command should be?

I am using Cygwin on Windows 10.

like image 351
Peter Hull Avatar asked Nov 10 '22 00:11

Peter Hull


1 Answers

I faced the same issue with gnu-screen, I started using plink.exe instead from the PuTTY suite. It's not optimal, but it does the job. In my case serial is just for recovery, not for everyday usage.

  1. Start PuTTY, create a profile with your serial connection.
  2. Name and save the connection.
  3. From cygwin, run: '/cygdrive/c/Program\ Files\ (x86)/PuTTY/plink.exe -load SerialProfile'
like image 166
Simon Fredriksson Avatar answered Dec 18 '22 10:12

Simon Fredriksson