#dmx #serial #lighting #enttec #api-bindings

open_dmx

A wrapper around the serialport library to send DMX data over a serial port

7 releases (3 stable)

1.1.1 Feb 28, 2024
1.0.1 May 11, 2023
0.1.3 Mar 9, 2023
0.1.2 Dec 22, 2022

#311 in Multimedia

Download history 1/week @ 2024-02-13 55/week @ 2024-02-20 171/week @ 2024-02-27 20/week @ 2024-03-05 10/week @ 2024-03-12 1/week @ 2024-03-19 10/week @ 2024-03-26 40/week @ 2024-04-02

190 downloads per month
Used in artnet_to_opendmx

MIT license

23KB
250 lines

open_dmx   Latest Release Documentation License

A wrapper around the serialport library to send DMX data over a serial port via the Open-DMX(RS-485) protocol


Basic Setup

use open_dmx::DMXSerial;

fn main() {
    let mut dmx = DMXSerial::open("COM3").unwrap();
    dmx.set_channels([255; 512]);
    dmx.set_channel(1, 0).unwrap();
}

DMXSerial updates its channels automatically to the Serial Port for a stable connection. For strobe effects DMXSerial.update() can be used, which blocks the main thread until a packet is sent over serial.

The automatic sending can also be disabled with DMXSerial::open_sync(path) or DMXSerial.set_sync()

Works with COM-Ports on Windows and TTYPorts on Unix systems.

Dependencies

For linux pkg-config and libudev are required.

Dependencies

~1.6–2.6MB
~51K SLoC