Usb to serial linux ubuntu

infotinks

My Notes, Articles & Guides for Linux, Windows and Networking.

How to use Prolific RS232 USB to Serial Converter with Ubuntu

How to use Prolific RS232 USB to Serial Converter with Ubuntu
###################################################

Using ubuntu 14.04 I didnt need to install any drives. Just plug and play. Also works with Ubuntu 11 (according to link) so should work with Ubuntu 11+ in general.

First plug in the Prolific to the device. My setup looks like this.

Computer—>Prolific—>DE9 cable—>Device

The DE9 cable is your typical null-model cable. That runs on RS232 standard. DE9 sometimes wrongly called DB9 cable. DB9 is the name for the port. DE9 is the name of the cable.

Anyhow here is the linux commands:

First check that it detects:
dmesg | grep tty

It should appear as a /dev/ttyUSB0 (or similar)

Now lets setup minicom (you can also use programs like screen). Minicom is best because you can change baud rate and stuff on the fly without exiting.

apt-get update
apt-get install minicom

Setup the initial connection parameters (these will be the defaults that last throughout history, you can of course change these)

sudo minicom -s

Note: note the use of sudo because /dev/ttyUSB0 probably has permissions only for root (you can ofcourse do some “ sudo chmod 666 /dev/ttyUSB0 ” type of commands to allow for regular user access)

When in “minicom -s” (minicom setup) navigate with keyboard and mouse

1. Go to “Serial Port Setup
2. Setup your device (first line) to say “/dev/ttyUSB0” (without the double quotes of course).
3. Change any other settings like baud rate from 9600 to 115200 (usually thats the only setting you have to change – stop bit and the like usually gets left as default)
4. Exit out of the “Serial Port Setup” to get back to the main menu of “minicom -s” (minicom setup)
5. “Save setup as dfl” to save the settings as default.
6. Select Exit to get out of minicom

Now open up minicom and you should be faced with the serial interface

sudo minicom

It will tell you that can do special commands using

Читайте также:  Выход из редактирования линукс

CONTROL-A then press a

CONTROL-A then press Z: to see all of the keys
CONTROL-A then press C: to clear the screen
CONTROL-A then press P: to change baud rates on the fly (usefull if your device goes thru different baud rates through its boot up phases, like at POST its at 9600 but post GRUB its at 115200)
CONTROL-A then press Q: to quit

Extra notes:
– When trying to find a working port or changing devices press ENTER after physical connection to see if you get any text
– If you get garbage text, try to change baud rates (look up baud rate of the device to find out the baud rate that you need to be configure for)
– The baud rate of the device your connecting to is what matters (not the baud rate of your PC)
– If your messing around with the physical connectiong, keep the USB end connected to the PC (dont remove that). Instead play around with the serial cable end.
– If trying to get an unknown device to work, first make a known device work using the above setup, then while keeping the Prolific converter in USB port, just dislodge the serial cable from the known good device to the unknown device (and hit enter)
– This method also works if you have a UART cable daisy chained off such as this:
Computer—–>Prolific—–>DE9 cable—–>Serial 2 UART convert——–>UART—–>Device

One thought on “ How to use Prolific RS232 USB to Serial Converter with Ubuntu ”

Thanks for the write up. I didn’t think about chmod 666 /dev/ttyUSB0. This worked for me, using PuTTY. Had to go into PuTTY settings and turn off flow control (on by default) and set the default serial to /dev/ttyUSB0.

Источник

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.

Читайте также:  Добавление своих ключей 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
Читайте также:  Search files with find linux

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

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