Tools made available by the dpanocam project:
- dpanocam: A daemon for controlling any serial device, including panorama cameras.
- ptzctrl: A remote control for PTZ (Pan-Tilt-Zoom) cameras that talks to dpanocam.
- relayctrl: A utility to control relays over Modbus.
Below is a quick usage guide for each tool.
Note that each of these programs will fail with error code 1 if any error occurs and print a message to stderr.
ptzctrl lets you remotely control your PTZ camera. You can send it to a preset location or take manual control using a gamepad.
ptzctrl [options]
- -h, --help: Show the help message.
- -v, --verbose: Enable verbose output (more detailed logs).
- -i, --interactive: Interactive mode—control the camera with a gamepad.
- -g, --goto : Move the camera to a saved preset location (0 to 127). Can't be used with --interactive.
- -d, --device-id : Set the camera's device ID (default is 1).
- -a, --ip-address : IP address to bind to (default is 0.0.0.0).
- -p, --ip-port : Port to bind to (default is 8080).
- -t, --tls-enable: Enable TLS for secure connections.
- -k, --tls-keyfile : Path to the TLS key file.
- -c, --tls-certfile : Path to the TLS certificate file.
- -f, --tls-ca-file : Path to the TLS CA file.
ptzctrl --interactive -a 192.168.1.10
ptzctrl --goto 10 -a 192.168.1.10
ptzctrl supports interactively controlling the camera with a gamepad.
The speed of movement is proportional to the position of the gamepad's analog stick.
Up to two cameras can be controlled at the same time.
It's possible to save the current position to a slot and recall it later.
This is persistent and can be used in conjunction with the --goto option to recall at a later time.
The current slot index will be printed to stdout.
| Button | Action |
|---|---|
| DPAD Up | Save current position to current slot |
| DPAD Down | Call preset from current slot |
| DPAD Left | Decrement current slot index |
| DPAD Right | Increment current slot index |
| East Symbol Button | Switch to other device |
| Right Stick | Move camera in pointed direction |
dpanocam is a daemon that manages communication with any serial device over TCP/IP.
This can be used in conjunction with ptzctrl to control panorama cameras.
Packages are sent as-is over serial and a response is awaited (if --serial-timeout is set).
If no response was received within the timeout specified, an empty response is sent back.
Encryption is supported via server authenticated TLS. This means that the server will only accept connections from clients that have a valid certificate.
This may be used in a situation where you want to restrict access to the server to only trusted clients.
dpanocam [options]
- -h, --help: Show the help message.
- -v, --verbose: Enable verbose output.
- -d, --serial-device : Serial device to use (default is /dev/ttyUSB0).
- -b, --serial-baud-rate : Serial baud rate (default is 9600).
- -s, --serial-timeout : Timeout in milliseconds for serial communication (default is 8).
If > 0, the server waits for a response and resets the timeout on data receipt.
If 0, no TCP packet will be sent back. - -a, --ip-address : IP address to bind to (default is 0.0.0.0).
- -p, --ip-port : Port to bind to (default is 8080).
- -t, --tls-enable: Enable TLS for secure connections.
- -k, --tls-keyfile : Path to the TLS key file.
- -c, --tls-certfile : Path to the TLS certificate file.
- -f, --tls-ca-file : Path to the TLS CA file.
dpanocam --serial-device /dev/ttyS0 --serial-baud-rate 115200
dpanocam --tls-enable --tls-keyfile key.pem --tls-certfile cert.pem --tls-ca-file ca.pem
relayctrl lets you control relays via Modbus commands from the command line.
relayctrl [options] <relay-number> <relay-state>
<relay-number>: The number of the relay you want to control.
<relay-state>: Desired state (0 for off, 1 for on).
- -h, --help: Show the help message.
- -v, --verbose: Enable verbose output.
- -a, --modbus-address : Modbus address to use (default is 0, which broadcasts to all devices).
- -d, --serial-device : Serial device to use (default is /dev/ttyUSB0).
- -b, --serial-baud-rate : Serial baud rate (default is 9600).
relayctrl 2 1
relayctrl --modbus-address 10 2 0
This project uses CMake to build. To build, run the following commands:
mkdir build && cd build
To build without SDL3 (and therefore without the ptzctrl tool), run the following command:
cmake ..
To build with SDL3 to get all tools, run the following command:
cmake .. -DENABLE_PTZCTRL=ON
Note that building SDL3 will take some time and disk space.
To build in debug mode, run the following command:
cmake .. -DCMAKE_BUILD_TYPE=Debug
If you have ninja installed, you can use it to build the project faster. To do this, run the following command:
cmake -G Ninja ..
Once CMake has generated the build files, run the following command to build the project:
cmake --build .
Once the project has been built, you can run the tools by executing the executables in the build directory.