oladmxctl/README.md

84 lines
2.2 KiB
Markdown
Raw Permalink Normal View History

# olaDMXctl
2023-03-22 21:09:54 +01:00
[![Release](https://img.shields.io/badge/release-v1.0.2-orange)](https://git.tjdev.de/DrMaxNix/oladmxctl/releases/tag/v1.0.2)
[![License](https://img.shields.io/badge/license-MIT-green)](https://git.tjdev.de/DrMaxNix/oladmxctl/src/branch/main/LICENSE)
2021-09-11 00:54:40 +02:00
[![Maintaner](https://img.shields.io/badge/maintainer-DrMaxNix-blue)](https://www.drmaxnix.de)
2021-09-09 22:58:44 +02:00
Command-line tool for controlling individual dmx channels with olad
## installation
### php and curl
This tool is coded in php and uses curl for http-requests so you need to have that installed
2023-03-22 21:09:54 +01:00
```console
# apt update
# apt install php curl
```
### download
2023-03-22 21:09:54 +01:00
Download the script from git.tjdev.de
```console
$ wget -O oladmxctl https://git.tjdev.de/attachments/fc075f16-2923-4856-a4bf-621c5162bee4
```
Make it executable
2023-03-22 21:09:54 +01:00
```console
$ chmod +x oladmxctl
```
### move into /usr/bin (optional)
You can skip this step. This will only make it so you can call the script from everywhere using `oladmxctl`. If you skip this step you will have to use `./oladmxctl` or `/path/to/oladmxctl` to run the script.
2023-03-22 21:09:54 +01:00
```console
# mv oladmxctl /usr/local/bin
```
## usage
```
oladmxctl --universe <universe> [--write <json>] [--read <json>]
-s --silent No error/warning/info output
-u --universe Universe number to control
-w --write JSON-encoded string with channel-value pairs to write
-r --read JSON-encoded string with channels to read from and output
to stdout as JSON-encoded string with channel-value pairs
-f --force-rewrite Force write request to olad even if no data has changed
-1 --ch-offset First channel has number 1
-a --address Address of the olad instance (default 127.0.0.1)
-p --port Port of the olad instance (default 9090)
-3 --ssl Use https instead of http
-h --help Show this help and exit
-v --version Print version and exit
```
## examples
### Set channel 13 and 14 to 255 in universe 1
2023-03-22 21:09:54 +01:00
```console
$ oladmxctl --universe 1 --write '{"13":255, "14":255}'
```
### Read channels 13 and 14 in universe 1
2023-03-22 21:09:54 +01:00
```console
$ oladmxctl --universe 1 --read '[13, 14]'
```
Returns `{"13":255, "14":255}`