# README
mqtt-osc
This library provides a mechanism to issue Open Sound Control messages on MQTT events. Currently the flow of information is only supported from MQTT to OSC. There is also a simple command line application providing the basic relaying of messages. Using the library provides much more power of control.
Usage CLI
There is a simple command line interface for this library. You can download the binary for your platform in the Release section. Configuration is done via a YAML file. The tool provides you with a command to create a initial configuration file. Just do:
mqtt-osc config config.yaml
This will create the file config.yaml
. Then open this file in your favorite text editor and tweak it for your usage.
# Hostname of the MQTT broker (aka server).
mqtt_host: 127.0.0.1
# Port of the MQTT broker (aka server).
mqtt_port: 1883
# Sets the Client-ID when connecting to the MQTT broker.
mqtt_client_id: mqtt-osc-relay
# Username for the authentication against the MQTT broker.
mqtt_user: user
# Password for the authentication against the MQTT broker.
mqtt_password: secret
# Hostname of the OSC server where the OSC command should be sent to.
osc_host: 127.0.0.1
# Port of the OSC server where the OSC command should be sent to.
osc_port: 8765
# A list of handlers. Each handler defines a MQTT topic which will be
# trigerred by. For More information see below.
handlers:
- mqtt_topic: /light/+/on
osc_address: /light/{{ ._1 }}/turn-on
# If true, the payload of the MQTT event will be relayed to the OSC
# server as a string content.
relay_payload: false
# Packages
No description provided by the author
# Constants
DebugLevel represents the second lowest logging level and is used for debug messages.
ErrorLevel represents events which seriously intercept the execution of the application.
InfoLevel represents logging messages a user should see during the execution of the library.
PanicLevel represents events which will lead to a panicking of the application.
TraceLevel represents the lowest logging level for tracing.
WarnLevel represents the logging level if something noteworthy happened which likely could be or lead to unintended behavior.
# Structs
MqttToOscHandler listen to one MQTT event and describes the effects it will have.
Relay provides the forwarding of messages from MQTT to OSC.
# Type aliases
Logger is the log function used in the library.
LogLevel describes the different levels of importance a logging message can have.
TranslateFunc is the function type used to alter the outgoing OSC address template data and payload.