Author Topic: How to make Vera recognize your USB-to-Serial Adapter  (Read 63232 times)

Offline cj

  • Hero Member
  • *****
  • Posts: 1253
  • Karma: +1/-0
    • MiCasaVerde
How to make Vera recognize your USB-to-Serial Adapter
« on: July 09, 2009, 11:15:25 am »
(in this example I'll take in consideration the and FTDI adapter)
 - login into your Vera command line
 - run dmesg > /tmp/dmesg-pre
 - plug your adapter into Vera's usb port
 - run dmesg > /tmp/dmesg-post
 - run diff -u /tmp/dmesg-pre /tmp/dmesg-post
 you shoudl see something like this

Quote
-usb.c: new device strings: Mfr=1, Product=2, SerialNumber=3
-usb.c: USB device number 5 default language ID 0x409
-Manufacturer: FTDI
-Product: USB FAST SERIAL ADAPTER
-SerialNumber: FT48DXER
-usb.c: unhandled interfaces on device
-usb.c: USB device 5 (vend/prod 0x403/0x6010) is not claimed by any active driver.

"is not claimed by any active driver" means that on Vera are no drivers that are for your device. In generally this are only new devices with another product code, which aren't known by the old driver but are working with it.
In this case we need the ftdi module which is ftdi_sio
 - remove the module: rmmod -f ftdi_sio
 - add the module and make it to claim your device: insmod vendor=0x403 product=0x6010
 - run: dmesg > /tmp/dmesg-post2
 - diff -u /tmp/dmesg-post /tmp/dmesg-post2
if you see something like this:
Quote
+hub.c: new USB device 00:03.1-1.2, assigned address 5
+usb.c: kmalloc IF 806febc0, numif 1
+usb.c: new device strings: Mfr=1, Product=2, SerialNumber=3
+usb.c: USB device number 5 default language ID 0x409
+Manufacturer: FTDI
+Product: FT232R USB UART
+SerialNumber: A9003Pjc
+usbserial.c: FTDI FT232BM Compatible converter detected
+usbserial.c: FTDI FT232BM Compatible converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
+usb.c: serial driver claimed interface 806febc0
+usb.c: kusbd: /sbin/hotplug-call add 5
it means that your adapter was recognized and attached to ttyUSB0

 - if you want that the adapter to be recognized again after reboot you'll have to do this also:
echo "ftdi_sio vendor=0x403 product=0x6010" > /etc/modules.d/65-usb-serial-ftdi

IF YOU FIND THAT THIS IS WORKING FOR YOUR ADAPTER PLEASE PASTE ON THIS THREAD IT'S KERNEL MODULE, VENDOR AND PRODUCT CODE SO I COULD ADD THEM BY DEFAULT IN THE FIRMWARE.
« Last Edit: July 09, 2009, 12:54:15 pm by cj »

Offline mizar

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
Re: How to make Vera recognize your USB-to-Serial Adapter
« Reply #1 on: July 12, 2009, 07:41:18 pm »
Still having trouble. I should have two usb serial ports, but vera only show one port for configuration.

From dmesg

Manufacturer: FTDI
Product: USB FAST SERIAL ADAPTER
SerialNumber: FT5LTOAF
usbserial.c: FTDI SIO compatible converter detected
usbserial.c: FTDI SIO compatible converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
usb.c: serial driver claimed interface 81cfe4a0
usbserial.c: FTDI SIO compatible converter detected
usbserial.c: FTDI SIO compatible converter now attached to ttyUSB2 (or usb/tts/2 for devfs)
usb.c: serial driver claimed interface 81cfe4b8

From /proc/tty/driver/usb-serial

root@HomeControl:/proc/tty/driver# cat usb-serial
usbserinfo:1.0 driver:v1.4
0: module:cp210x name:"CP210X" vendor:10c4 product:ea60 num_ports:1 port:1 path:usb-00:03.1-1.1
1: module:ftdi_sio name:"FTDI SIO compatible" vendor:0403 product:6010 num_ports:1 port:1 path:usb-00:03.1-1.2
2: module:ftdi_sio name:"FTDI SIO compatible" vendor:0403 product:6010 num_ports:1 port:1 path:usb-00:03.1-1.2

root@HomeControl:~# ls -lh /dev/usb/tts/
crw-------    1 root     root     188,   0 Jul 12 18:34 0
crw-------    1 root     root     188,   1 Dec 31  1969 1
crw-------    1 root     root     188,   2 Dec 31  1969 2

This device should have two serial ports, however vera only shows one port for configuration.


Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: How to make Vera recognize your USB-to-Serial Adapter
« Reply #2 on: August 03, 2009, 09:16:23 pm »
My new [Bytecc] Serial Portal isn't working correctly either.  I can see it being claimed, and allocated, but the serialProxy isn't displaying it in the Vera UI:

Code: [Select]
usb.c: kmalloc IF 81743ea0, numif 1
usb.c: new device strings: Mfr=1, Product=2, SerialNumber=0
usb.c: USB device number 6 default language ID 0x409
Manufacturer: Prolific Technology Inc.
Product: USB-Serial Controller
usbserial.c: PL-2303 converter detected
usbserial.c: PL-2303 converter now attached to ttyUSB2 (or usb/tts/2 for devfs)
usb.c: serial driver claimed interface 81743ea0
usb.c: kusbd: /sbin/hotplug-call add 6

From /proc/tty/driver/usb-serial:

Code: [Select]
root@HomeControl:/etc/cmh# cat /proc/tty/driver/usb-serial
usbserinfo:1.0 driver:v1.4
0: module:cp210x name:"CP210X" vendor:10c4 product:ea60 num_ports:1 port:1 path:usb-00:03.1-1.1
1: module:ftdi_sio name:"FTDI FT232BM Compatible" vendor:0403 product:6001 num_ports:1 port:1 path:usb-00:03.1-1.2.3
2: module:pl2303 name:"PL-2303" vendor:067b product:2303 num_ports:1 port:1 path:usb-00:03.1-1.2.4


Code: [Select]
root@HomeControl:/etc/cmh# ls -lh /dev/usb/tts/
crw-------    1 root     root     188,   0 Aug  3 18:09 0
crw-------    1 root     root     188,   1 Aug  3 18:06 1
crw-------    1 root     root     188,   2 Dec 31  1969 2



The device is a Bytecc BT-DB925 (listed as Product # 2067 on Monoprice.com).  I'm on build 807, the other device (recognized correctly) is my Alarm panel interface.

Following the work-around instructions in http://forum.micasaverde.com/index.php?topic=1170.60, the extra Serial port is recognized in Vera's UI (barring a bug in serproxy itself not starting, which I'm about to go file).  My serproxy.ports file now looks like:

Code: [Select]
root@HomeControl:/tmp/log/cmh# cat /etc/cmh/serproxy.ports     
vendor:067b product:2303
« Last Edit: August 04, 2009, 11:48:02 pm by guessed »

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: How to make Vera recognize your USB-to-Serial Adapter
« Reply #3 on: August 03, 2009, 11:09:08 pm »

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: How to make Vera recognize your USB-to-Serial Adapter
« Reply #4 on: August 04, 2009, 01:27:37 am »
It looks similar, but the one you reference is listed as made by "HL" with a Part# of USB-RS232.  There doesn't appear to be much information on the manufacturer of that one, nor it's drivers.  With the Bytecc, I could find more information, and positive reviews on the drivers, so I was willing to blow $9 (plus taxes, shipping) to give it a go ;-)

I figured we could all use a few low-cost options for RS-232/USB for dealing with the HA of the Home Stereo (TV, Amp etc).  My [Panasonic] TV has Ethernet, but they didn't think to give is HA over it's Ethernet, so it's also got RS-232.

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: How to make Vera recognize your USB-to-Serial Adapter
« Reply #5 on: August 06, 2009, 12:55:58 am »
Device: APC Back-UPS ES 750, Direct USB Interface (APC Proprietary cable)

lsusb output (filtered to the device in question)
Code: [Select]
Bus 002 Device 007: ID 051d:0002 American Power Conversion Uninterruptable Power Supply

It reports itself in dmesg as the following:

Code: [Select]
usb.c: skipped 1 class/vendor specific interface descriptors
usb.c: new device strings: Mfr=3, Product=1, SerialNumber=2
usb.c: USB device number 7 default language ID 0x409
Manufacturer: APC
Product: Back-UPS ES 750 FW:819.z2.D USB FW:z2
SerialNumber: AB0546142379 
usb.c: unhandled interfaces on device
usb.c: USB device 7 (vend/prod 0x51d/0x2) is not claimed by any active driver.
  Length              = 18
  DescriptorType      = 01
  USB version         = 1.10
  Vendor:Product      = 051d:0002
  MaxPacketSize0      = 8
  NumConfigurations   = 1
  Device version      = 1.06
  Device Class:SubClass:Protocol = 00:00:00
    Per-interface classes
Configuration:
  bLength             =    9
  bDescriptorType     =   02
  wTotalLength        = 0022
  bNumInterfaces      =   01
  bConfigurationValue =   01
  iConfiguration      =   00
  bmAttributes        =   e0
  MaxPower            =    0mA

  Interface: 0
  Alternate Setting:  0
    bLength             =    9
    bDescriptorType     =   04
    bInterfaceNumber    =   00
    bAlternateSetting   =   00
    bNumEndpoints       =   01
    bInterface Class:SubClass:Protocol =   03:00:00
    iInterface          =   00
    Endpoint:
      bLength             =    7
      bDescriptorType     =   05
      bEndpointAddress    =   81 (in)
      bmAttributes        =   03 (Interrupt)
      wMaxPacketSize      = 0006
      bInterval           =   0a

Shutdown ("kill") serproxy, ser2net, Start_serproxy.sh to allow me to rmmod the existing ftdi_sio driver since, in my case, it was "in use" by another USB Device and failed rmmod.


Force the claiming of the device using:

Code: [Select]
insmod ftdi_sio vender=0x51d product=0x2

CJ: Can you tweak your instructions above to include some of these?

It then gets claimed, but bad things start happening (I used "cat /dev/usb/tts/3" for grins):

Code: [Select]
usbserial.c: FTDI SIO compatible converter detected
usbserial.c: FTDI SIO compatible converter now attached to ttyUSB3 (or usb/tts/3 for devfs)
usb.c: serial driver claimed interface 813ec280
ftdi_sio.c: v1.3.5:USB FTDI Serial Converters Driver
usb_control/bulk_msg: timeout
ehci-q.c: clear tt 00:03.1-1.2 p1 buffer, a7 ep0
ftdi_sio.c: ftdi_set_termios FAILED to set databits/stopbits/parity
ehci-q.c: clear tt 00:03.1-1.2 p1 buffer, a7 ep0
ftdi_sio.c: ftdi_set_termios urb failed to set baurdrate
ehci-q.c: clear tt 00:03.1-1.2 p1 buffer, a7 ep0
ftdi_sio.c: urb failed to clear flow control
ehci-q.c: clear tt 00:03.1-1.2 p1 buffer, a7 ep0
ftdi_sio.c: ftdi_open Error from DTR HIGH urb
ehci-q.c: clear tt 00:03.1-1.2 p1 buffer, a7 ep0
ftdi_sio.c: ftdi_open Error from RTS HIGH urb
Unable to handle kernel paging request at virtual address 00000010, epc == c025c4c4, ra == c025c4bc
Oops in fault.c::do_page_fault, line 206:
$0 : 00000000 1000fc00 818aee00 00000000 00000019 00000000 0000001f 8111f2a0
$8 : 00000000 00004e94 00004001 00004e63 801b0000 801b0000 801b0000 0000004d
$16: 81770820 00000001 81770800 806aa000 00000001 00000000 c0240000 803e3660
$24: 00000010 8002da48                   804fe000 804ffd50 0040bfbc c025c4bc
Hi : 00000000
Lo : 00000005
epc   : c025c4c4    Tainted: P
Status: 1000fc03
Cause : 0000000c
PrId  : 00029029
Process cat (pid: 2068, stackpage=804fe000)
Stack:    0000bc03 c025e264 8105b0c0 8105b0c8 00000000 00000000 804ffda0
 00000000 000001f4 804ffdc0 806aa000 806aa000 c0242b38 806aa000 0000bc03
 00000000 812b67c0 0000000c 00000003 800987b4 81d0a8a0 00000009 81770800
 81770820 81770800 c023fea8 81c512e0 00000000 00000000 806aa000 ffffffed
 00000000 803e3660 00002000 812b67c0 801b2720 00409e8c 00000002 8009ac4c
 8009ac18 ...
Call Trace:   [<c025e264>] [<c0242b38>] [<800987b4>] [<c023fea8>] [<8009ac4c>]
 [<8009ac18>] [<80043584>] [<800284a0>] [<8009a3d8>] [<8009a3bc>] [<80044358>]
 [<8006bbac>] [<800447ec>] [<800447d4>] [<8000b484>] [<8000b420>] [<80037180>]
 [<800372e0>] [<80037578>] [<8003769c>] [<80008a60>] [<8000f330>] [<8005bb6c>]

Code: 24a5e264  8e030020  8e420004 <ac620010> 8e440004  92030024  8e050020  8c820000  8c840014

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: How to make Vera recognize your USB-to-Serial Adapter
« Reply #6 on: August 06, 2009, 08:48:07 am »
The device is not FTDI-based, have you tried to force-claim it using other drivers: PL, etc?

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: How to make Vera recognize your USB-to-Serial Adapter
« Reply #7 on: August 06, 2009, 09:18:35 am »
Not yet, but I have a scary feeling I really need to load apcusbd, from the OpenWrt dist, into Vera.  If it's going to be a different type of device (a USB HID) then it may not work with any Serial driver.

If that's the case, it puts us squarely back at this issue:

    http://forum.micasaverde.com/index.php?topic=1428.0

which was never answered..
« Last Edit: August 06, 2009, 09:20:40 am by guessed »

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: How to make Vera recognize your USB-to-Serial Adapter
« Reply #8 on: August 12, 2009, 12:25:57 am »
Just tried another serial adapter, supposedly PL-2303.
Received "usb.c: unable to get device descriptor (error=-32)". Error 32 means "stall", and some googling shows it's not an unusual thing, often caused by OHCI-EHCI conflict.
 
One guy found that one of most likely reasons is one of the devices in OHCI chain is attempted to be initialized as EHCI, which causes timing problems so "ehci" device can't be read. He managed to turn that erroneous device into OHCI manually, and everybody was happy ever after.

I did nitice few ehci-related messages in dmesg before the error messages...
Any idea on how to do or what to check here?


UPDATE: This might be important - very same adapter recognized perfectly well on Asus 520GU with Kamikaze. How possible? Old drivers on Vera?


« Last Edit: August 13, 2009, 12:16:00 am by 325xi »

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: How to make Vera recognize your USB-to-Serial Adapter
« Reply #9 on: August 16, 2009, 01:43:00 pm »
It's sticky not for replies, but as a source  of valuable information.

Offline LibraSun

  • Hero Member
  • *****
  • Posts: 542
  • Karma: +0/-0
Re: How to make Vera recognize your USB-to-Serial Adapter
« Reply #10 on: September 09, 2009, 10:03:13 am »
I'm in the same boat as 325xi, when I just tried connecting a USB-to-RS232 serial cable.
Oddly enough, the cable is SKU #8757 sold by DealExtreme (cheap!), but my PC kept wanting to give it Prolific PL-2303 drivers ... so I'm guessing that's what it is.

@325xi, did you ever get this cable working with Vera?

My poking around with DMESG (per cj's instructions, above) was confusing, and I also see the "usb.c: unable to get device descriptor (error=-32)" line you cited.

Could use some guidance here.
Vera Model I running UI4 (Firmware 1.1.1338), died in 2015
Vera Plus running UI7 (Firmware 1.7.2935)

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: How to make Vera recognize your USB-to-Serial Adapter
« Reply #11 on: September 09, 2009, 10:47:11 pm »
The one that actually works is SKU 5947, but it kinda defeats the point of getting the thing from there.

I tried two other types and some work with Asus 520gu, but not Vera, some work with none (same error as you got) - but all seem to work with Windows. I don't know what's the trick, and the guy who might possibly shed some light on this is apparently too busy...

Offline LibraSun

  • Hero Member
  • *****
  • Posts: 542
  • Karma: +0/-0
Re: How to make Vera recognize your USB-to-Serial Adapter
« Reply #12 on: September 09, 2009, 10:51:53 pm »
Thanks, 325xi, I didn't expect good news on this issue.  In fact, with my 2412S (serial) PLM arriving in a couple of days, I've been regretting my too-cheap-to-be-good purchase of this USB-to-RS232 cable from DealExtreme (Hong Kong).  Back to the drawing board, and more $$$ likely!
Vera Model I running UI4 (Firmware 1.1.1338), died in 2015
Vera Plus running UI7 (Firmware 1.7.2935)

Offline LibraSun

  • Hero Member
  • *****
  • Posts: 542
  • Karma: +0/-0
Re: How to make Vera recognize your USB-to-Serial Adapter
« Reply #13 on: September 17, 2009, 12:13:57 pm »
I wanted to follow up by saying it was a waste of time and money to buy the USB-to-serial adapter cable (#8757) from DealExtreme.  None of the included Windows drivers play nicely with it in Windows XP, and plugging the cable into Vera yields NOTHING useful in the DMESG report (see first posts of this thread).

I'm going to throw away this cable, and (grumble, grumble) go buy the one from Future Technologies that I *should* have bought in the first place.  :-/

Meahwhile, my brand-new 2412S sits in the corner, waiting, waiting...
Vera Model I running UI4 (Firmware 1.1.1338), died in 2015
Vera Plus running UI7 (Firmware 1.7.2935)

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: How to make Vera recognize your USB-to-Serial Adapter
« Reply #14 on: September 17, 2009, 01:26:43 pm »
LibraSun,
I also built this out to "retain' the collective knowledge in this thread.

    http://wiki.micasaverde.com/index.php/Serial_Supported_Hardware

It's small now, but can be grown.  Can you add your device to the list to indicate it's specifically not working so others dont fall in the same pit-trap?


@325xi, you might want to do the same...