Cheap FreeBSD-compatible USB-serial adapter

I received my cheap USB-serial adapter today for experimenting with embedded devices that require TTL-level “serial” interfaces. This particular product is officially sold as a USB adapter for Nokia N1200/1208/1650/2630/2670 mobile phones. However, the phone end is basically a serial port running at 3.3V (TTL levels). Inside the larger-than-usual USB connector is a Prolific Technology PL2303 USB-to-serial adapter chip. Cut off the phone end of the cable, and you find three wires — GND, TX (signal coming from the USB connector to your target device’s RX pin) and RX (signal coming from your target device’s TX pin). In my particular unit, TX was the red wire and RX the white wire. (Apparently if you break into the USB connector, the PCB exposes pads for DTR and VCC lines too.)

When plugged in under FreeBSD 8.1-RELEASE this device’s Prolific chip is recognised as:

Jan 25 18:08:32 gjadesktop kernel: ugen0.2: at usbus0
Jan 25 18:08:32 gjadesktop kernel: uplcom0: on usbus0

On the FreeBSD host this serial port “appears” as /dev/cuaU0 (or /dev/cuaU<n>, if this isn’t the first serial adapter inserted into your FreeBSD host)

Use ‘cu’ on the FreeBSD side to establish a connection to the serial interface:

cu -l /dev/cuaU0 -s <speed>

where <speed> represents the baud rate of the serial device to which you are connecting.

(Edit: I’ve subsequently used this serial port for console access to an NSK-330, TP-Link WR703N, and TP-Link WR1043ND. Nice.)

More information (from a later FreeBSD desktop, running FreeBSD 8.2-RELEASE)

[gja@gjadesktop]/home/gja(106)% usbconfig dump_device_desc
ugen4.3:  at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0110 
  bDeviceClass = 0x0000 
  bDeviceSubClass = 0x0000 
  bDeviceProtocol = 0x0000 
  bMaxPacketSize0 = 0x0040 
  idVendor = 0x067b 
  idProduct = 0x2303 
  bcdDevice = 0x0300 
  iManufacturer = 0x0001  
  iProduct = 0x0002  
  iSerialNumber = 0x0000  
  bNumConfigurations = 0x0001 

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: