Skip to content
A library for sending DMX-512 messages in an sACN packet over UDP
C++
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src
.DS_Store
.gitattributes
.gitignore
README.adoc
keywords.txt
library.properties

README.adoc

sACN Source Library for Arduino

This library creates an array for sending DMX-512 messages using streaming ACN (sACN). This affords control of many modern stage lighting fixtures over UDP. The library wraps a UDP transport object in the constructor so it can send UDP packets.

The Library uses the Arduino WiFiUDP library, but it can work with either MKR1000 and other Arduino boards using the WiFi101 library, or ESP8266 boards using the ESP8266WiFi library.

For more detail on the sACN protocol, see the ESTA E.131 protocol document

Commands

sACNSource

Syntax
WiFiUDP Udp;                       // instance of UDP library
sACNSource myController(Udp);      // Your Ethernet-to-DMX device
Parameters

takes a UDP object for transport

Returns

void

Notes

Initializes the sACN packet.

begin

Syntax
myController.begin(myDevice, myUuid, myUniverse);
myController.begin(myDevice, myUuid, myUniverse, thisPort);
Parameters

myDevice - a character string containing the name of the source device

myUuid - a character string containing the UUID of the source device. This must be in ASCII-encoded hexadecimal, but can include dashes as delimiters. See UUID Generator for examples.

myUniverse - an integer containing the DMX universe you want to control.

thisPort - if you want to use a port other than the sACN standard (5568), you can pass in an int with your port number

Returns

void

Notes

Sets the initial parameters for the sACN packet.

setUuid

Syntax
myController.setUuid(myUuid);
Parameters

myUuid - a character string containing the UUID of the source device.

Returns

void

Notes

This must be in ASCII-encoded hexadecimal, but can include dashes as delimiters. See UUID Generator for examples.

setSourceName

Syntax
myController.setSourceName(myDevice);
Parameters

myDevice - a character array containing the device name of your source. Max. 64 characters.

Returns

void

setUniverse

Syntax
myController.setUniverse(dmxUniverse);
Parameters

dmxUniverse - an integer containing the DMX universe that you wish to control.

Returns

void

setChannel

Syntax
myController.setChannel(dmxChannel, level);
Parameters

dmxChannel - an integer containing the DMX channel you want to set (1-512)

level - a byte containing the level to which you want to set the channel ( 0 - 255)

Returns

void

Notes

Note that DMX channels are usually 1-indexed, rather than 0-indexed. So the first channel is channel 1.

sendPacket

Syntax
myController.sendPacket(receiverAddress);
myController.sendPacket(receiverAddress, thisPort);
Parameters

receiverAddress - a character array containing the numeric IP address of the receiver

thisPort - if you want to use a port other than the sACN standard (5568), you can pass in an int with your port number

Returns

void

Notes

This function auto-increments the sequence number for packets, so you don’t have to.

setSequenceNumber

Syntax
myController.setSequenceNumber(seqNumber);
Parameters

seqNumber - a byte containing the packet sequence number.

Returns

void

Notes

sACN packets are given a packet sequence number so that the receiver can keep the sequence of packets from a given sender. The sendPacket function automatically increments the sequence number, so there’s no real need to set this unless you want to set a specific number.

getSequenceNumber

Syntax
byte num = myController.getSequenceNumber();
Parameters

none

Returns

a byte containing the latest packet sequence number.

setSyncAddress

Syntax
myController.setSyncAddress(syncAddress);
Parameters

syncAddress - an int containing the sync universe address. Default is 0.

Returns

void

setOptions

Syntax
myController.setOptions(options);
Parameters

a byte containing the options flags for preview data, stream termination, and forced synchronization.

Returns

void

Notes

Not implemented in version 0.0.1

readData

Syntax
myController.readData(byteNumber);
Parameters

byteNumber - a byte containing the number of the byte in the packet that you want to read.

Returns

a byte variable containing the value of the byte you requested

packetSize

Syntax
myController.packetSize();
Parameters

none

Returns

an int variable containing the size of the packet.

Notes

Unless modified, this will always be 638.

You can’t perform that action at this time.