- infotinks
- My Notes, Articles & Guides for Linux, Windows and Networking.
- How to use Prolific RS232 USB to Serial Converter with Ubuntu
- One thought on “ How to use Prolific RS232 USB to Serial Converter with Ubuntu ”
- Connect to a serial device using a USB-to-Serial Convertor in Linux
- Steps
- USB-Serial Port adapter (RS-232) in Ubuntu Linux
- USB to RS 232 driver Linux
- Other Issues:
- USB to serial adapter
- Installation
- Kernel
- Additional software
- See also
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.
Connect to a serial device using a USB-to-Serial Convertor in Linux
For years, I had ran my Prolific USB to Serial cable from my Windows 32bit laptop without any issues.
Unfortunately, life when running Windows is never easy. After upgrading Windows 7 to 64bit I tried to install the drivers from CNET downloads.
This was a HUGE mistake. Even though the CNET downloader told me it was downloading at 28K in the background it was installing 8 (yes 8 plugins and other useless crap) onto all my browsers. Finally after cleaning up my machine and finding the drivers from a source not intent in filling my machine full of rubbish I discovered that the drivers fail to work correctly for Windows 7 64bit based platforms. Back to square 1.
After wasting 2 hours trying to get this working in Windows I powered up Linux Mint. Loaded the necessary kernel module and tested. Success ! All in all 20 minutes taken. So high five to Linux and I certainly wont be using CNET downloads again !
Steps
Connect the cable via USB.
[email protected] ~ $ lsusb Bus 002 Device 002: ID 090c:37a2 Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) Bus 005 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Then load the kernel module via the following command. Note : To ensure this survives a reboot append this line to ‘/etc/modules’
[email protected] ~ $ sudo modprobe usbserial vendor=0x067b product=0x2303
You should now see that it is now showing as attached by running ‘dmesg’.
[email protected] ~ $ dmesg [ 131.747013] USB Serial support registered for pl2303 [ 131.747038] pl2303 5-1:1.0: >pl2303 converter detected [ 131.758965] usb 5-1: >pl2303 converter now attached to ttyUSB0
Finally, you will need to connect through to serial device /dev/ttyUSB0. This easiest way to do this is via ‘minicom’. Once you have issued the following command it will present you with a menu. Change (within the ‘serial port setup’ option) the service device to /dev/ttyUSB0 and any other settings i.e baud rate etc. Then select the exit option and you be connected to your serial device.
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 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
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
USB to serial adapter
This article details the process of enabling support for USB to serial (RS-232, RS-422, RS-485 etc) adapters in the Linux kernel.
Most modern, user facing hardware devices do not come with serial ports accessible from the exterior casing of the device. This becomes an issue when attempting to configure or troubleshoot certain devices that implement a console port with serial communication for data input/output. Most modern hardware devices do include at least one USB port that is accessible from the device casing.
The Linux kernel has support for USB to serial adapters. These devices can be also known as USB serial converters. Support can be enabled in the kernel, udev will configure the device, and an engineer can obtain success communicating with serial input/output via the console port.
Installation
Kernel
Enable support for USB to serial by selecting the following symbols in the kernel’s configuration: CONFIG_USB_SERIAL , CONFIG_USB_SERIAL_CONSOLE , CONFIG_USB_SERIAL_GENERIC , and CONFIG_USB_SERIAL_SIMPLE :
Device Drivers ---> [*] USB support ---> USB Serial Converter support ---> --- USB Serial Converter support [*] USB Serial Console device support [*] USB Generic Serial Driver USB Serial Simple Driver
From this point, specific drivers for each hardware device can be enabled as necessary. To reduce kernel size it is wise to build support for additional adapters as modules.
After the above options have been enabled do not forget to recompile the kernel, update the bootloader, and re-execute the new kernel. Instructions for how to do these steps can be found in related articles.
Additional software
Useful software for accessing the serial interface: