Serial proxy - another attempt

So I took a clean OpenWRT USB equipped router, and installed ser2net there.

I went to serproxy.log on Vera to replicate the way ser2net started there, it seems to run OK on the second OpenWRT device

ser2net -n -C “11000:raw:0:/dev/usb/tts/0:9600 1STOPBIT NONE” &

Now, I tried to tell Vera that I have a serial proxy running elsewhere. I assumed parent device already exists as local ports do show up on Vera, to confirm it, and to find the serial root device number I ran:

http://192.168.1.131:49451/data_request?id=lu_finddevice&devid=7410&devtype=micasaverde-com:serialportroot

And so I tried to create a child device the same way as in serproxy.log, and once it’s there I thought I can enter remote IP and parameters:

http://192.168.1.131:49451/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=ProcessChildDevices&DeviceNumParent=4&DeviceList=ID=usb-00:05.1-1.1 Embedded=1 UpnpDevFilename=D_SerialPort1.xml DeviceType=urn:micasaverde-org:device:SerialPort:1 Description=pl2303 Argument,urn:micasaverde-com:serviceId:HaDevice1,Protocol=RS232 ID=usb-00:05.1-1.2 Embedded=1 UpnpDevFilename=D_SerialPort1.xml DeviceType=urn:micasaverde-org:device:SerialPort:1 Description=cp210x Argument,urn:micasaverde-com:serviceId:HaDevice1,Protocol=RS232

I received OK:
<u:ProcessChildDevicesResponse>
OK
</u:ProcessChildDevicesResponse>

But Vera didn’t show any new serial device.

MCV, I’m sure you know what exactly needs to be done to make the other OpenWRT with ser2net to talk to Vera.

Please, give me some idea on how make it work.

try using a different id: http://192.168.1.131:49451/data_request?id=lu_finddevice&devid=7410&devtype=micasaverde-com:serialportroot

change 7410 (which is the default id for serproxy on Vera) to something else. Then add your children to it. If you’re using the same parent as serialproxy on Vera, serialproxy is just going to delete your new children everytime as it sync’s it’s own list of serial ports. You need to create your own ‘parent’ device.

@325xi,
the create-a-serial device process (in 1.0.944) looks something like the following (all examples translated to your IP space for realism, Please DON’T click the links!!)

[tt]http://192.168.1.131:49451/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreateDevice&Description=Serial_Portlist_IP192_168_1_90&Invisible=1&deviceType=micasaverde-com:serialportroot&internalID=IP192_168_1_90&IpAddress=192.168.1.90[/tt]

which returns something like:

[tt]<?xml version="1.0"?>
<u:CreateDeviceResponse xmlns:u=“urn:micasaverde-com:serviceId:HomeAutomationGateway1”>
228
</u:CreateDeviceResponse>
[/tt]

where “[tt]228[/tt]” is the Parent device Id that will contain the Serial Port.

You then create the Child Serial device, which looks something like:

[tt]http://192.168.1.131:49451/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=ProcessChildDevices&DeviceNumParent=228&DeviceList=ID=Remote90 Embedded=1 UpnpDevFilename=D_SerialPort1.xml DeviceType=urn:micasaverde-org:device:SerialPort:1 Description=My%20Remote%20Device Argument,urn:micasaverde-com:serviceId:HaDevice1,Protocol=RS232[/tt]

passing in the DeviceNum that was previously returned ([tt]228[/tt] in my case, but will be different in each use). There’s something a little “off” in the above, as it’s not returning the Child Device Id (which I’d expect)

You then do something like:

[tt]http://192.168.1.131:49451/data_request?id=lu_reload[/tt]

Most of the above is by trial and error, so there are likely problems. Once I wiki-ize this, we can collaboratively “correct” the descriptions over time.

The above will create the stubs in Vera, so that you have a [single] Serial Port hanging beneath the area:

[i]Luup Plugins --> Serial Port Configuration[/i]

You can then set the “IP:”, “Port:” and “Used by Device:” attributes on the Serial Port in Vera’s config, Save, and Vera will connect to the Remote IP/Port combo.

In my case, I’ve hard-coded a [tt]ser2net.conf[/tt] file on the “remote” (ASUS) end, and I’m not pulling down any of the User-specified config data from Vera.

Since this is experimental, and I don’t have the source to [tt]serproxy[/tt], no warranties about what else it might do :wink:

UPDATE: Jan 28 2010
The funky manual URL steps I’ve listed above to register a remote IP-based Serial Port can be replaced by the work-around Plugin code in this thread:

http://forum.micasaverde.com/index.php?topic=2989.msg12655#msg12655

This should make it a little easier to “register” these ports, at least until the Vera-native solution is in place.

Updating this thread in case folks search…

I managed to break my only working RS232 adapter, still waiting for the new one to try this…

@325xi, I have 2 of the Monoprice ones I list on the USB-Serial Wiki page and they both work fine. They’re fairly cheap, so you might consider these also. Not sure how much MonoP take to ship to you, but they’re cheap within CA. I buy tons of stuff from them (no affiliation, etc etc)