Giter Site home page Giter Site logo

artnete131lib_esp8266's Introduction

ArtNet V4 and sACN (E131) Library for esp8266

Build Status

With this library you can receive or send ArtNet V4 or sACN (E131) on an ESP8266.

Initial version by Matthew Tong. The library was copied from there and extended. The library was extended by utilising the E131 Lib by forkineye.

USAGE

** Note: ** The following library must be installed: E131 by forkineye

Instanciate:

  espArtNetRDM myArtRdm;

Configuration:

Initialize:

myArtRdm.init(ArtNetOEMCode, EstaManufacturerCode, macAddress);
myArtRdm.init(shortName, ArtNetOEMCode, EstaManufacturerCode, macAddress);
myArtRdm.init(shortName, longName, ArtNetOEMCode, EstaManufacturerCode, macAddress);
myArtRdm.init(ipAddress, subnetMask, dhcpEnabled, ArtNetOEMCode, EstaManufacturerCode, macAddress);
myArtRdm.init(ipAddress, subnetMask, dhcpEnabled, shortName, longName, ArtNetOEMCode, EstaManufacturerCode, macAddress);

More information: ArtNet OEM, ESTA Manufacturer Code, Get MAC address of ESP8266

To add a ArtNet net and subnet:

uint8_t _group = myArtRdm.addGroup(netNum, subnetNum);  // store the return value

To add a Port (Universe):

portType can be:

  • DMX_OUT = receive DMX from Network
  • DMX_IN = send DMX to Network

htpMerge: true for Highest Takes Precedence, false for Latest Takes Precedence.

uint8_t _port = myArtRdm.addPort(_group, portNum, universeNum, portType, htpMerge);

To set the network protocol type:

protocolType can be:

  • ARTNET = ArtNet V4
  • sACN_UNICAST = sACN Unicast
  • sACN_MULTICAST = sACN Multicast (not yet implemented)
myArtRdm.setProtocolType(_group, _port, protocolType);  // store the return value

At the end of the configuration process start listening to UDP packets with this command:

myArtRdm.begin();

Place this function in main loop to let the library handle the data periodically:

myArtRdm.handler();

Receiving ArtNet/sACN data:

Setup a callback function:

myArtRdm.setArtDMXCallback(dmxHandle);

and implement the callback function like this:

void dmxHandle(uint8_t group, uint8_t port, uint16_t numChans, bool syncEnabled)
{
	if(group == _group && port == _port)
	{
		// read out the value of the dmx channel (-1 because buffer of dmx data starts at 0)
		uint8_t valueOfDmxChannel = myArtRdm.getDMX(_group, _port)[channel -1];
	}
}

Send Data to ArtNet/sACN:

To send data use the following function:

  myArtRdm.sendDMX(groupNum, portNum, broadcastAddress, dataArray, 512);

General:

To set the Firmware version sent with each ArtPoll:

  myArtRdm.setFirmwareVersion(fwVersion);

To set the default ArtNet IP (generates IP by using the MAC address):

  myArtRdm.setDefaultIP();

artnete131lib_esp8266's People

Contributors

jonasarnold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

artnete131lib_esp8266's Issues

Sending E131 example

How would the most simple sending example look like to an E131 receiver? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.