Aurora Multimedia produces a number of network-attached port expanders for their WACI line of A/V control systems. Among these is their LXC-200, which provides 3 RS-232 serial ports, 2 IR ports, 2 relays and 1 GPIO in a small, POE-powered chassis. See their page for more details.
All of their WACI devices provide an HTTP-RPC API for control. In my case, I want to use the LXC-200 as a general purpose network-attached serial output port. Eventually I’d like to find a way to use it with the FSR FLEX-LT control system but for now I just want to send some serial port output from a command line. The LXC and WACI documentation provide a list of the RPC calls, but the exact usage was a tad vague. So, time to fire up Wireshark and see how this puppy is used.
The WACI event manager has the ability to send serial output to a remote port on another WACI, so I create a simple test event and point it at the LXC. Trigger the event and watch the packets flow!
The URL used was http://address.of.waci.unit/rpc/
According to the Aurora RPC docs, param3 is a max wait time, in ms. I’m just going to leave it at 10 as I’m not sure what it’s waiting for, exactly.
So, let’s give curl a shot:
$ curl --data "method=Serial_Send¶m1=1¶m2=TestCURL¶m3=10" "http://a.b.c.d/rpc/" status=HTTP/1.1 200 OK Connection: close
And, sure enough, the serial strings pop out the port. What if we want to send raw binary data via the serial port (for controlling, say a Samsung EX-Link TV)? Well, the HTTP request is encoded with x-www-form-urlencoded, which is an old but still valid encoding mechanism. We just need to use the WACI syntax for sending binary data:
$ curl --data "method=Serial_Send¶m1=1¶m2=%08%22%00%00%00%02%d4¶m3=10" "http://a.b.c.d/rpc/"
And the “Power On” command emerges from the serial port.
Now, how to make the FSR talk HTTP…