Ser2net usage and serproxy wrapper - error in command line built by serproxy

In the newer builds, [tt]serproxy[/tt] “launches” [tt]ser2net[/tt] to handle the RS232-Ethernet interfacing. I recently added a 2nd Serial port as decribed in the thread:

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

and added it to the [tt]serproxy.ports[/tt] file so it would be recognized by Vera:

root@HomeControl:/tmp/log/cmh# cat /etc/cmh/serproxy.ports vendor:067b product:2303

When I do this, the [tt]serproxy/ser2net[/tt] stops functioning for ANY of the attached serial ports. This is because [tt]ser2net[/tt] doesn’t start, and looks like the following in [tt]/var/log/cmh/serproxy.log[/tt] (extraneous lines filtered between calls to [tt]ser2net[/tt]):

08/04/09 20:48:38 Running: /usr/bin/ser2net -n -C "3481:raw:0:/dev/usb/tts/1:57600 1STOPBIT NONE"-C "3482:raw:0:/dev/usb/tts/2:9600 1STOPBIT NONE" 08/04/09 20:48:46 Running: /usr/bin/ser2net -n -C "3481:raw:0:/dev/usb/tts/1:57600 1STOPBIT NONE"-C "3482:raw:0:/dev/usb/tts/2:9600 1STOPBIT NONE" 08/04/09 20:48:53 Running: /usr/bin/ser2net -n -C "3481:raw:0:/dev/usb/tts/1:57600 1STOPBIT NONE"-C "3482:raw:0:/dev/usb/tts/2:9600 1STOPBIT NONE" 08/04/09 20:49:00 Running: /usr/bin/ser2net -n -C "3481:raw:0:/dev/usb/tts/1:57600 1STOPBIT NONE"-C "3482:raw:0:/dev/usb/tts/2:9600 1STOPBIT NONE" 08/04/09 20:49:08 Running: /usr/bin/ser2net -n -C "3481:raw:0:/dev/usb/tts/1:57600 1STOPBIT NONE"-C "3482:raw:0:/dev/usb/tts/2:9600 1STOPBIT NONE" 08/04/09 20:49:15 Running: /usr/bin/ser2net -n -C "3481:raw:0:/dev/usb/tts/1:57600 1STOPBIT NONE"-C "3482:raw:0:/dev/usb/tts/2:9600 1STOPBIT NONE" 08/04/09 20:49:22 Running: /usr/bin/ser2net -n -C "3481:raw:0:/dev/usb/tts/1:57600 1STOPBIT NONE"-C "3482:raw:0:/dev/usb/tts/2:9600 1STOPBIT NONE" 08/04/09 20:49:30 Running: /usr/bin/ser2net -n -C "3481:raw:0:/dev/usb/tts/1:57600 1STOPBIT NONE"-C "3482:raw:0:/dev/usb/tts/2:9600 1STOPBIT NONE" 08/04/09 20:49:37 Running: /usr/bin/ser2net -n -C "3481:raw:0:/dev/usb/tts/1:57600 1STOPBIT NONE"-C "3482:raw:0:/dev/usb/tts/2:9600 1STOPBIT NONE"

The problem is that there’s a SPACE character missing before the 2nd “-C” command line option, so [tt]ser2net[/tt] simply bails out.

Please add a space before the second “-C” as follows:

08/04/09 20:49:37 Running: /usr/bin/ser2net -n -C "3481:raw:0:/dev/usb/tts/1:57600 1STOPBIT NONE" -C "3482:raw:0:/dev/usb/tts/2:9600 1STOPBIT NONE"

subtle, but it fixes the problem, and the [tt]ser2net[/tt] starts and listens on both Ports correctly.

MCV: Can you build this into one of the formal luup releases?

Yes, please do!
And please, post some info how to run ser2net on remote OpenWRT device so it can talk to Vera.

try this: http://download.controlmyhouse.net/betafirmware/ftp/wl500gP_Luup-1.0.844.trx

I didn’t have a chance to get a 2nd usb->serial adapter to test it, but I added a space in front of the -C

I installed 844 - but where did all the I_* examples go from Luup files page?
I SCPed them to my PC but I can’t decompress lzo files, lzop doesn’t recognizes them…
:frowning:

Sorry for hijacking the thread…

They’re there. Goto Devices → Luup Plugins → Luup Files and they’ll show up.

ok, tried using this, but looks like serproxy is having problems.

After putting in the entry for /etc/cmh/serproxy.ports, and then rebooting, it’s looping over and over in the /var/log/serproxy.log so it gets large quickly:

[tt]08/07/09 22:10:12 find_self failed

08/07/09 22:10:18 ===—Running 4 with Luup IP: 127.0.0.1 ID: xxxx My IP: 127.0.0.1 COM: none

08/07/09 22:10:18 ==Skipping unknown Serial Port: usbserinfo:1.0 driver:v1.4

08/07/09 22:10:18 Comparing custom port vendor:067b product:2303 to 0: module:cp210x name:“CP210X” vendor:10c4 product:ea60 num_ports:1 port:1 path:usb-00:03.1-1.1

08/07/09 22:10:18 ==Skipping unknown Serial Port: 0: module:cp210x name:“CP210X” vendor:10c4 product:ea60 num_ports:1 port:1 path:usb-00:03.1-1.1

08/07/09 22:10:18 ==Found Serial Port: 0 path:/dev/usb/tts/1 name: ftdi_sio id: usb-00:03.1-1.2.3

08/07/09 22:10:18 Comparing custom port vendor:067b product:2303 to 2: module:pl2303 name:“PL-2303” vendor:067b product:2303 num_ports:1 port:1 path:usb-00:03.1-1.2.4

08/07/09 22:10:18 ==Found Serial Port: 1 path:/dev/usb/tts/2 name: pl2303 id: usb-00:03.1-1.2.4

08/07/09 22:10:18 ===Number of Serial Ports found: 2

08/07/09 22:10:19 Downloaded http://127.0.0.1:49451/data_request?id=lu_finddevice&devid=7184&devtype=micasaverde-com:serialportroot to /tmp/PlutoFileUtils.5sj7mT with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/PlutoFileUtils.5sj7mT” “http://127.0.0.1:49451/data_request?id=lu_finddevice&devid=xxxx&devtype=micasaverde-com:serialportroot” Response 0

08/07/09 22:10:19 Parent serial device: 2

08/07/09 22:10:19 Downloaded http://127.0.0.1:49451/data_request?id=lu_childdevices&DeviceNum=2 to /tmp/PlutoFileUtils.GQANZf with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/PlutoFileUtils.GQANZf” “http://127.0.0.1:49451/data_request?id=lu_childdevices&DeviceNum=2” Response 0

08/07/09 22:10:19 fetch_port_list fetched 20 dat to compare with 2 ports

08/07/09 22:10:19 Reporting child device usb-00:03.1-1.2.3/ftdi_sio

08/07/09 22:10:19 Reporting child device usb-00:03.1-1.2.4/pl2303

08/07/09 22:10:19 Downloaded http://127.0.0.1:49451/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=ProcessChildDevices&DeviceNumParent=2&DeviceList=ID=usb-00:03.1-1.2.3 Embedded=1 UpnpDevFilename=D_SerialPort1.xml DeviceType=urn:micasaverde-org:device:SerialPort:1 Description=ftdi_sio Argument,urn:micasaverde-com:serviceId:HaDevice1,Protocol=RS232 ID=usb-00:03.1-1.2.4 Embedded=1 UpnpDevFilename=D_SerialPort1.xml DeviceType=urn:micasaverde-org:device:SerialPort:1 Description=pl2303 Argument,urn:micasaverde-com:serviceId:HaDevice1,Protocol=RS232 to /tmp/PlutoFileUtils.r6qu1G with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/PlutoFileUtils.r6qu1G” “http://127.0.0.1:49451/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=ProcessChildDevices&DeviceNumParent=2&DeviceList=ID=usb-00:03.1-1.2.3 Embedded=1 UpnpDevFilename=D_SerialPort1.xml DeviceType=urn:micasaverde-org:device:SerialPort:1 Description=ftdi_sio Argument,urn:micasaverde-com:serviceId:HaDevice1,Protocol=RS232 ID=usb-00:03.1-1.2.4 Embedded=1 UpnpDevFilename=D_SerialPort1.xml DeviceType=urn:micasaverde-org:device:SerialPort:1 Description=pl2303 Argument,urn:micasaverde-com:serviceId:HaDevice1,Protocol=RS232” Response 13312
[/tt]

Before doing this, I had done an upgrade, followed by a “Restore Factory Defaults” in order to clear out any residual info from previous builds. I rekey’d Rooms, Users, findvera.com registration, Location and then re-attached my Devices to the new Rooms.

This was done to make it “clean” for the new stuff.

Oddly, I dont see the serial_root_eieio device any longer under Devices, but it does recognize that I have a Serial port (residual perhaps?)

I’ve since renamed [tt]serproxy.ports[/tt] to [tt]serproxy.ports.old[/tt] and rebooted to stop the logs from filling up.

I’ll send an email with the new Support code so you can check it out. I currently have 3x USB Devices attached - Alarm Panel (FDTI Driver), Cheapo USB-Serial (pl2303 Driver) and the APC UPS Device (no driver yet, seems to need [tt]apcupsd[/tt] to use with HID device)