This library is to simplify the validation and handling of E1.31 sACN (DMX over Ethernet) traffic. It supports both Unicast and Multicast configurations and exposes the full E1.31 packet to the user. Currently, development is targeted for the ESP8266 WiFi module and traditional Ethernet shields.
- ESP8266
- Arduino + Ethernet Shield (unicast until Arduino 1.66 is released)
- Double-buffering of packet data is disabled on AVR architectures due to memory constraints. Make sure to check the return value of
parsePacket()
as your buffer may be trashed if a bad packet made its way in. - Other architectures (i.e. ESP8266) double buffer the packets, so
e131.data
can always be considered pristine. Double buffering can be disabled by definingNO_DOUBLE_BUFFER
inE131.h
. - WiFi connection attempts will timeout after 10 seconds if a successful connection has not been established.
WIFI_CONNECT_TIMEOUT
can be changed inE131.h
.
These are to initialize the network stack and should be in the setup()
function of your sketch.
This initializer only sets up the UDP listener. It is up to the user to setup their network connection. The initializers below this one will setup the network connection for you.
void begin(e131_listen_t type, uint16_t universe = 1)
: valid types areE131_UNICAST
andE131_MULTICAST
.universe
is optional and only used for Multicast configuration.
int begin(const char *ssid, const char *passphrase)
: returnsWiFi.status()
int begin(const char *ssid, const char *passphrase, IPAddress ip, IPAddress netmask, IPAddress gateway, IPAddress dns)
: returnsWiFi.status()
int beginMulticast(const char *ssid, const char *passphrase, uint16_t universe)
: returnsWiFi.status()
int beginMulticast(const char *ssid, const char *passphrase, uint16_t universe, IPAddress ip, IPAddress netmask, IPAddress gateway, IPAddress dns)
: returnsWiFi.status()
int begin(uint8_t *mac)
: DHCP initializer. Returns 0 if DHCP failed, 1 for successvoid begin(uint8_t *mac, IPAddress ip, IPAddress netmask, IPAddress gateway, IPAddress dns)
: Static initializer
These are non-blocking handlers to be used in the loop()
function of your sketch.
int parsePacket()
: Checks and parses new packets, returns number of DMX Channels in packet asuint16_t
byte *data
: Pointer to DMX channel data from packet. Always valid if double-buffering is enabled (see notes above)uint16_t universe
: DMX Universe of last valid packete131_packet_t *packet
: Pointer to last packet. Always valid if double-buffering is enabled (see notes above)e131_stats_t stats
: E1.31 Statistics
- Latest code: http://github.com/forkineye/E131
- Other Stuff: http://forkineye.com