Sending Custom Commands over the Serial Port

See also: The ONVIF Device IO Service | Using the Device IO Service

Prerequisite

Check that the serial port is configured to match your device capabilities on PTZ Page.

Using the ONVIF Device IO functions

We recommend this approach in most use cases.

Use The Device IO Functions to send and multiplex custom and standard (such as PELCO PTZ) commands to your device.

Your third-party client uses the URI reported by GetServices response to connect to The ONVIF Device IO Service .
Send a SendReceiveSerialCommandRequest to your Picolo.net HD1 to transfer a message to the serial device.
If you expect a reply from the serial device, enter the number of bytes in the DataLength argument of the request.
If you expect binary, use the <Binary> element within <SerialData>.
Picolo.net HD1 automatically replies with binary transport when the request uses binary.

Using tty.php

The operation of tty.php is subject to modifications, so we do not recommend to use it third-party application.
Use tty.php only for quick tests.
Before using tty.php:
Authenticate your HTTP client from the login web page.
Check that it includes the session cookie in its requests.

Using the Euresys Remote Serial Protocol (ERSP)

The ERSP is a light TCP-to-serial bridging protocol:

It provides a functionality similar to SendReceiveSerialCommand.
It is designed for a client software that runs on a low-resource device.
You have to authenticate only once when you launch the ERSP server.

The ERSP is not available over TLS, only over plain TCP.
You should use it only when you consider that the connection between the software client and the Picolo.net HD1 is physically secure.

Fully integrated approach

1. Send a GetTransparentSerialURI() command to the proprietary PTZ service.
2. Extract the IP address, the port number and the authentication code from the returned URI (as illustrated in the remoteSerial.py sample program).
3. Send and receive data (as illustrated in the sample program).

Prototyping approach

1. Adapt the remoteSerial.py sample program to perform the data exchange that you want to test.
2. Use the Start ERSP button in the Serial Port Configuration panel of PTZ Page to launch the server.

3. Copy the URI starting with ersp:// from the reply web page.

4. Use it to invoke the Python remoteSerial.py URI.

The ERSP server automatically terminates when the client closes the TCP session.