Skip to content

Send DMX using sACN over websockets, created for use in virtual lighting rigs.

License

Notifications You must be signed in to change notification settings

XDelta/sACN_Websockets

Repository files navigation

sACN_Websockets

Send a universe of DMX using sACN over websockets, created for use in virtual lighting rigs.

License: GPL v3

Prerequisite

  • Python 3.8.x or newer (tested up to 3.11.2)
  • A Websocket Relay Server
  • Any lighting software that supports sACN

By default, a websocket server will be run locally at ws://localhost:80/ but you can use any server that accepts websockets and can then distribute it to connected clients.
I recommend setting up your own websocket relay server for this if you want to send to more than a single 'client' connection.

Install

Download the Latest Release.
Install the requirements with

pip install -r requirements.txt

Edit config.toml with your Websocket host and network settings

Config

[destination]

ws_uri = "ws://localhost"
Websocket relay host, by default, this will attempt to connect to a locally hosted websocket server.

locally_host = true
Hosts a websocket relay server on localhost when set to 'true', will need to be changed to 'false' if you want to use a different/external relay server.

local_port = 80
Websocket port when hosting locally. Ignored when locally host is set to false.

[dmx]

sACN_port = 5568
Port for sACN, shouldn't need to be changed

sACN_ip = "127.0.0.1"
IP address to listen for sACN on, in this case it is the local device. Depending on the lighting software you use, you may need to enable sending sACN to Applications on the same device. In MagicQ, this is in Setup>Network.
settings image in magicq
In newer versions of MagicQ, this setting has been changed to Net host options
settings image in magicq


sACN_universe = 1
sACN universe to listen to, most small setups won't need to be change this. If you need to send multiple universes, multiple copies of the application can be used but you will need to have separate config files made.

dmx_fps = 10
DMX Sending rate can be anything between 1 and 48, this defines the maximum rate but if there isn't new DMX data to send, less packets will be sent to match.

Usage

Run sACN_Websockets.py
The default configuration will host a websocket server available at ws://localhost:80/ and listen for sACN Universe 1 on 127.0.0.1:5568