BAFO USB<->RS-232 "PORT ALREADY IN USE"

I have a Vera3 with 2 BAFO/PL2303 USB to RS-232 adapters connected. One BAFO is connected to my DCS alarm panel and works great at 9600/8/N/1. The other BAFO is connected to my Hayward/Goldline pool control home automation interface module (AQ-CO-SERIAL). The only communction settings the AQ-CO will use is 19200/8/N/2. The stop bit of 2 has caused some problems already. I originally tried to connect the AQ-CO to a WizNet but it does not support a stop bit of 2 even with the latest firmware. So I installed my spare BAFO to connect the AQ-CO.

I can connect the AQ-CO serial port directly to a WIN7 PC with HyperTerm and it communicates with no problem. The BAFO driver will not load properly on my WIN7 PC so I can’t test it with HyperTerm. When connected Vera I keep reading characters from lul_data that say the “PORT IS ALREADY IN USE”. The message at the top of the UI states that the plugin faield to open the port.

I’m new to the plugin development, ser2net, etc… I could not find any documention stating wheter the BAFO supports 2 stop bits - does anyon know if it works with 2 stop bits? The plugin is writting lots of debug information to /var/log/cmh/LuaUPnP.log. I’m not sure what to look
for in /var/log/cmh/LuaUPnP.log and serproxy.log regarding the serial port / ser2net.

Please let me know that to post from the log files

Thanks

Just received the FTDI USB<->RS-232 converter. Installed the FTDI on WIN7 PC and was able to communicate with the pool controller vi HyperTerminal. Next, plugged the FTDI in Vera and configured. Apps->Dev Apps->Serial Port Config and set the comm settings to 19200/8/N/2 and used by 'Swimming Pool / Spa". The only other USB<->RS-232 I have is the BAFO connected to a DCS alarm panel which is functioning properly. This makes me think the /etc/ser2net.conf is not used by Vera???

I get the same results as with the BAFO “When connected Vera I keep reading characters from lul_data that say the “PORT IS ALREADY IN USE”. The message at the top of the UI states that the plugin faield to open the port.” Does port mean the USB port (/dev/ttyUSB0) or the TCP/IP port (3481)?

Contents of /etc/ser2net.conf :
BANNER:banner1:Welcome to ser2net TCP port \p device \d\r\n
second line
third line\r\n

BANNER:banner2:this is ser2net TCP port \p device \d\r\n
second line
third line\r\n

BANNER:banner3:this is ser2net TCP port \p device \d serial parms \s\r\n

TRACEFILE:tw1:/tmp/tw-\p-\Y-\M-\D-\H:\i:\s.\U
TRACEFILE:tr1:/tmp/tr-\p-\Y-\M-\D-\H:\i:\s.\U

2001:raw:600:/dev/ttyS0:9600 NONE 1STOPBIT 8DATABITS XONXOFF LOCAL -RTSCTS
#2002:raw:600:/dev/ttyS1:9600 NONE 1STOPBIT 8DATABITS XONXOFF LOCAL -RTSCTS
2003:raw:5:/dev/ttyS2:9600
2004:raw:5:/dev/ttyS3:115200
2005:raw:5:/dev/ttyS4:9600
2006:raw:5:/dev/ttyS5:9600
2007:raw:5:/dev/ttyS6:9600 tw=tw1 tr=tr1
3001:telnet:0:/dev/ttyS0:19200 remctl banner1
3011:telnet:3:/dev/ttyS0:19200 banner2
#3002:telnet:0:/dev/ttyS1:9600
3003:telnet:0:/dev/ttyS2:9600 banner3
3004:telnet:0:/dev/ttyS3:115200
3005:telnet:0:/dev/ttyS4:9600
3006:telnet:0:/dev/ttyS5:9600
3007:telnet:0:/dev/ttyS6:9600
5001:rawlp:10:/dev/lp0

Contents os /var/log/cmh/serproxy.log :
02/16/13 10:50:44 ===—Running 4 with Luup IP: 127.0.0.1 ID: 30001308 My IP: 127.0.0.1 COM: none

02/16/13 10:50:44 ==Skipping unknown Serial Port: usbserinfo:1.0 driver:2.0

02/16/13 10:50:44 ==Found Serial Port: 0 path:/dev/ttyUSB0 name: ftdi_sio id: usb-rt3883-ohci-1 vendor: 403 product: 6001

02/16/13 10:50:44 ==Found Serial Port: 1 path:/dev/ttyUSB1 name: pl2303 id: usb-rt3883-ohci-2 vendor: 67 product: 2303

02/16/13 10:50:44 ===Number of Serial Ports found: 2

02/16/13 10:50:44 Downloaded http://127.0.0.1:3480/data_request?id=lu_finddevice&devid=30001308&devtype=urn:micasaverde-org:device:SerialPortRoot:1 to /tmp/serproxy.1-2841 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.1-2841” “http://127.0.0.1:3480/data_request?id=lu_finddevice&devid=30001308&devtype=urn:micasaverde-org:device:SerialPortRoot:1” Response 0

02/16/13 10:50:44 Parent serial device: 138

02/16/13 10:50:44 Downloaded http://127.0.0.1:3480/data_request?id=lu_childdevices&DeviceNum=138 to /tmp/serproxy.2-2841 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.2-2841” “http://127.0.0.1:3480/data_request?id=lu_childdevices&DeviceNum=138” Response 0

02/16/13 10:50:44 fetch_port_list fetched 44 dat to compare with 2 ports

02/16/13 10:50:44 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=path to /tmp/serproxy.3-2841 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.3-2841” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=path” Response 0

02/16/13 10:50:44 port_list_matches device 143 now on path /dev/ttyUSB0 instead of /dev/ttyUSB1

02/16/13 10:50:44 Reporting child device usb-rt3883-ohci-1/ftdi_sio

02/16/13 10:50:44 Reporting child device usb-rt3883-ohci-2/pl2303

02/16/13 10:50:44 Downloaded http://127.0.0.1:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=ProcessChildDevices&DeviceNumParent=138&DeviceList=ID=usb-rt3883-ohci-1 Embedded=1 Invisible=1 UpnpDevFilename=D_SerialPort1.xml DeviceType=urn:micasaverde-org:device:SerialPort:1 Description=ftdi_sio Argument,urn:micasaverde-com:serviceId:HaDevice1,Protocol=RS232 Argument,urn:micasaverde-org:serviceId:SerialPort1,vendor=403 Argument,urn:micasaverde-org:serviceId:SerialPort1,product=6001 Argument,urn:micasaverde-org:serviceId:SerialPort1,path=/dev/ttyUSB0 ID=usb-rt3883-ohci-2 Embedded=1 Invisible=1 UpnpDevFilename=D_SerialPort1.xml DeviceType=urn:micasaverde-org:device:SerialPort:1 Description=pl2303 Argument,urn:micasaverde-com:serviceId:HaDevice1,Protocol=RS232 Argument,urn:micasaverde-org:serviceId:SerialPort1,vendor=67 Argument,urn:micasaverde-org:serviceId:SerialPort1,product=2303 Argument,urn:micasaverde-org:serviceId:SerialPort1,path=/dev/ttyUSB1 to /tmp/serproxy.4-2841 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.4-2841” “http://127.0.0.1:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=ProcessChildDevices&DeviceNumParent=138&DeviceList=ID=usb-rt3883-ohci-1 Embedded=1 Invisible=1 UpnpDevFilename=D_SerialPort1.xml DeviceType=urn:micasaverde-org:device:SerialPort:1 Description=ftdi_sio Argument,urn:micasaverde-com:serviceId:HaDevice1,Protocol=RS232 Argument,urn:micasaverde-org:serviceId:SerialPort1,vendor=403 Argument,urn:micasaverde-org:serviceId:SerialPort1,product=6001 Argument,urn:micasaverde-org:serviceId:SerialPort1,path=/dev/ttyUSB0 ID=usb-rt3883-ohci-2 Embedded=1 Invisible=1 UpnpDevFilename=D_SerialPort1.xml DeviceType=urn:micasaverde-org:device:SerialPort:1 Description=pl2303 Argument,urn:micasaverde-com:serviceId:HaDevice1,Protocol=RS232 Argument,urn:micasaverde-org:serviceId:SerialPort1,vendor=67 Argument,urn:micasaverde-org:serviceId:SerialPort1,product=2303 Argument,urn:micasaverde-org:serviceId:SerialPort1,path=/dev/ttyUSB1” Response 0

02/16/13 10:50:44 ==Created 2 child devices

02/16/13 10:50:44 Downloaded http://127.0.0.1:3480/data_request?id=lu_reload&source=serproxy to /tmp/serproxy.5-2841 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.5-2841” “http://127.0.0.1:3480/data_request?id=lu_reload&source=serproxy” Response 0

02/16/13 10:50:44 Exiting after reporting changed devices

02/16/13 10:50:50 ===—Running 4 with Luup IP: 127.0.0.1 ID: 30001308 My IP: 127.0.0.1 COM: none

02/16/13 10:50:50 ==Skipping unknown Serial Port: usbserinfo:1.0 driver:2.0

02/16/13 10:50:50 ==Found Serial Port: 0 path:/dev/ttyUSB0 name: ftdi_sio id: usb-rt3883-ohci-1 vendor: 403 product: 6001

02/16/13 10:50:50 ==Found Serial Port: 1 path:/dev/ttyUSB1 name: pl2303 id: usb-rt3883-ohci-2 vendor: 67 product: 2303

02/16/13 10:50:50 ===Number of Serial Ports found: 2

02/16/13 10:50:50 Downloaded http://127.0.0.1:3480/data_request?id=lu_finddevice&devid=30001308&devtype=urn:micasaverde-org:device:SerialPortRoot:1 to /tmp/serproxy.1-3001 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.1-3001” “http://127.0.0.1:3480/data_request?id=lu_finddevice&devid=30001308&devtype=urn:micasaverde-org:device:SerialPortRoot:1” Response 1792

02/16/13 10:50:50 Download failed

02/16/13 10:50:50 find_self failed

02/16/13 10:50:56 ===—Running 4 with Luup IP: 127.0.0.1 ID: 30001308 My IP: 127.0.0.1 COM: none

02/16/13 10:50:56 ==Skipping unknown Serial Port: usbserinfo:1.0 driver:2.0

02/16/13 10:50:56 ==Found Serial Port: 0 path:/dev/ttyUSB0 name: ftdi_sio id: usb-rt3883-ohci-1 vendor: 403 product: 6001

02/16/13 10:50:56 ==Found Serial Port: 1 path:/dev/ttyUSB1 name: pl2303 id: usb-rt3883-ohci-2 vendor: 67 product: 2303

02/16/13 10:50:56 ===Number of Serial Ports found: 2

02/16/13 10:50:56 Downloaded http://127.0.0.1:3480/data_request?id=lu_finddevice&devid=30001308&devtype=urn:micasaverde-org:device:SerialPortRoot:1 to /tmp/serproxy.1-3120 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.1-3120” “http://127.0.0.1:3480/data_request?id=lu_finddevice&devid=30001308&devtype=urn:micasaverde-org:device:SerialPortRoot:1” Response 0

02/16/13 10:50:56 Parent serial device: 138

02/16/13 10:50:57 Downloaded http://127.0.0.1:3480/data_request?id=lu_childdevices&DeviceNum=138 to /tmp/serproxy.2-3120 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.2-3120” “http://127.0.0.1:3480/data_request?id=lu_childdevices&DeviceNum=138” Response 0

02/16/13 10:50:57 fetch_port_list fetched 44 dat to compare with 2 ports

02/16/13 10:50:57 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=path to /tmp/serproxy.3-3120 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.3-3120” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=path” Response 0

02/16/13 10:50:57 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=path to /tmp/serproxy.4-3120 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.4-3120” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=path” Response 0

02/16/13 10:50:57 readcfg port list matches

02/16/13 10:50:57 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-com:serviceId:HaDevice1&Variable=IOPort to /tmp/serproxy.5-3120 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.5-3120” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-com:serviceId:HaDevice1&Variable=IOPort” Response 0

02/16/13 10:50:57 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=baud to /tmp/serproxy.6-3120 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.6-3120” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=baud” Response 0

02/16/13 10:50:57 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=stopbits to /tmp/serproxy.7-3120 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.7-3120” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=stopbits” Response 0

02/16/13 10:50:57 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=databits to /tmp/serproxy.8-3120 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.8-3120” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=databits” Response 13312

02/16/13 10:50:57 Download failed

02/16/13 10:50:57 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=parity to /tmp/serproxy.9-3120 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.9-3120” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=parity” Response 13312

02/16/13 10:50:57 Download failed

02/16/13 10:50:57 ===Setting up serproxy for port usb-rt3883-ohci-1/ftdi_sio on: /dev/ttyUSB0 device 143 netport 3481 baud 19200 N/8/2…

02/16/13 10:50:57 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-com:serviceId:HaDevice1&Variable=IOPort to /tmp/serproxy.10-3120 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.10-3120” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-com:serviceId:HaDevice1&Variable=IOPort” Response 0

02/16/13 10:50:57 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=baud to /tmp/serproxy.11-3120 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.11-3120” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=baud” Response 0

02/16/13 10:50:57 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=stopbits to /tmp/serproxy.12-3120 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.12-3120” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=stopbits” Response 0

02/16/13 10:50:57 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=databits to /tmp/serproxy.13-3120 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.13-3120” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=databits” Response 13312

02/16/13 10:50:57 Download failed

02/16/13 10:50:57 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=parity to /tmp/serproxy.14-3120 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.14-3120” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=parity” Response 13312

02/16/13 10:50:57 Download failed

02/16/13 10:50:57 ===Setting up serproxy for port usb-rt3883-ohci-2/pl2303 on: /dev/ttyUSB1 device 142 netport 3482 baud 9600 N/8/1…

02/16/13 10:50:57 Running: ser2net -n -C “3481:raw:0:/dev/ttyUSB0:19200 2STOPBITS NONE” -C “3482:raw:0:/dev/ttyUSB1:9600 1STOPBIT NONE”

I set the “Swimming Pool / Spa” device to not us any serial ports. Next using PuTTY I telnet’d to the FTDI port and it’s actually talking to Vera.

The serpoxy.log is showing multiple failures but both USB<->RS-232 ports seem to be working.

Contents os /var/log/cmh/serproxy.log :
02/16/13 11:05:28 ===—Running 4 with Luup IP: 127.0.0.1 ID: 30001308 My IP: 127.0.0.1 COM: none

02/16/13 11:05:28 ==Skipping unknown Serial Port: usbserinfo:1.0 driver:2.0

02/16/13 11:05:28 ==Found Serial Port: 0 path:/dev/ttyUSB0 name: ftdi_sio id: usb-rt3883-ohci-1 vendor: 403 product: 6001

02/16/13 11:05:28 ==Found Serial Port: 1 path:/dev/ttyUSB1 name: pl2303 id: usb-rt3883-ohci-2 vendor: 67 product: 2303

02/16/13 11:05:28 ===Number of Serial Ports found: 2

02/16/13 11:05:28 Downloaded http://127.0.0.1:3480/data_request?id=lu_finddevice&devid=30001308&devtype=urn:micasaverde-org:device:SerialPortRoot:1 to /tmp/serproxy.1-13023 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.1-13023” “http://127.0.0.1:3480/data_request?id=lu_finddevice&devid=30001308&devtype=urn:micasaverde-org:device:SerialPortRoot:1” Response 1792

02/16/13 11:05:28 Download failed

02/16/13 11:05:28 find_self failed

02/16/13 11:05:34 ===—Running 4 with Luup IP: 127.0.0.1 ID: 30001308 My IP: 127.0.0.1 COM: none

02/16/13 11:05:34 ==Skipping unknown Serial Port: usbserinfo:1.0 driver:2.0

02/16/13 11:05:34 ==Found Serial Port: 0 path:/dev/ttyUSB0 name: ftdi_sio id: usb-rt3883-ohci-1 vendor: 403 product: 6001

02/16/13 11:05:34 ==Found Serial Port: 1 path:/dev/ttyUSB1 name: pl2303 id: usb-rt3883-ohci-2 vendor: 67 product: 2303

02/16/13 11:05:34 ===Number of Serial Ports found: 2

02/16/13 11:05:34 Downloaded http://127.0.0.1:3480/data_request?id=lu_finddevice&devid=30001308&devtype=urn:micasaverde-org:device:SerialPortRoot:1 to /tmp/serproxy.1-13180 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.1-13180” “http://127.0.0.1:3480/data_request?id=lu_finddevice&devid=30001308&devtype=urn:micasaverde-org:device:SerialPortRoot:1” Response 0

02/16/13 11:05:34 Parent serial device: 138

02/16/13 11:05:34 Downloaded http://127.0.0.1:3480/data_request?id=lu_childdevices&DeviceNum=138 to /tmp/serproxy.2-13180 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.2-13180” “http://127.0.0.1:3480/data_request?id=lu_childdevices&DeviceNum=138” Response 0

02/16/13 11:05:34 fetch_port_list fetched 44 dat to compare with 2 ports

02/16/13 11:05:34 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=path to /tmp/serproxy.3-13180 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.3-13180” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=path” Response 0

02/16/13 11:05:34 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=path to /tmp/serproxy.4-13180 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.4-13180” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=path” Response 0

02/16/13 11:05:34 readcfg port list matches

02/16/13 11:05:34 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-com:serviceId:HaDevice1&Variable=IOPort to /tmp/serproxy.5-13180 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.5-13180” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-com:serviceId:HaDevice1&Variable=IOPort” Response 0

02/16/13 11:05:34 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=baud to /tmp/serproxy.6-13180 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.6-13180” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=baud” Response 0

02/16/13 11:05:34 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=stopbits to /tmp/serproxy.7-13180 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.7-13180” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=stopbits” Response 0

02/16/13 11:05:35 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=databits to /tmp/serproxy.8-13180 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.8-13180” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=databits” Response 13312

02/16/13 11:05:35 Download failed

02/16/13 11:05:35 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=parity to /tmp/serproxy.9-13180 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.9-13180” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=143&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=parity” Response 13312

02/16/13 11:05:35 Download failed

02/16/13 11:05:35 ===Setting up serproxy for port usb-rt3883-ohci-1/ftdi_sio on: /dev/ttyUSB0 device 143 netport 3481 baud 19200 N/8/2…

02/16/13 11:05:35 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-com:serviceId:HaDevice1&Variable=IOPort to /tmp/serproxy.10-13180 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.10-13180” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-com:serviceId:HaDevice1&Variable=IOPort” Response 0

02/16/13 11:05:35 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=baud to /tmp/serproxy.11-13180 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.11-13180” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=baud” Response 0

02/16/13 11:05:35 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=stopbits to /tmp/serproxy.12-13180 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.12-13180” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=stopbits” Response 0

02/16/13 11:05:35 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=databits to /tmp/serproxy.13-13180 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.13-13180” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=databits” Response 13312

02/16/13 11:05:35 Download failed

02/16/13 11:05:35 Downloaded http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=parity to /tmp/serproxy.14-13180 with /usr/bin/curl -k -s -S --fail --connect-timeout 5 --max-time 5 -o “/tmp/serproxy.14-13180” “http://127.0.0.1:3480/data_request?id=lu_variableget&DeviceNum=142&serviceId=urn:micasaverde-org:serviceId:SerialPort1&Variable=parity” Response 13312

02/16/13 11:05:35 Download failed

02/16/13 11:05:35 ===Setting up serproxy for port usb-rt3883-ohci-2/pl2303 on: /dev/ttyUSB1 device 142 netport 3482 baud 9600 N/8/1…

02/16/13 11:05:35 Running: ser2net -n -C “3481:raw:0:/dev/ttyUSB0:19200 2STOPBITS NONE” -C “3482:raw:0:/dev/ttyUSB1:9600 1STOPBIT NONE”

Output from : ps -eaf |grep -i ser2net
13237 root 1676 S /bin/sh -c ser2net -n -C “3481:raw:0:/dev/ttyUSB0:19200 2STOPBITS NONE” -C “3482:raw:0:/dev/ttyUSB1:9600 1STOPBIT NONE”
13238 root 804 S ser2net -n -C 3481 raw 0 /dev/ttyUSB0 19200 2STOPBITS NONE -C 3482 raw 0 /dev/ttyUSB1 9600 1STOPBIT NONE

With the FTDI USB<->RS-232 assigned back to the " Swimming Pool / Spa" I am still getting the “lul_data” receiving characters saying the “PORT ALREADY IN USE”. How do I tell what device / process has the FTDI port?

Attached is the rough beginning of my plugin. Is there an issue with the way the plugin is accessing the serial data?

Thanks,
Rory

Please help…

When I use luup.io.intercept() followed by luup.io.read() I get “nil” character received.

When I use lul_data I get “PORT ALREADY IN USE” characters received.

Both show “failed to open port” at the top of the UI.

Attached is the serial port configuration image.

Below is the bare minimum I think I need for the plugin to read characters:

[code]<?xml version="1.0"?>


rs232
raw

local DEBUG_MODE = true

local function log(text, level)
  luup.log("AquaLogic: " .. text, (level or 1))
end

local function debug(text)
  if (DEBUG_MODE == true) then
      log("debug: " .. text, 115)
  end
end


function startup(parentDevice)
	luup.log("AquaLogic " .. tostring (parentDevice,1))
	if( luup.io.is_connected(parentDevice)==false ) then
		luup.log('No port for AquaLogic',1)
		luup.task('Choose the Serial Port for the AQ-CO-SERIAL',2,'AquaLogic Pool Interface',-1)
		return false
	end

    log("AquaLogic " .. tostring(parentDevice) .. " starting up with id " .. luup.devices[parentDevice].id)
end
--luup.log("AquaLogic..incoming..lua") -- local data = tostring(lul_data) luup.io.intercept() local data = luup.io.read(3, parentDevice)
		luup.log("AquaLogic lul_data : " .. tostring (data , 1))
    </lua>

startup





[/code]

<?xml version="1.0"?> <root xmlns="urn:schemas-upnp-org:device-1-0"> <specVersion> <major>1</major> <minor>0</minor> </specVersion> <device> <deviceType>urn:demo-micasaverde-com:device:pool:1</deviceType> <friendlyName>Swimming Pool / Spa</friendlyName> <manufacturer>Hayward / Goldline Controls</manufacturer> <manufacturerURL>http://www.hayward-pool.com</manufacturerURL> <modelDescription>Home Automation Interface Module</modelDescription> <modelName>AQ-CO-SERIAL</modelName> <modelNumber>1.0</modelNumber> <modelURL>http://www.hayward-pool.com/pdf/manuals/Manual343.pdf</modelURL> <protocol>raw</protocol> <handleChildren>1</handleChildren> <commUse>rs232</commUse> <serviceList> </serviceList> <implementationList> <implementationFile>I_AquaLogic.xml</implementationFile> </implementationList> </device> </root>

This makes me think the /etc/ser2net.conf is not used by Vera???
That's correct, it's not. Vera [i]inlines[/i] the config into a set of command line arguments.

This is done by the [tt]serproxy[/tt] process. It’s the glue between Vera and the [launched] [tt]ser2net[/tt] process.

If you turn on Verbose logging, you should get log lines that start with 51 and 52 in LuaUPnP.log. These represent the raw communications with the Device. In your case, you probably are getting the “[tt]PORT ALREADY IN USE[/tt]” characters from the remote end somehow.

A “strings” on the LuaUPnP/ser2net and serproxy Binaries isn’t showing that text, so my guess is that it really is coming from the remote-end somehow.

Is anything else attached to the remote device, over perhaps another type of interface?

Got it working! I had some orphaned sensors which were children in my orignal plugin. Once the plugin was removed as the parent to those sensors it started working???

Now off to learing LUA to parse the incoming data.

Did you ever finish this? I want to manage my pool with Vera using AQ-CO-Serial or AQ-CO-Homenet