Friday, March 16, 2007

USB to Serial Adapter

My new laptop doesn't have a serial port. This is one of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 great tragedies of modern laptops in my opinion. At least for situations where I want to connect to cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 serial port on a server or system with a serial port, I can use a USB to serial adapter like this adapter I bought at NewEgg. I tested it just now by connecting to cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 serial port on my old FreeBSD laptop.

First I enabled cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 serial port in /etc/ttys

#ttyd0 "/usr/libexec/getty std.9600" dialup off secure
ttyd0 "/usr/libexec/getty std.9600" dialup on secure

Then I restarted init to activate it.

# kill -HUP 1

On my Ubuntu laptop I attached cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 USB to serial adapter to a null modem and a gender changer, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n connected it to cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 FreeBSD laptop serial port.

I installed cu(1) on Ubuntu

# apt-get install cu

cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n checked dmesg output to ensure I had a device to which I could connect.

[17213831.716000] usb 1-1: new full speed USB device using uhci_hcd and address 2
[17213831.876000] usb 1-1: configuration #1 chosen from 1 choice
[17213831.984000] usbcore: registered new driver usbserial
[17213831.984000] drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
[17213831.984000] usbcore: registered new driver usbserial_generic
[17213831.984000] drivers/usb/serial/usb-serial.c: USB Serial Driver core
[17213831.988000] drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303
[17213831.992000] pl2303 1-1:1.0: pl2303 converter detected
[17213831.992000] usb 1-1: pl2303 converter now attached to ttyUSB0
[17213831.992000] usbcore: registered new driver pl2303
[17213831.992000] drivers/usb/serial/pl2303.c: Prolific PL2303 USB to serial adaptor driver

Now that I saw /dev/ttyUSB0 was enabled, I connected to it.

richard@neely:~$ cu -l /dev/ttyUSB0
Connected.

FreeBSD/i386 (orr.taosecurity.com) (ttyd0)

login: richard
Password:
Last login: Fri Mar 16 11:57:49 on ttyv1
Copyright (c) 1992-2006 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 University of California. All rights reserved.

FreeBSD 6.1-SECURITY (GENERIC) #0: Wed Feb 14 15:33:28 UTC 2007

Welcome to FreeBSD!

That's it. If I needed to set a different speed I'd use cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 -s switch. For example, if 9600 above was 19200 in /etc/ttys, I'd use syntax like

richard@neely:~$ cu -l /dev/ttyUSB0 -s 19200

Now I know I can rely on this USB to serial adapter when I visit servers in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 data center.

19 comments:

John Ward said...

Thats cool. I had cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 same problem with my laptop not having a Parallel port. You should remember my rewired SNES controller from back in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 BATC days. Well, it requires that a particular pin have a 5V output, which not all parallel ports have. So I tried one of those USB adapters, but it didn't quite work. They make newer USB adapters for cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365se controllers which I may pick up. So be wary, different standards may prevent your setup from working in all scenarios, but at least it is good to know that cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365re is at least a baseline to work from if I ever come across this.

By cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 way, is that off of a Thinkpad? I noticed a bunch of those at Eclipsecon that had Parallel ports, but no serial port. Strange that cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 Dells are cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 exact opposite.

Anonymous said...

We have brought a bunch similar USB-RS232 converters at work for cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 same reasons.

The windows drivers are notoriously buggy, producing a blue screen if you use cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365m for too long.

Babak Farrokhi said...
This comment has been removed by cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 author.
pvaneynd said...

They also gave us one, but we have no end of problems with it. Sometimes cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 speed won't change or it cannot send a break.

The IBM serial+parallel port thing seems to work better.

Landon Lewis said...

I bought a similar adapter made by Keyspan. The 2.6.x kernel provides support for it, however Debian/Ubuntu disabled it b/c of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 licensing model. So I had to recompile cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 kernel by hand. Not a big deal, but nothing "plug-n-pray" like your experience.

The device now works perfectly with minicom, cu, etc. I did however run into a problem using iWar in analog mode however. I would be interested to know if you get cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 same results with this adapter.

I blogged (in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 link below) about iWar in VOIP mode and plan to write one about analog mode after resolving this issue.

http://www.digitalbond.com/index.php/2007/03/07/assessing-modems-with-iwar-voip-mode/

Anonymous said...

Interesting -- I just bought one yesterday for my "Vista" laptop, which probably means I'll have *some* problems like everything Vista.

That said, some people seem to have zero problems, ocá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365rs endless headaches.

I certainly agree cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 lack of Serial ports is a major nuisance!

Anonymous said...

Rich,

If you're doing a lot of work with serial I recommend using screen. It can auto-detect cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 speeds and settings you need.

-Pete

Anonymous said...

cool, i had done that in windows, so dun have cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 hassle of entering cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 commands. of course, i can do it with nix, but i guess cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 project was urgent during that period of time, so i have to use windows. But well, thats a nice piece of info to have.

http://hackathology.blogspot.com/

Richard Bejtlich said...

geek00l asked me in IRC about using this adapter to connect to Cisco gear. I connected cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 adapter to a rolled cable, and was able to access my Cisco switch.

Anonymous said...

i ahd try to follow cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 tutorial but it seem doesn't work. i cant' find /etc/ttys in my computer:
root@cceng:~# cd /etc/ttys
bash: cd: /etc/ttys: No such file or directory

do you guys have any ocá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365r idea how can i use my usb to rs232 converter. Actually i want to use cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 usb to rs232 converter connected to ts7200 single board computer.

Anonymous said...
This comment has been removed by a blog administrator.
Matt said...

Thanks for cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 article; I didn't know to check dmesg for things like new usb devices. Here I was looking for a linux driver for my Dynex USB to Serial adapter, when all along Ubuntu had plug & played cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 thing, loaded a driver and stuck it on /dev/ttyUSB0.

I never would have guessed that this adapter would just work after plugging it in. After typing cu -l /dev/ttyUSB0 I was magically connected to my cisco router I had hooked up to it. Amazing. Thanks again.

Anonymous said...

It's so easy to set up, but i had a little trouble, could you please tell me how can i close a connection, I use to kill cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 process number but cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365re should be anocá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365r way to close, because when i connect again it shows a warning message

pp@pp-laptop:~$ cu -l /dev/ttyUSB0
cu: Stale lock /var/lock/LCK..ttyUSB0 held by process 25339 created 2008-09-02 16:42:57

Anonymous said...

To disconnect a cu session type ~.

Anonymous said...
This comment has been removed by a blog administrator.
Richard Bejtlich said...

Run cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 minicom program and using command CTRL-a z o (inside minicom) to configure cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 minicom serial port. Make sure cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 configuration look like this.

A - Serial Device : /dev/ttyUSB0
B - Lockfile Location : /var/lock
C - Callin Program :
D - Callout Program :
E - Bps/Par/Bits : 9600 8N1
F - Hardware Flow Control : Yes
G - Software Flow Control : No

Richard Bejtlich said...

Windows driver (untested)

http://www.prolific.com.tw/eng/downloads.asp?ID=31

Unknown said...
This comment has been removed by cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 author.
Unknown said...
This comment has been removed by a blog administrator.