We have moved at community.getvera.com

Author Topic: Serial port:  (Read 85015 times)

Offline nanckekr

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Re: Serial port:
« Reply #30 on: July 01, 2009, 11:30:44 am »
Vera it's using kernel 2.4.35.4
In that case, why is the driver for chipset FT8U232AM not included? According to this site  http://www.ftdichip.com/Drivers/3rdPartyDrivers.htm it should be included from  version 2.4

TO see what error throws out the module run dmesg from Vera command line.
Very good idea! I inserted my FT8U232AM into Vera's USB port and ran the dmesg in Vera's command line. The result indicates that the FT8U232AM is indeed supported as something new appear in the log (see attached). However, I still only have the file "0" in Vera's folder /dev/usb/tts/


To compile another kernel module you need OpenWRT SDK and kernel 2.4.35.4 (mips) sources.
I don't think I am qualified to compile Vera. Also I suspect that if I do, I can not use any updates from you, as then I'll loose my driver that was added manually.

Based on the above it seems like the driver IS there somehow, just not quite working yet as expected....

Offline micasaverde

  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +15/-1
Re: Serial port:
« Reply #31 on: July 02, 2009, 11:11:01 am »
nanckekr, In my earlier post on Windows Serial I mentioned you needed to use the firmware I referenced in that email.  Only firmware >=749 has support for Windows Serial.

Offline nanckekr

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Re: Serial port:
« Reply #32 on: July 02, 2009, 01:42:33 pm »
Sorry about that, I thought the only change in the new version was that it included the modified XML files for the Somfy motor, and I wanted to make the changes myself to learn. That is why I did not upgrade.

Well, I upgraded now and tried to configure the windows serial proxy. There are some steps that is not obvious and not on the wiki yet, so I am working on documenting the steps. However, I am stuck at setting the baud rate as vera does not display that option to me..... These are the steps I followed:

1) Example for running the serproxy on Windows:
"serproxy.exe 192.168.0.5 windows COM4"

2) When running the serproxy on windows the first time, it will create some error messages and then exit. Ignore the errors.

3) After waiting 30 seconds, goto Vera-->Devices. You will now see two devices added, one blank and one named as the COM port used, e.g. "COM4".

4) Enter locations for both devices, then click "save"

5) Run the serproxy again. This time it will create some error messages again. Ignore the errors. However, the application will NOT exit, in stead it will print out what baud rate etc. is set.

6) Goto Vera-->Devices-->Luup plugins --> Serial Port configuration and configure baud rate stop bits etc.

Problem: when clicking that button in Vera I get some text below saying "Serial Port Configuration" but no links and no way to modify the serial port settings

Offline cj

  • Hero Member
  • *****
  • Posts: 1252
  • Karma: +1/-0
Re: Serial port:
« Reply #33 on: July 02, 2009, 04:15:00 pm »
TO see what error throws out the module run dmesg from Vera command line.
Very good idea! I inserted my FT8U232AM into Vera's USB port and ran the dmesg in Vera's command line. The result indicates that the FT8U232AM is indeed supported as something new appear in the log (see attached). However, I still only have the file "0" in Vera's folder /dev/usb/tts/

It seems that you're adapter it's detected but no module it's claiming for it. You can force the ftdi module to claim your adapter by running these from Vera's command line:

Code: [Select]
rmmod -f ftdi_sio && insmod ftdi_sio vendor=0x403 product=0x6010
then plug your adapter and see what it says in dmesg.

Offline nanckekr

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Re: Serial port:
« Reply #34 on: July 02, 2009, 09:28:24 pm »
Wow CJ - that line was pure magic! I now got 8 more files in the /dev/usb/tts/ folder: "1, 2, 3, 4, 5, 6, 7, 8".
I thought I was good to go,  but I see no devices appearing in Vera. I tried pressing "Save" and force a rescan - no change.

P.S. I found out, that if I reboot the router then the USB-->Serial device is not recognized (only the file "0" is in the folder). Hence I have to run the command again. This is OK for trying out things, but I think it would be fantastic if you could add this line to your startup script in new firmware.


Offline micasaverde

  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +15/-1
Re: Serial port:
« Reply #35 on: July 02, 2009, 11:57:40 pm »
nanckekr, Would you mind turning on the tech support back door and giving me access?  You can email me at aaron at mcv.  There are 2 things I'll need to look into.

Since many usb->serial devices are not actually rs232 ports (like the z-wave dongle and the USB ir transmitter), we hardcode into Luup a list of the vendor/model id's of serial port devices that *are* and which should be shown in the serial port configuration.  I'll have to inspect your USB bus to get that information and do a patch.  Then you should be able to set the configuration.

As far as why you can't set the configuration for the Windows serial port, which browser are you using?  We do all our dev work in firefox, and, after all the coding is done, test for safari, chrome and IE.  Safari, chrome and firefox almost always work right the first time since they all "agree" on the correct implementation of html, but IE is always a problem.

Offline mizar

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
Re: Serial port:
« Reply #36 on: July 05, 2009, 01:03:16 pm »
I am also having the same problem with a XC-232-C dual port usb->serial adapter. The following command

rmmod -f ftdi_sio && insmod ftdi_sio vendor=0x403 product=0x6010

posted by CJ earlier clears up the problem, my serial ports are there.  But on reboot they are missing again.

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: Serial port:
« Reply #37 on: July 07, 2009, 11:33:19 am »
What are conditions for a serial port to show up in 'serial port configuration'?
Should I have the client device connected, or just having port recognized by the system is enough?
I see extra device in /dev/usb/tts; and I see the adapter in lsusb (below), but 'serial port configuration' is empty.

root@HomeControl:~# lsusb
Bus 002 Device 001: ID 0000:0000
Bus 002 Device 002: ID 0424:2502 Standard Microsystems Corp.
Bus 002 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 002 Device 004: ID 10c4:ea60 Cygnal Integrated Products, Inc.
Bus 001 Device 001: ID 0000:0000

Offline nanckekr

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Re: Serial port:
« Reply #38 on: July 07, 2009, 11:58:25 am »
325xi,

I am facing the same problem as you describe. I have an open support ticket on this and MCV will likely find a solution soon. It seems general to me, as you as well as mizar seems to face the same issue.

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: Serial port:
« Reply #39 on: July 07, 2009, 12:52:03 pm »
I'm not sure it's the same case as I do have a device in /dev/usb/tts for my adapter, and it appears to be claimed OK.

Code: [Select]
hub.c: new USB device 00:03.1-1.1, assigned address 5
usb.c: kmalloc IF 81b2f2e0, numif 1
usb.c: new device strings: Mfr=1, Product=2, SerialNumber=0
usb.c: USB device number 5 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 ttyUSB0 (or usb/tts/0 for devfs)
usb.c: serial driver claimed interface 81b2f2e0
usb.c: kusbd: /sbin/hotplug-call add 5
hub.c: port 2, portstatus 103, change 0, 12 Mb/s


I'm still thinking there might be some prerequisites for the port to appear on Vera screen...
I have nothing connected to the serial adapter.

Below are the device details:

Code: [Select]
Bus 002 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x067b Prolific Technology, Inc.
  idProduct          0x2303 PL2303 Serial Port
  bcdDevice            3.00
  iManufacturer           1 Prolific Technology Inc.
  iProduct                2 USB-Serial Controller
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)
« Last Edit: July 07, 2009, 01:08:05 pm by 325xi »

Offline nanckekr

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Re: Serial port:
« Reply #40 on: July 08, 2009, 12:14:45 am »
My understanding of setting up a serial device is that once you plug it in, you will see a new file in the folder "/dev/usb/tts/". That folder contains the file "0" which is for the zwavde dongle, and for each serial port you attach to Vera, a new file will be added in the folder. So if you are attaching 4 serial ports, you will get the files
"0,1,2,3".

If adding a serial device to the USB port does not result in a file being added to this folder, then no device will ever show up in Vera's WEB ui. If a file does appear, then in theory a device should show up in Vera's web ui under devices.

If a file did not appear in the folder, then we learned from CJ that the magic line
Code: [Select]
rmmod -f ftdi_sio && insmod ftdi_sio vendor=0x403 product=0x6010 would at least for myself (nanckekr) and mizar.

Personally I started out with the problem that there were no device in the web UI and no file in the above mentioned folder. After CJ's line I was able to get the file to appear in the folder, but so far I have never seen the device in the web UI.

mizar mentioned that he did see the files after learning of CJ's magic line, but it is not clear to me if mizar saw the device in the web UI.

So, 325xi, where in this are you? Did you get the file in the folder even without CJ's line? I understand that the device is not in the web UI for you as well as for me.

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: Serial port:
« Reply #41 on: July 08, 2009, 12:32:06 am »
Little googling showed that the "magic line" merely unloads the "generic" ftdi_sio module, and reloads it with vendor specific parameters. My adapter uses pl2303 chipset, and lucky me, it got recognized right away (well, I did read reviews on few of them before ordering).

However I do not see the port in UI.

Offline nanckekr

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Re: Serial port:
« Reply #42 on: July 08, 2009, 01:08:40 am »
Seems like you are stuck at the same point as I then - the device is detected but nothing in the UI. I'll post when I hear from MCV support team

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Serial port:
« Reply #43 on: July 08, 2009, 04:10:12 am »
I had a similar problem to this, but my USB-based Alarm interface (Serial device) was detected and showing as dev/tts/1, but not in Vera's UI.

I upgraded today to the 756 release (released July 6) and it now shows in Vera's UI.  I also see my USB/Alarm as a "Device", and a bunch of Advanced options for setting Baud Rate, Serial Proxy Port (etc).

So far, it doesn't look like the Baud rates requested are being respected, so it's defaulting to 9600/N/8/1 (According to the Serial Proxy Server logs). 

It also seems to ignore the Serial Proxy Port I spec'd.  I reset my Alarm to use the lower baud rate and can confirm that Vera's Serial Proxy to the device is working.

"telnet 127.0.0.1 3881" will connect to my USB Device/Alarm and I can see the traffic from it correctly.

My device is a Paradox Security APR3 Printer and HA Interface board
with USB.

It's worth trying the upgrade to see if it fixes the issues.  I lost a few configs during the process, but nothing too bad ("Rooms" disappeared and had to be re-entered, and Devices re-assigned)

Oh, by the way, backup your LUA before upgrade and upload it again afterwards ;)

Offline mizar

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
Re: Serial port:
« Reply #44 on: July 08, 2009, 07:39:18 am »
After upgrading to 756 I see a new device called a Serial_Portlist, but I still see nothing when I try the serial port configuration.

I am not sure what to do with the serial_portlist.  It has listed as a devicetype "micasaverde-com:serialportroot".

gentlemen, I think we have ventured into an area where there is a lot of active development in progress.