5

I have connected a switch to a PC with a serial cable, and I want to manage it. What utility can I use to open a serial line and manage the switch through the console?

On Windows I used PuTTY (serial line COM1).

Peter Mortensen
  • 2,319
  • 5
  • 23
  • 24
TiFFolk
  • 1,077
  • 3
  • 14
  • 25
  • For the record, there is Putty on Linux too. At least on Debian since Wheezy (7). – MGP Mar 24 '17 at 12:19

6 Answers6

6

Minicom. Look here for some tutorial.

Peter Mortensen
  • 2,319
  • 5
  • 23
  • 24
pQd
  • 29,561
  • 5
  • 64
  • 106
  • I'm using gpsfeed+, and set serial parameetrs to COM1 & 4800. I couldn't get data via 'minicom -c on'; It says 'cannot open /dev/ttyS0: No such file or directory'. minicom serial port setup as /dev/ttyS0, 4800 8N1. What's wrong? – Dr.jacky Mar 11 '17 at 17:50
  • Does /dev/ttyS0 actually exist? If you're using a USB to serial adapter (which might be COM1 on Windows if you don't have a physical serial port), you'll probably have to use `/dev/ttyUSB0` or something similar (exact name might depend on kernel and chipset of adapter). – Ale Mar 19 '17 at 14:28
6

GNU Screen will do this as well. You just provide the argument of whatever device you are using, for example:

screen /dev/ttyUSB0
screen /dev/ttyS0

Like any other file, you will need read write privileges for the /dev/tty* devices. See the 'Window Types' section of man screen to see how to specify the baud rate etc, but screen can usually figure this out.

Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444
3

I prefer picocom personally.

Minicom has too much ncurses bloat for my liking. It always takes me ages to get where I want.

Whereas with picocom you specify all of your options (baud/parity/stop) on the command line, no fuss.

Dan Carley
  • 25,189
  • 5
  • 52
  • 70
  • You can easily set a minirc.dfl file in /etc/, a ~/.minirc.dfl or whatever, or you can have a script and call it via -s, so it can be automated to a degree. – Kurt Jun 11 '09 at 07:46
  • I know, it's just far more complicated than it needs to be though. Especially when I find myself changing parity between different hosts. – Dan Carley Jun 11 '09 at 11:31
3

We use Kermit with a simple configuration/script file that sets the options.

Peter Mortensen
  • 2,319
  • 5
  • 23
  • 24
David Pashley
  • 23,151
  • 2
  • 41
  • 71
0

I use minicom. Relatively straightforward, and works like a charm.

womble
  • 95,029
  • 29
  • 173
  • 228
-1

I use CuteCom with a USB-to-serial device. You may have to start it with 'sudo ./cutecom' in order to have it access the ttyUSB of your computer.

Peter Mortensen
  • 2,319
  • 5
  • 23
  • 24
  • 2
    Suggesting to use `sudo` to get around a permissions problem is a very bad idea. in general you never want to use sudo for something that does not actually need admin privileges (see also https://en.wikipedia.org/wiki/Principle_of_least_privilege). Users needing to access a serial port don't need them, simply put the user in the `dialout` group, change the udev rules for serial ports so another group is used for them, or temporarily adjust them with a `sudo chmod 666 /dev/ttyS0` (but this is only a temporary fix and might allow other users to use the port when they're not supposed to) – Ale Mar 19 '17 at 14:01