Linux connect usb serial

How to take a serial port connection via USB online?

I’d like be able to establish a connection to a headless Ubuntu 18.04 server from a Ubuntu 18.04 laptop via serial console in order to avoid having a graphic card consuming energy in the server. The motherboard is an ASRock X99 Extreme3. Its UEFI has an option to enable/disable the serial port which I set to enable — smart as I am — and to select 3F8h/IRQ4 or 3E8h/IRQ4 for the «Serial Port Address» where I left the initially selected 3F8h/IRQ4 without knowing what the values stand for. On the server, I connected a RS232 to D-Sub connector (DB9) to the serial port of the motherboard and plugged in a gender changer. It translates

------------- ----------- \ 5 4 3 2 1 / to / 5 4 3 2 1 \ \ 9 8 7 6 / / 9 8 7 6 \ --------- --------------- 
[ 4303.030466] pl2303 3-1.1:1.0: pl2303 converter detected [ 4303.031471] usb 3-1.1: pl2303 converter now attached to ttyUSB0 
[ 0.218803] printk: console [tty0] enabled [ 2.079815] 00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A 

I read about the possibility to specify a serial console to GRUB and related kernel parameters, however I don’t find any clear statement whether that’s necessary or not to be able to connect after the system booted (I don’t need to be able to connect to GRUB’s console for now). When I try to connect to the server using

sudo minicom -D /dev/ttyUSB0 
CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.7.1 | VT102 | Offline | ttyUSB0 

in the footer for the former and both terminals don’t take any input. I payed attention to match the device file to connect to with the one printed in dmesg . I’m suspicious that I don’t have to install or configure anything on the server side except turning on the serial port in the UEFI. Can that be correct? Maybe the BAUD rate isn’t negotiated automatically and needs to be configured, but I have no idea how to figure out the correct value. I ran the configuration for minicom , but could only select default values because I don’t find a good explanations — in all tutorials the connection just magically works after minicom -s apparently. Maybe the connection works and I’m missing the final step to connect. I added the desktop user account and root to the groups dialout and uucp . I can provide all necessary information for both server and laptop.

Читайте также:  Can you rdp windows linux

Источник

USB-Serial Port adapter (RS-232) in Ubuntu Linux

There are two other articles on a serial port adapter for Windows or Linux usb serial. Below is the instructions for Linux and how to connect your serial adapter while using Linux. This should work for most people using Linux and a serial adapter or usb to rs232 driver which is being discussed.

USB-Serial Port adapter (RS-232) in Ubuntu LinuxUSB to RS 232 driver Linux

1. Log into Linux under the root account;

2. Plug the USB-Serial adapter into the computer;

3. Give it a minute to discover the USB-Serial adpater;

4. Type in this command dmesg

5. The dmesg command will echo back the most recent few lines of the system message console, and you should see something like this:

  • usb 2.0: new full speed USB device using uhci and address 2
  • usb 2.0: configuration #1 chosen from 1 choice

6. Unplug the USB-Serial adapter to see a list of USB devices without it being plugged in.

7. Type this command to list the USB devices: lsusb

8. You should see a list of USB devices that looks like this:

  • Bus 001 Device 001: ID 0000:0000
  • Bus 002 Device 007: ID 03f0:4f11 Hewlett-Packard
  • Bus 002 Device 006: ID 05e3:1205 Genesys Logic, Inc. Afilias Optical Mouse H3003
  • Bus 002 Device 004: ID 15d9:0a33 Logitec-mouse

9. Then plug the USB into our device Then use the lsusb command again and observe the changes

  • Bus 001 Device 001: ID 0000:0000
  • Bus 002 Device 007: ID 03f0:4f11 Hewlett-Packard
  • Bus 002 Device 003: ID 018a:3754 Unknown device
  • Bus 002 Device 006: ID 05e3:1205 Genesys Logic, Inc. Afilias Optical Mouse H3003
  • Bus 002 Device 004: ID 15d9:0a33 Logitec-mouse
Читайте также:  Linux mint intel graphic drivers

10. Determine the vendor ID and the product ID by inspecting this additional line. In this example they are 018a and 3754. For a Trip•Lite USB-Serial adapter, they are 2303 and 067B. In this example it is a Minicom USB-Serial device. The first numbers identifies the vendor and the second numbers identifies the product.

11. Now use the following command to load the kernel module called usb serial and pass the vendor and product ID values to it. The driver can then associate itself with the correct hardware device on the USB bus.

12. Now c heck whether the new Serial Port device is available

13. You should now see something like this

  • usbserial_generic 1-1:1.0: generic converter detected
  • usb 1-1: generic converter now attached to ttyUSB0
  • usbcore: registered new interface driver usbserial_generic

14. This tells you that the serial device has now been mapped to the /dev/ttyUSBO serial port

15. Now we want to list the devices under the /dev/ path to see if the interface is visible with this command:

18. Instruct Ubuntu to load this module automatically by including the following line in the /etc/modules file. Substitute your own vendor and product ID if they are different.

That should be about it however if you have not installed the driver then you would have to install it now. If you are installing a Minicom serial device then you would do the following:

Press A and then edit to / dev / ttyUSB 0 ( this value, see dmesg | grep ttyUSB )

Press E and then edit to 9600 8N1

Читайте также:  Linux copy file with replace

Press F and the value will change from Yes to No

Once set up and finish off mode serial port setup.

Save setup as df1 finished off. Settings by Exit from Minicom

Other Issues:

This is for Ubuntu Linux for Red Hat the drivers should be in your OS however Triplite does have Red Hat drivers on their website if you do not have them on your system.

If you are trying to connect a Zigbee through this serial port you can do the following:

Make a symbolic link between ttyUSB0 and com2 by typing in terminal: (assuming you are using com2)

Then Add com2 port to X-CTU

Источник

Оцените статью
Adblock
detector