Skip to content

Latest commit

History

90 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ArtNet

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

This is a fork of ArtNet repository with added support for Industruino.

Below is a copy of the read me from the master repo.

NOTE : BREAKING API CHANGES (v0.2.0 or later)

Feature

  • Art-Net with both Ethernet and WiFi
  • Support a lot of boards which can use Ethernet or WiFi
  • Multiple receiver callbacks depending on universe
  • Mutilple destination streaming with sender
  • One-line send to desired destination
  • Flexible net/subnet/universe setting
  • Easy data forwarding to FastLED

Supported Platforms

WiFi

  • ESP32
  • ESP8266
  • Arduino Uno WiFi Rev2
  • Arduino MKR VIDOR 4000
  • Arduino MKR WiFi 1010
  • Arduino MKR WiFi 1000
  • Arduino Nano 33 IoT

Ethernet

  • Almost all platforms without WiFi

Usage

This library has following Art-Net controller options. Please use them depending on the situation.

  • ArtnetReveiver
  • ArtnetSender
  • Artnet (Integrated Sender/Receiver)

ArtnetReceiver

#include<Artnet.h>
ArtnetReceiver artnet;
voidcallback(constuint8_t* data, constuint16_t size) {
// you can also use pre-defined callbacks
}
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin(); // waiting for Art-Net in default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe1, [](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe(0-15), this function is called
});
artnet.subscribe(universe2, callback); // you can also use pre-defined callbacks
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
}

ArtnetSender

#include<Artnet.h>
ArtnetSender artnet;
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin();
}
voidloop() {
// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet (Integrated Sender/Receiver)

#include<Artnet.h>
Artnet artnet;
voidsetup()
{
// setup Ethernet/WiFi...
artnet.begin(); // send to localhost and listen to default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe, [&](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe, this function is called
});
artnet.subscribe([&](constuint32_t univ, constuint8_t* data, constuint16_t size) {
// if Artnet packet comes, this function is called to every universe
});
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet Receiver + FastLED

#include<Artnet.h>
ArtnetReceiver artnet;
// FastLED
#defineNUM_LEDS1CRGB leds[NUM_LEDS];
constuint8_tPIN_LED_DATA = 3;
voidsetup() {
// setup Ethernet/WiFi...// setup FastLED
FastLED.addLeds<NEOPIXEL, PIN_LED>(&leds, NUM_LEDS);
artnet.begin();
// if Artnet packet comes to this universe, forward them to fastled directly
artnet.forward(universe, leds, NUM_LEDS);
// this can be achieved manually as follows// artnet.subscribe(universe, [](uint8_t* data, uint16_t size)// {// // artnet data size per packet is 512 max// // so there is max 170 pixel per packet (per universe)// for (size_t pixel = 0; pixel < NUM_LEDS; ++pixel)// {// size_t idx = pixel * 3;// leds[pixel].r = data[idx + 0];// leds[pixel].g = data[idx + 1];// leds[pixel].b = data[idx + 2];// }// });
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
FastLED.show();
}

Other Settings

Subscribing Callbacks with Net, Sub-Net and Universe as you like

  • You can set Net (0-127) and Sub-Net (0-15) like artnet.begin(net, subnet)
  • Universe (0-15) can be set in artnet.subscribe(universe, callback),
  • Callbacks are limited to 4 universes (depending on the spec of Art-Net)
artnet.begin(net, subnet); // net and subnet can be set only once
artnet.subscribe(univ1, callback1); // 4 callbacks can be set
artnet.subscribe(univ2, callback2); // these universes are reported to
artnet.subscribe(univ3, callback3); // Art-Net controller if it polls
artnet.subscribe(univ4, callback4); // Art-Net devices

Sending Art-Net to Net, Sub-Net and Universe as you like

One-line sender

artnet.send(ip, univ15bit, data, size); // use 15bit universer or
artnet.send(ip, net, subnet, univ, data, size); // net, subnet, and universe

Streaming

artnet.streaming_data(data, size); // set data first
artnet.streaming(ip, univ15bit); // stream to 15bit universe or
artnet.streaming(ip, net, subnet, univ); // net, subnet, and universe

ArtPollReply Setting

  • This library supports ArtPoll and ArtPollReply
  • ArtPoll is automatically parsed and sends ArtPollReply
  • net_swsub_swsw_in etc. are set automatically based on registerd callbacks
  • You can configure the information of ArtPollReply as follows
    • void shortname(const String& sn)
    • void longname(const String& ln)
    • void nodereport(const String& nr)

APIs

ArtnetSender

// streaming packetvoidstreaming_data(constuint8_t* const data, constuint16_t size);
voidstreaming_data(constuint16_t ch, constuint8_t data);
voidstreaming(const String& ip, constuint32_t universe_);
voidstreaming(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_);
// one-line sendervoidsend(const String& ip, constuint32_t universe_, constuint8_t* const data, constuint16_t size);
voidsend(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_, constuint8_t* const data, constuint16_t size);
// othersvoidphysical(constuint8_t i);
uint8_tsequence() const;

ArtnetReceiver

OpCode parse();
// subscriberstemplate <typename F> inlineautosubscribe(constuint8_t universe, F&& func);
template <typename F> inlineautosubscribe(constuint8_t universe, F* func);
template <typename F> inlineautosubscribe(F&& func);
template <typename F> inlineautosubscribe(F* func);
// for FastLEDinlinevoidforward(constuint8_t universe, CRGB* leds, constuint16_t num);
// unsubscribeinlinevoidunsubscribe(constuint8_t universe);
inlinevoidunsubscribe();
inlinevoidclear_subscribers();
// ArtPollReply informationvoidshortname(const String& sn);
voidlongname(const String& ln);
voidnodereport(const String& nr);
// othersinlineconst IPAddress& ip() const;
uint16_tport() const;
String id() const;
uint16_topcode() const;
uint16_topcode(constuint8_t* p) const;
uint16_tversion() const;
uint8_tsequence() const;
uint8_tphysical() const;
uint8_tnet() const;
uint8_tsubnet() const;
uint8_tuniverse() const;
uint16_tuniverse15bit() const;
uint16_tlength() const;
uint16_tsize() const;
uint8_t* data();
uint8_tdata(constuint16_t i) const;

Note

Some boards without enough memory (e.g. Uno, Nano, etc.) may not be able to use integrated sender/receiver because of the lack of enough memory. Please consider to use more powerful board or to use only sender OR receiver.

Reference

Embedded Libraries

License

MIT

About

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - gunstr/ArtNet: Art-Net Sender/Receiver for Arduino (Ethernet, WiFi) · GitHub
Skip to content

Latest commit

History

90 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ArtNet

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

This is a fork of ArtNet repository with added support for Industruino.

Below is a copy of the read me from the master repo.

NOTE : BREAKING API CHANGES (v0.2.0 or later)

Feature

  • Art-Net with both Ethernet and WiFi
  • Support a lot of boards which can use Ethernet or WiFi
  • Multiple receiver callbacks depending on universe
  • Mutilple destination streaming with sender
  • One-line send to desired destination
  • Flexible net/subnet/universe setting
  • Easy data forwarding to FastLED

Supported Platforms

WiFi

  • ESP32
  • ESP8266
  • Arduino Uno WiFi Rev2
  • Arduino MKR VIDOR 4000
  • Arduino MKR WiFi 1010
  • Arduino MKR WiFi 1000
  • Arduino Nano 33 IoT

Ethernet

  • Almost all platforms without WiFi

Usage

This library has following Art-Net controller options. Please use them depending on the situation.

  • ArtnetReveiver
  • ArtnetSender
  • Artnet (Integrated Sender/Receiver)

ArtnetReceiver

#include<Artnet.h>
ArtnetReceiver artnet;
voidcallback(constuint8_t* data, constuint16_t size) {
// you can also use pre-defined callbacks
}
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin(); // waiting for Art-Net in default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe1, [](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe(0-15), this function is called
});
artnet.subscribe(universe2, callback); // you can also use pre-defined callbacks
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
}

ArtnetSender

#include<Artnet.h>
ArtnetSender artnet;
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin();
}
voidloop() {
// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet (Integrated Sender/Receiver)

#include<Artnet.h>
Artnet artnet;
voidsetup()
{
// setup Ethernet/WiFi...
artnet.begin(); // send to localhost and listen to default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe, [&](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe, this function is called
});
artnet.subscribe([&](constuint32_t univ, constuint8_t* data, constuint16_t size) {
// if Artnet packet comes, this function is called to every universe
});
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet Receiver + FastLED

#include<Artnet.h>
ArtnetReceiver artnet;
// FastLED
#defineNUM_LEDS1CRGB leds[NUM_LEDS];
constuint8_tPIN_LED_DATA = 3;
voidsetup() {
// setup Ethernet/WiFi...// setup FastLED
FastLED.addLeds<NEOPIXEL, PIN_LED>(&leds, NUM_LEDS);
artnet.begin();
// if Artnet packet comes to this universe, forward them to fastled directly
artnet.forward(universe, leds, NUM_LEDS);
// this can be achieved manually as follows// artnet.subscribe(universe, [](uint8_t* data, uint16_t size)// {// // artnet data size per packet is 512 max// // so there is max 170 pixel per packet (per universe)// for (size_t pixel = 0; pixel < NUM_LEDS; ++pixel)// {// size_t idx = pixel * 3;// leds[pixel].r = data[idx + 0];// leds[pixel].g = data[idx + 1];// leds[pixel].b = data[idx + 2];// }// });
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
FastLED.show();
}

Other Settings

Subscribing Callbacks with Net, Sub-Net and Universe as you like

  • You can set Net (0-127) and Sub-Net (0-15) like artnet.begin(net, subnet)
  • Universe (0-15) can be set in artnet.subscribe(universe, callback),
  • Callbacks are limited to 4 universes (depending on the spec of Art-Net)
artnet.begin(net, subnet); // net and subnet can be set only once
artnet.subscribe(univ1, callback1); // 4 callbacks can be set
artnet.subscribe(univ2, callback2); // these universes are reported to
artnet.subscribe(univ3, callback3); // Art-Net controller if it polls
artnet.subscribe(univ4, callback4); // Art-Net devices

Sending Art-Net to Net, Sub-Net and Universe as you like

One-line sender

artnet.send(ip, univ15bit, data, size); // use 15bit universer or
artnet.send(ip, net, subnet, univ, data, size); // net, subnet, and universe

Streaming

artnet.streaming_data(data, size); // set data first
artnet.streaming(ip, univ15bit); // stream to 15bit universe or
artnet.streaming(ip, net, subnet, univ); // net, subnet, and universe

ArtPollReply Setting

  • This library supports ArtPoll and ArtPollReply
  • ArtPoll is automatically parsed and sends ArtPollReply
  • net_swsub_swsw_in etc. are set automatically based on registerd callbacks
  • You can configure the information of ArtPollReply as follows
    • void shortname(const String& sn)
    • void longname(const String& ln)
    • void nodereport(const String& nr)

APIs

ArtnetSender

// streaming packetvoidstreaming_data(constuint8_t* const data, constuint16_t size);
voidstreaming_data(constuint16_t ch, constuint8_t data);
voidstreaming(const String& ip, constuint32_t universe_);
voidstreaming(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_);
// one-line sendervoidsend(const String& ip, constuint32_t universe_, constuint8_t* const data, constuint16_t size);
voidsend(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_, constuint8_t* const data, constuint16_t size);
// othersvoidphysical(constuint8_t i);
uint8_tsequence() const;

ArtnetReceiver

OpCode parse();
// subscriberstemplate <typename F> inlineautosubscribe(constuint8_t universe, F&& func);
template <typename F> inlineautosubscribe(constuint8_t universe, F* func);
template <typename F> inlineautosubscribe(F&& func);
template <typename F> inlineautosubscribe(F* func);
// for FastLEDinlinevoidforward(constuint8_t universe, CRGB* leds, constuint16_t num);
// unsubscribeinlinevoidunsubscribe(constuint8_t universe);
inlinevoidunsubscribe();
inlinevoidclear_subscribers();
// ArtPollReply informationvoidshortname(const String& sn);
voidlongname(const String& ln);
voidnodereport(const String& nr);
// othersinlineconst IPAddress& ip() const;
uint16_tport() const;
String id() const;
uint16_topcode() const;
uint16_topcode(constuint8_t* p) const;
uint16_tversion() const;
uint8_tsequence() const;
uint8_tphysical() const;
uint8_tnet() const;
uint8_tsubnet() const;
uint8_tuniverse() const;
uint16_tuniverse15bit() const;
uint16_tlength() const;
uint16_tsize() const;
uint8_t* data();
uint8_tdata(constuint16_t i) const;

Note

Some boards without enough memory (e.g. Uno, Nano, etc.) may not be able to use integrated sender/receiver because of the lack of enough memory. Please consider to use more powerful board or to use only sender OR receiver.

Reference

Embedded Libraries

License

MIT

About

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - gunstr/ArtNet: Art-Net Sender/Receiver for Arduino (Ethernet, WiFi) · GitHub
Skip to content

Latest commit

History

90 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ArtNet

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

This is a fork of ArtNet repository with added support for Industruino.

Below is a copy of the read me from the master repo.

NOTE : BREAKING API CHANGES (v0.2.0 or later)

Feature

  • Art-Net with both Ethernet and WiFi
  • Support a lot of boards which can use Ethernet or WiFi
  • Multiple receiver callbacks depending on universe
  • Mutilple destination streaming with sender
  • One-line send to desired destination
  • Flexible net/subnet/universe setting
  • Easy data forwarding to FastLED

Supported Platforms

WiFi

  • ESP32
  • ESP8266
  • Arduino Uno WiFi Rev2
  • Arduino MKR VIDOR 4000
  • Arduino MKR WiFi 1010
  • Arduino MKR WiFi 1000
  • Arduino Nano 33 IoT

Ethernet

  • Almost all platforms without WiFi

Usage

This library has following Art-Net controller options. Please use them depending on the situation.

  • ArtnetReveiver
  • ArtnetSender
  • Artnet (Integrated Sender/Receiver)

ArtnetReceiver

#include<Artnet.h>
ArtnetReceiver artnet;
voidcallback(constuint8_t* data, constuint16_t size) {
// you can also use pre-defined callbacks
}
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin(); // waiting for Art-Net in default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe1, [](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe(0-15), this function is called
});
artnet.subscribe(universe2, callback); // you can also use pre-defined callbacks
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
}

ArtnetSender

#include<Artnet.h>
ArtnetSender artnet;
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin();
}
voidloop() {
// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet (Integrated Sender/Receiver)

#include<Artnet.h>
Artnet artnet;
voidsetup()
{
// setup Ethernet/WiFi...
artnet.begin(); // send to localhost and listen to default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe, [&](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe, this function is called
});
artnet.subscribe([&](constuint32_t univ, constuint8_t* data, constuint16_t size) {
// if Artnet packet comes, this function is called to every universe
});
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet Receiver + FastLED

#include<Artnet.h>
ArtnetReceiver artnet;
// FastLED
#defineNUM_LEDS1CRGB leds[NUM_LEDS];
constuint8_tPIN_LED_DATA = 3;
voidsetup() {
// setup Ethernet/WiFi...// setup FastLED
FastLED.addLeds<NEOPIXEL, PIN_LED>(&leds, NUM_LEDS);
artnet.begin();
// if Artnet packet comes to this universe, forward them to fastled directly
artnet.forward(universe, leds, NUM_LEDS);
// this can be achieved manually as follows// artnet.subscribe(universe, [](uint8_t* data, uint16_t size)// {// // artnet data size per packet is 512 max// // so there is max 170 pixel per packet (per universe)// for (size_t pixel = 0; pixel < NUM_LEDS; ++pixel)// {// size_t idx = pixel * 3;// leds[pixel].r = data[idx + 0];// leds[pixel].g = data[idx + 1];// leds[pixel].b = data[idx + 2];// }// });
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
FastLED.show();
}

Other Settings

Subscribing Callbacks with Net, Sub-Net and Universe as you like

  • You can set Net (0-127) and Sub-Net (0-15) like artnet.begin(net, subnet)
  • Universe (0-15) can be set in artnet.subscribe(universe, callback),
  • Callbacks are limited to 4 universes (depending on the spec of Art-Net)
artnet.begin(net, subnet); // net and subnet can be set only once
artnet.subscribe(univ1, callback1); // 4 callbacks can be set
artnet.subscribe(univ2, callback2); // these universes are reported to
artnet.subscribe(univ3, callback3); // Art-Net controller if it polls
artnet.subscribe(univ4, callback4); // Art-Net devices

Sending Art-Net to Net, Sub-Net and Universe as you like

One-line sender

artnet.send(ip, univ15bit, data, size); // use 15bit universer or
artnet.send(ip, net, subnet, univ, data, size); // net, subnet, and universe

Streaming

artnet.streaming_data(data, size); // set data first
artnet.streaming(ip, univ15bit); // stream to 15bit universe or
artnet.streaming(ip, net, subnet, univ); // net, subnet, and universe

ArtPollReply Setting

  • This library supports ArtPoll and ArtPollReply
  • ArtPoll is automatically parsed and sends ArtPollReply
  • net_swsub_swsw_in etc. are set automatically based on registerd callbacks
  • You can configure the information of ArtPollReply as follows
    • void shortname(const String& sn)
    • void longname(const String& ln)
    • void nodereport(const String& nr)

APIs

ArtnetSender

// streaming packetvoidstreaming_data(constuint8_t* const data, constuint16_t size);
voidstreaming_data(constuint16_t ch, constuint8_t data);
voidstreaming(const String& ip, constuint32_t universe_);
voidstreaming(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_);
// one-line sendervoidsend(const String& ip, constuint32_t universe_, constuint8_t* const data, constuint16_t size);
voidsend(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_, constuint8_t* const data, constuint16_t size);
// othersvoidphysical(constuint8_t i);
uint8_tsequence() const;

ArtnetReceiver

OpCode parse();
// subscriberstemplate <typename F> inlineautosubscribe(constuint8_t universe, F&& func);
template <typename F> inlineautosubscribe(constuint8_t universe, F* func);
template <typename F> inlineautosubscribe(F&& func);
template <typename F> inlineautosubscribe(F* func);
// for FastLEDinlinevoidforward(constuint8_t universe, CRGB* leds, constuint16_t num);
// unsubscribeinlinevoidunsubscribe(constuint8_t universe);
inlinevoidunsubscribe();
inlinevoidclear_subscribers();
// ArtPollReply informationvoidshortname(const String& sn);
voidlongname(const String& ln);
voidnodereport(const String& nr);
// othersinlineconst IPAddress& ip() const;
uint16_tport() const;
String id() const;
uint16_topcode() const;
uint16_topcode(constuint8_t* p) const;
uint16_tversion() const;
uint8_tsequence() const;
uint8_tphysical() const;
uint8_tnet() const;
uint8_tsubnet() const;
uint8_tuniverse() const;
uint16_tuniverse15bit() const;
uint16_tlength() const;
uint16_tsize() const;
uint8_t* data();
uint8_tdata(constuint16_t i) const;

Note

Some boards without enough memory (e.g. Uno, Nano, etc.) may not be able to use integrated sender/receiver because of the lack of enough memory. Please consider to use more powerful board or to use only sender OR receiver.

Reference

Embedded Libraries

License

MIT

About

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - gunstr/ArtNet: Art-Net Sender/Receiver for Arduino (Ethernet, WiFi) · GitHub
Skip to content

Latest commit

History

90 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ArtNet

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

This is a fork of ArtNet repository with added support for Industruino.

Below is a copy of the read me from the master repo.

NOTE : BREAKING API CHANGES (v0.2.0 or later)

Feature

  • Art-Net with both Ethernet and WiFi
  • Support a lot of boards which can use Ethernet or WiFi
  • Multiple receiver callbacks depending on universe
  • Mutilple destination streaming with sender
  • One-line send to desired destination
  • Flexible net/subnet/universe setting
  • Easy data forwarding to FastLED

Supported Platforms

WiFi

  • ESP32
  • ESP8266
  • Arduino Uno WiFi Rev2
  • Arduino MKR VIDOR 4000
  • Arduino MKR WiFi 1010
  • Arduino MKR WiFi 1000
  • Arduino Nano 33 IoT

Ethernet

  • Almost all platforms without WiFi

Usage

This library has following Art-Net controller options. Please use them depending on the situation.

  • ArtnetReveiver
  • ArtnetSender
  • Artnet (Integrated Sender/Receiver)

ArtnetReceiver

#include<Artnet.h>
ArtnetReceiver artnet;
voidcallback(constuint8_t* data, constuint16_t size) {
// you can also use pre-defined callbacks
}
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin(); // waiting for Art-Net in default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe1, [](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe(0-15), this function is called
});
artnet.subscribe(universe2, callback); // you can also use pre-defined callbacks
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
}

ArtnetSender

#include<Artnet.h>
ArtnetSender artnet;
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin();
}
voidloop() {
// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet (Integrated Sender/Receiver)

#include<Artnet.h>
Artnet artnet;
voidsetup()
{
// setup Ethernet/WiFi...
artnet.begin(); // send to localhost and listen to default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe, [&](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe, this function is called
});
artnet.subscribe([&](constuint32_t univ, constuint8_t* data, constuint16_t size) {
// if Artnet packet comes, this function is called to every universe
});
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet Receiver + FastLED

#include<Artnet.h>
ArtnetReceiver artnet;
// FastLED
#defineNUM_LEDS1CRGB leds[NUM_LEDS];
constuint8_tPIN_LED_DATA = 3;
voidsetup() {
// setup Ethernet/WiFi...// setup FastLED
FastLED.addLeds<NEOPIXEL, PIN_LED>(&leds, NUM_LEDS);
artnet.begin();
// if Artnet packet comes to this universe, forward them to fastled directly
artnet.forward(universe, leds, NUM_LEDS);
// this can be achieved manually as follows// artnet.subscribe(universe, [](uint8_t* data, uint16_t size)// {// // artnet data size per packet is 512 max// // so there is max 170 pixel per packet (per universe)// for (size_t pixel = 0; pixel < NUM_LEDS; ++pixel)// {// size_t idx = pixel * 3;// leds[pixel].r = data[idx + 0];// leds[pixel].g = data[idx + 1];// leds[pixel].b = data[idx + 2];// }// });
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
FastLED.show();
}

Other Settings

Subscribing Callbacks with Net, Sub-Net and Universe as you like

  • You can set Net (0-127) and Sub-Net (0-15) like artnet.begin(net, subnet)
  • Universe (0-15) can be set in artnet.subscribe(universe, callback),
  • Callbacks are limited to 4 universes (depending on the spec of Art-Net)
artnet.begin(net, subnet); // net and subnet can be set only once
artnet.subscribe(univ1, callback1); // 4 callbacks can be set
artnet.subscribe(univ2, callback2); // these universes are reported to
artnet.subscribe(univ3, callback3); // Art-Net controller if it polls
artnet.subscribe(univ4, callback4); // Art-Net devices

Sending Art-Net to Net, Sub-Net and Universe as you like

One-line sender

artnet.send(ip, univ15bit, data, size); // use 15bit universer or
artnet.send(ip, net, subnet, univ, data, size); // net, subnet, and universe

Streaming

artnet.streaming_data(data, size); // set data first
artnet.streaming(ip, univ15bit); // stream to 15bit universe or
artnet.streaming(ip, net, subnet, univ); // net, subnet, and universe

ArtPollReply Setting

  • This library supports ArtPoll and ArtPollReply
  • ArtPoll is automatically parsed and sends ArtPollReply
  • net_swsub_swsw_in etc. are set automatically based on registerd callbacks
  • You can configure the information of ArtPollReply as follows
    • void shortname(const String& sn)
    • void longname(const String& ln)
    • void nodereport(const String& nr)

APIs

ArtnetSender

// streaming packetvoidstreaming_data(constuint8_t* const data, constuint16_t size);
voidstreaming_data(constuint16_t ch, constuint8_t data);
voidstreaming(const String& ip, constuint32_t universe_);
voidstreaming(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_);
// one-line sendervoidsend(const String& ip, constuint32_t universe_, constuint8_t* const data, constuint16_t size);
voidsend(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_, constuint8_t* const data, constuint16_t size);
// othersvoidphysical(constuint8_t i);
uint8_tsequence() const;

ArtnetReceiver

OpCode parse();
// subscriberstemplate <typename F> inlineautosubscribe(constuint8_t universe, F&& func);
template <typename F> inlineautosubscribe(constuint8_t universe, F* func);
template <typename F> inlineautosubscribe(F&& func);
template <typename F> inlineautosubscribe(F* func);
// for FastLEDinlinevoidforward(constuint8_t universe, CRGB* leds, constuint16_t num);
// unsubscribeinlinevoidunsubscribe(constuint8_t universe);
inlinevoidunsubscribe();
inlinevoidclear_subscribers();
// ArtPollReply informationvoidshortname(const String& sn);
voidlongname(const String& ln);
voidnodereport(const String& nr);
// othersinlineconst IPAddress& ip() const;
uint16_tport() const;
String id() const;
uint16_topcode() const;
uint16_topcode(constuint8_t* p) const;
uint16_tversion() const;
uint8_tsequence() const;
uint8_tphysical() const;
uint8_tnet() const;
uint8_tsubnet() const;
uint8_tuniverse() const;
uint16_tuniverse15bit() const;
uint16_tlength() const;
uint16_tsize() const;
uint8_t* data();
uint8_tdata(constuint16_t i) const;

Note

Some boards without enough memory (e.g. Uno, Nano, etc.) may not be able to use integrated sender/receiver because of the lack of enough memory. Please consider to use more powerful board or to use only sender OR receiver.

Reference

Embedded Libraries

License

MIT

About

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - gunstr/ArtNet: Art-Net Sender/Receiver for Arduino (Ethernet, WiFi) · GitHub
Skip to content

Latest commit

History

90 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ArtNet

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

This is a fork of ArtNet repository with added support for Industruino.

Below is a copy of the read me from the master repo.

NOTE : BREAKING API CHANGES (v0.2.0 or later)

Feature

  • Art-Net with both Ethernet and WiFi
  • Support a lot of boards which can use Ethernet or WiFi
  • Multiple receiver callbacks depending on universe
  • Mutilple destination streaming with sender
  • One-line send to desired destination
  • Flexible net/subnet/universe setting
  • Easy data forwarding to FastLED

Supported Platforms

WiFi

  • ESP32
  • ESP8266
  • Arduino Uno WiFi Rev2
  • Arduino MKR VIDOR 4000
  • Arduino MKR WiFi 1010
  • Arduino MKR WiFi 1000
  • Arduino Nano 33 IoT

Ethernet

  • Almost all platforms without WiFi

Usage

This library has following Art-Net controller options. Please use them depending on the situation.

  • ArtnetReveiver
  • ArtnetSender
  • Artnet (Integrated Sender/Receiver)

ArtnetReceiver

#include<Artnet.h>
ArtnetReceiver artnet;
voidcallback(constuint8_t* data, constuint16_t size) {
// you can also use pre-defined callbacks
}
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin(); // waiting for Art-Net in default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe1, [](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe(0-15), this function is called
});
artnet.subscribe(universe2, callback); // you can also use pre-defined callbacks
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
}

ArtnetSender

#include<Artnet.h>
ArtnetSender artnet;
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin();
}
voidloop() {
// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet (Integrated Sender/Receiver)

#include<Artnet.h>
Artnet artnet;
voidsetup()
{
// setup Ethernet/WiFi...
artnet.begin(); // send to localhost and listen to default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe, [&](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe, this function is called
});
artnet.subscribe([&](constuint32_t univ, constuint8_t* data, constuint16_t size) {
// if Artnet packet comes, this function is called to every universe
});
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet Receiver + FastLED

#include<Artnet.h>
ArtnetReceiver artnet;
// FastLED
#defineNUM_LEDS1CRGB leds[NUM_LEDS];
constuint8_tPIN_LED_DATA = 3;
voidsetup() {
// setup Ethernet/WiFi...// setup FastLED
FastLED.addLeds<NEOPIXEL, PIN_LED>(&leds, NUM_LEDS);
artnet.begin();
// if Artnet packet comes to this universe, forward them to fastled directly
artnet.forward(universe, leds, NUM_LEDS);
// this can be achieved manually as follows// artnet.subscribe(universe, [](uint8_t* data, uint16_t size)// {// // artnet data size per packet is 512 max// // so there is max 170 pixel per packet (per universe)// for (size_t pixel = 0; pixel < NUM_LEDS; ++pixel)// {// size_t idx = pixel * 3;// leds[pixel].r = data[idx + 0];// leds[pixel].g = data[idx + 1];// leds[pixel].b = data[idx + 2];// }// });
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
FastLED.show();
}

Other Settings

Subscribing Callbacks with Net, Sub-Net and Universe as you like

  • You can set Net (0-127) and Sub-Net (0-15) like artnet.begin(net, subnet)
  • Universe (0-15) can be set in artnet.subscribe(universe, callback),
  • Callbacks are limited to 4 universes (depending on the spec of Art-Net)
artnet.begin(net, subnet); // net and subnet can be set only once
artnet.subscribe(univ1, callback1); // 4 callbacks can be set
artnet.subscribe(univ2, callback2); // these universes are reported to
artnet.subscribe(univ3, callback3); // Art-Net controller if it polls
artnet.subscribe(univ4, callback4); // Art-Net devices

Sending Art-Net to Net, Sub-Net and Universe as you like

One-line sender

artnet.send(ip, univ15bit, data, size); // use 15bit universer or
artnet.send(ip, net, subnet, univ, data, size); // net, subnet, and universe

Streaming

artnet.streaming_data(data, size); // set data first
artnet.streaming(ip, univ15bit); // stream to 15bit universe or
artnet.streaming(ip, net, subnet, univ); // net, subnet, and universe

ArtPollReply Setting

  • This library supports ArtPoll and ArtPollReply
  • ArtPoll is automatically parsed and sends ArtPollReply
  • net_swsub_swsw_in etc. are set automatically based on registerd callbacks
  • You can configure the information of ArtPollReply as follows
    • void shortname(const String& sn)
    • void longname(const String& ln)
    • void nodereport(const String& nr)

APIs

ArtnetSender

// streaming packetvoidstreaming_data(constuint8_t* const data, constuint16_t size);
voidstreaming_data(constuint16_t ch, constuint8_t data);
voidstreaming(const String& ip, constuint32_t universe_);
voidstreaming(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_);
// one-line sendervoidsend(const String& ip, constuint32_t universe_, constuint8_t* const data, constuint16_t size);
voidsend(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_, constuint8_t* const data, constuint16_t size);
// othersvoidphysical(constuint8_t i);
uint8_tsequence() const;

ArtnetReceiver

OpCode parse();
// subscriberstemplate <typename F> inlineautosubscribe(constuint8_t universe, F&& func);
template <typename F> inlineautosubscribe(constuint8_t universe, F* func);
template <typename F> inlineautosubscribe(F&& func);
template <typename F> inlineautosubscribe(F* func);
// for FastLEDinlinevoidforward(constuint8_t universe, CRGB* leds, constuint16_t num);
// unsubscribeinlinevoidunsubscribe(constuint8_t universe);
inlinevoidunsubscribe();
inlinevoidclear_subscribers();
// ArtPollReply informationvoidshortname(const String& sn);
voidlongname(const String& ln);
voidnodereport(const String& nr);
// othersinlineconst IPAddress& ip() const;
uint16_tport() const;
String id() const;
uint16_topcode() const;
uint16_topcode(constuint8_t* p) const;
uint16_tversion() const;
uint8_tsequence() const;
uint8_tphysical() const;
uint8_tnet() const;
uint8_tsubnet() const;
uint8_tuniverse() const;
uint16_tuniverse15bit() const;
uint16_tlength() const;
uint16_tsize() const;
uint8_t* data();
uint8_tdata(constuint16_t i) const;

Note

Some boards without enough memory (e.g. Uno, Nano, etc.) may not be able to use integrated sender/receiver because of the lack of enough memory. Please consider to use more powerful board or to use only sender OR receiver.

Reference

Embedded Libraries

License

MIT

About

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - gunstr/ArtNet: Art-Net Sender/Receiver for Arduino (Ethernet, WiFi) · GitHub
Skip to content

Latest commit

History

90 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ArtNet

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

This is a fork of ArtNet repository with added support for Industruino.

Below is a copy of the read me from the master repo.

NOTE : BREAKING API CHANGES (v0.2.0 or later)

Feature

  • Art-Net with both Ethernet and WiFi
  • Support a lot of boards which can use Ethernet or WiFi
  • Multiple receiver callbacks depending on universe
  • Mutilple destination streaming with sender
  • One-line send to desired destination
  • Flexible net/subnet/universe setting
  • Easy data forwarding to FastLED

Supported Platforms

WiFi

  • ESP32
  • ESP8266
  • Arduino Uno WiFi Rev2
  • Arduino MKR VIDOR 4000
  • Arduino MKR WiFi 1010
  • Arduino MKR WiFi 1000
  • Arduino Nano 33 IoT

Ethernet

  • Almost all platforms without WiFi

Usage

This library has following Art-Net controller options. Please use them depending on the situation.

  • ArtnetReveiver
  • ArtnetSender
  • Artnet (Integrated Sender/Receiver)

ArtnetReceiver

#include<Artnet.h>
ArtnetReceiver artnet;
voidcallback(constuint8_t* data, constuint16_t size) {
// you can also use pre-defined callbacks
}
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin(); // waiting for Art-Net in default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe1, [](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe(0-15), this function is called
});
artnet.subscribe(universe2, callback); // you can also use pre-defined callbacks
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
}

ArtnetSender

#include<Artnet.h>
ArtnetSender artnet;
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin();
}
voidloop() {
// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet (Integrated Sender/Receiver)

#include<Artnet.h>
Artnet artnet;
voidsetup()
{
// setup Ethernet/WiFi...
artnet.begin(); // send to localhost and listen to default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe, [&](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe, this function is called
});
artnet.subscribe([&](constuint32_t univ, constuint8_t* data, constuint16_t size) {
// if Artnet packet comes, this function is called to every universe
});
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet Receiver + FastLED

#include<Artnet.h>
ArtnetReceiver artnet;
// FastLED
#defineNUM_LEDS1CRGB leds[NUM_LEDS];
constuint8_tPIN_LED_DATA = 3;
voidsetup() {
// setup Ethernet/WiFi...// setup FastLED
FastLED.addLeds<NEOPIXEL, PIN_LED>(&leds, NUM_LEDS);
artnet.begin();
// if Artnet packet comes to this universe, forward them to fastled directly
artnet.forward(universe, leds, NUM_LEDS);
// this can be achieved manually as follows// artnet.subscribe(universe, [](uint8_t* data, uint16_t size)// {// // artnet data size per packet is 512 max// // so there is max 170 pixel per packet (per universe)// for (size_t pixel = 0; pixel < NUM_LEDS; ++pixel)// {// size_t idx = pixel * 3;// leds[pixel].r = data[idx + 0];// leds[pixel].g = data[idx + 1];// leds[pixel].b = data[idx + 2];// }// });
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
FastLED.show();
}

Other Settings

Subscribing Callbacks with Net, Sub-Net and Universe as you like

  • You can set Net (0-127) and Sub-Net (0-15) like artnet.begin(net, subnet)
  • Universe (0-15) can be set in artnet.subscribe(universe, callback),
  • Callbacks are limited to 4 universes (depending on the spec of Art-Net)
artnet.begin(net, subnet); // net and subnet can be set only once
artnet.subscribe(univ1, callback1); // 4 callbacks can be set
artnet.subscribe(univ2, callback2); // these universes are reported to
artnet.subscribe(univ3, callback3); // Art-Net controller if it polls
artnet.subscribe(univ4, callback4); // Art-Net devices

Sending Art-Net to Net, Sub-Net and Universe as you like

One-line sender

artnet.send(ip, univ15bit, data, size); // use 15bit universer or
artnet.send(ip, net, subnet, univ, data, size); // net, subnet, and universe

Streaming

artnet.streaming_data(data, size); // set data first
artnet.streaming(ip, univ15bit); // stream to 15bit universe or
artnet.streaming(ip, net, subnet, univ); // net, subnet, and universe

ArtPollReply Setting

  • This library supports ArtPoll and ArtPollReply
  • ArtPoll is automatically parsed and sends ArtPollReply
  • net_swsub_swsw_in etc. are set automatically based on registerd callbacks
  • You can configure the information of ArtPollReply as follows
    • void shortname(const String& sn)
    • void longname(const String& ln)
    • void nodereport(const String& nr)

APIs

ArtnetSender

// streaming packetvoidstreaming_data(constuint8_t* const data, constuint16_t size);
voidstreaming_data(constuint16_t ch, constuint8_t data);
voidstreaming(const String& ip, constuint32_t universe_);
voidstreaming(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_);
// one-line sendervoidsend(const String& ip, constuint32_t universe_, constuint8_t* const data, constuint16_t size);
voidsend(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_, constuint8_t* const data, constuint16_t size);
// othersvoidphysical(constuint8_t i);
uint8_tsequence() const;

ArtnetReceiver

OpCode parse();
// subscriberstemplate <typename F> inlineautosubscribe(constuint8_t universe, F&& func);
template <typename F> inlineautosubscribe(constuint8_t universe, F* func);
template <typename F> inlineautosubscribe(F&& func);
template <typename F> inlineautosubscribe(F* func);
// for FastLEDinlinevoidforward(constuint8_t universe, CRGB* leds, constuint16_t num);
// unsubscribeinlinevoidunsubscribe(constuint8_t universe);
inlinevoidunsubscribe();
inlinevoidclear_subscribers();
// ArtPollReply informationvoidshortname(const String& sn);
voidlongname(const String& ln);
voidnodereport(const String& nr);
// othersinlineconst IPAddress& ip() const;
uint16_tport() const;
String id() const;
uint16_topcode() const;
uint16_topcode(constuint8_t* p) const;
uint16_tversion() const;
uint8_tsequence() const;
uint8_tphysical() const;
uint8_tnet() const;
uint8_tsubnet() const;
uint8_tuniverse() const;
uint16_tuniverse15bit() const;
uint16_tlength() const;
uint16_tsize() const;
uint8_t* data();
uint8_tdata(constuint16_t i) const;

Note

Some boards without enough memory (e.g. Uno, Nano, etc.) may not be able to use integrated sender/receiver because of the lack of enough memory. Please consider to use more powerful board or to use only sender OR receiver.

Reference

Embedded Libraries

License

MIT

About

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - gunstr/ArtNet: Art-Net Sender/Receiver for Arduino (Ethernet, WiFi) · GitHub
Skip to content

Latest commit

History

90 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ArtNet

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

This is a fork of ArtNet repository with added support for Industruino.

Below is a copy of the read me from the master repo.

NOTE : BREAKING API CHANGES (v0.2.0 or later)

Feature

  • Art-Net with both Ethernet and WiFi
  • Support a lot of boards which can use Ethernet or WiFi
  • Multiple receiver callbacks depending on universe
  • Mutilple destination streaming with sender
  • One-line send to desired destination
  • Flexible net/subnet/universe setting
  • Easy data forwarding to FastLED

Supported Platforms

WiFi

  • ESP32
  • ESP8266
  • Arduino Uno WiFi Rev2
  • Arduino MKR VIDOR 4000
  • Arduino MKR WiFi 1010
  • Arduino MKR WiFi 1000
  • Arduino Nano 33 IoT

Ethernet

  • Almost all platforms without WiFi

Usage

This library has following Art-Net controller options. Please use them depending on the situation.

  • ArtnetReveiver
  • ArtnetSender
  • Artnet (Integrated Sender/Receiver)

ArtnetReceiver

#include<Artnet.h>
ArtnetReceiver artnet;
voidcallback(constuint8_t* data, constuint16_t size) {
// you can also use pre-defined callbacks
}
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin(); // waiting for Art-Net in default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe1, [](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe(0-15), this function is called
});
artnet.subscribe(universe2, callback); // you can also use pre-defined callbacks
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
}

ArtnetSender

#include<Artnet.h>
ArtnetSender artnet;
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin();
}
voidloop() {
// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet (Integrated Sender/Receiver)

#include<Artnet.h>
Artnet artnet;
voidsetup()
{
// setup Ethernet/WiFi...
artnet.begin(); // send to localhost and listen to default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe, [&](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe, this function is called
});
artnet.subscribe([&](constuint32_t univ, constuint8_t* data, constuint16_t size) {
// if Artnet packet comes, this function is called to every universe
});
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet Receiver + FastLED

#include<Artnet.h>
ArtnetReceiver artnet;
// FastLED
#defineNUM_LEDS1CRGB leds[NUM_LEDS];
constuint8_tPIN_LED_DATA = 3;
voidsetup() {
// setup Ethernet/WiFi...// setup FastLED
FastLED.addLeds<NEOPIXEL, PIN_LED>(&leds, NUM_LEDS);
artnet.begin();
// if Artnet packet comes to this universe, forward them to fastled directly
artnet.forward(universe, leds, NUM_LEDS);
// this can be achieved manually as follows// artnet.subscribe(universe, [](uint8_t* data, uint16_t size)// {// // artnet data size per packet is 512 max// // so there is max 170 pixel per packet (per universe)// for (size_t pixel = 0; pixel < NUM_LEDS; ++pixel)// {// size_t idx = pixel * 3;// leds[pixel].r = data[idx + 0];// leds[pixel].g = data[idx + 1];// leds[pixel].b = data[idx + 2];// }// });
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
FastLED.show();
}

Other Settings

Subscribing Callbacks with Net, Sub-Net and Universe as you like

  • You can set Net (0-127) and Sub-Net (0-15) like artnet.begin(net, subnet)
  • Universe (0-15) can be set in artnet.subscribe(universe, callback),
  • Callbacks are limited to 4 universes (depending on the spec of Art-Net)
artnet.begin(net, subnet); // net and subnet can be set only once
artnet.subscribe(univ1, callback1); // 4 callbacks can be set
artnet.subscribe(univ2, callback2); // these universes are reported to
artnet.subscribe(univ3, callback3); // Art-Net controller if it polls
artnet.subscribe(univ4, callback4); // Art-Net devices

Sending Art-Net to Net, Sub-Net and Universe as you like

One-line sender

artnet.send(ip, univ15bit, data, size); // use 15bit universer or
artnet.send(ip, net, subnet, univ, data, size); // net, subnet, and universe

Streaming

artnet.streaming_data(data, size); // set data first
artnet.streaming(ip, univ15bit); // stream to 15bit universe or
artnet.streaming(ip, net, subnet, univ); // net, subnet, and universe

ArtPollReply Setting

  • This library supports ArtPoll and ArtPollReply
  • ArtPoll is automatically parsed and sends ArtPollReply
  • net_swsub_swsw_in etc. are set automatically based on registerd callbacks
  • You can configure the information of ArtPollReply as follows
    • void shortname(const String& sn)
    • void longname(const String& ln)
    • void nodereport(const String& nr)

APIs

ArtnetSender

// streaming packetvoidstreaming_data(constuint8_t* const data, constuint16_t size);
voidstreaming_data(constuint16_t ch, constuint8_t data);
voidstreaming(const String& ip, constuint32_t universe_);
voidstreaming(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_);
// one-line sendervoidsend(const String& ip, constuint32_t universe_, constuint8_t* const data, constuint16_t size);
voidsend(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_, constuint8_t* const data, constuint16_t size);
// othersvoidphysical(constuint8_t i);
uint8_tsequence() const;

ArtnetReceiver

OpCode parse();
// subscriberstemplate <typename F> inlineautosubscribe(constuint8_t universe, F&& func);
template <typename F> inlineautosubscribe(constuint8_t universe, F* func);
template <typename F> inlineautosubscribe(F&& func);
template <typename F> inlineautosubscribe(F* func);
// for FastLEDinlinevoidforward(constuint8_t universe, CRGB* leds, constuint16_t num);
// unsubscribeinlinevoidunsubscribe(constuint8_t universe);
inlinevoidunsubscribe();
inlinevoidclear_subscribers();
// ArtPollReply informationvoidshortname(const String& sn);
voidlongname(const String& ln);
voidnodereport(const String& nr);
// othersinlineconst IPAddress& ip() const;
uint16_tport() const;
String id() const;
uint16_topcode() const;
uint16_topcode(constuint8_t* p) const;
uint16_tversion() const;
uint8_tsequence() const;
uint8_tphysical() const;
uint8_tnet() const;
uint8_tsubnet() const;
uint8_tuniverse() const;
uint16_tuniverse15bit() const;
uint16_tlength() const;
uint16_tsize() const;
uint8_t* data();
uint8_tdata(constuint16_t i) const;

Note

Some boards without enough memory (e.g. Uno, Nano, etc.) may not be able to use integrated sender/receiver because of the lack of enough memory. Please consider to use more powerful board or to use only sender OR receiver.

Reference

Embedded Libraries

License

MIT

About

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); GitHub - gunstr/ArtNet: Art-Net Sender/Receiver for Arduino (Ethernet, WiFi) · GitHub
Skip to content

Latest commit

History

90 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ArtNet

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

This is a fork of ArtNet repository with added support for Industruino.

Below is a copy of the read me from the master repo.

NOTE : BREAKING API CHANGES (v0.2.0 or later)

Feature

  • Art-Net with both Ethernet and WiFi
  • Support a lot of boards which can use Ethernet or WiFi
  • Multiple receiver callbacks depending on universe
  • Mutilple destination streaming with sender
  • One-line send to desired destination
  • Flexible net/subnet/universe setting
  • Easy data forwarding to FastLED

Supported Platforms

WiFi

  • ESP32
  • ESP8266
  • Arduino Uno WiFi Rev2
  • Arduino MKR VIDOR 4000
  • Arduino MKR WiFi 1010
  • Arduino MKR WiFi 1000
  • Arduino Nano 33 IoT

Ethernet

  • Almost all platforms without WiFi

Usage

This library has following Art-Net controller options. Please use them depending on the situation.

  • ArtnetReveiver
  • ArtnetSender
  • Artnet (Integrated Sender/Receiver)

ArtnetReceiver

#include<Artnet.h>
ArtnetReceiver artnet;
voidcallback(constuint8_t* data, constuint16_t size) {
// you can also use pre-defined callbacks
}
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin(); // waiting for Art-Net in default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe1, [](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe(0-15), this function is called
});
artnet.subscribe(universe2, callback); // you can also use pre-defined callbacks
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
}

ArtnetSender

#include<Artnet.h>
ArtnetSender artnet;
voidsetup() {
// setup Ethernet/WiFi...
artnet.begin();
}
voidloop() {
// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet (Integrated Sender/Receiver)

#include<Artnet.h>
Artnet artnet;
voidsetup()
{
// setup Ethernet/WiFi...
artnet.begin(); // send to localhost and listen to default port// artnet.begin(net, subnet); // optionally you can set net and subnet here
artnet.subscribe(universe, [&](constuint8_t* data, constuint16_t size) {
// if Artnet packet comes to this universe, this function is called
});
artnet.subscribe([&](constuint32_t univ, constuint8_t* data, constuint16_t size) {
// if Artnet packet comes, this function is called to every universe
});
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback// change send data as you want
artnet.send("127.0.0.1", universe15bit, data_ptr, size); // one-line send// artnet.send("127.0.0.1", net, subnet, univ, data_ptr, size); // or you can set net and subnet
artnet.streaming_data(data_ptr, size);
artnet.streaming("127.0.0.1", universe15bit); // automatically send set data in 40fps (15bit universe)// artnet.streaming("127.0.0.1", net, subnet, univ); // or you can set net and subnet here
}

Artnet Receiver + FastLED

#include<Artnet.h>
ArtnetReceiver artnet;
// FastLED
#defineNUM_LEDS1CRGB leds[NUM_LEDS];
constuint8_tPIN_LED_DATA = 3;
voidsetup() {
// setup Ethernet/WiFi...// setup FastLED
FastLED.addLeds<NEOPIXEL, PIN_LED>(&leds, NUM_LEDS);
artnet.begin();
// if Artnet packet comes to this universe, forward them to fastled directly
artnet.forward(universe, leds, NUM_LEDS);
// this can be achieved manually as follows// artnet.subscribe(universe, [](uint8_t* data, uint16_t size)// {// // artnet data size per packet is 512 max// // so there is max 170 pixel per packet (per universe)// for (size_t pixel = 0; pixel < NUM_LEDS; ++pixel)// {// size_t idx = pixel * 3;// leds[pixel].r = data[idx + 0];// leds[pixel].g = data[idx + 1];// leds[pixel].b = data[idx + 2];// }// });
}
voidloop() {
artnet.parse(); // check if artnet packet has come and execute callback
FastLED.show();
}

Other Settings

Subscribing Callbacks with Net, Sub-Net and Universe as you like

  • You can set Net (0-127) and Sub-Net (0-15) like artnet.begin(net, subnet)
  • Universe (0-15) can be set in artnet.subscribe(universe, callback),
  • Callbacks are limited to 4 universes (depending on the spec of Art-Net)
artnet.begin(net, subnet); // net and subnet can be set only once
artnet.subscribe(univ1, callback1); // 4 callbacks can be set
artnet.subscribe(univ2, callback2); // these universes are reported to
artnet.subscribe(univ3, callback3); // Art-Net controller if it polls
artnet.subscribe(univ4, callback4); // Art-Net devices

Sending Art-Net to Net, Sub-Net and Universe as you like

One-line sender

artnet.send(ip, univ15bit, data, size); // use 15bit universer or
artnet.send(ip, net, subnet, univ, data, size); // net, subnet, and universe

Streaming

artnet.streaming_data(data, size); // set data first
artnet.streaming(ip, univ15bit); // stream to 15bit universe or
artnet.streaming(ip, net, subnet, univ); // net, subnet, and universe

ArtPollReply Setting

  • This library supports ArtPoll and ArtPollReply
  • ArtPoll is automatically parsed and sends ArtPollReply
  • net_swsub_swsw_in etc. are set automatically based on registerd callbacks
  • You can configure the information of ArtPollReply as follows
    • void shortname(const String& sn)
    • void longname(const String& ln)
    • void nodereport(const String& nr)

APIs

ArtnetSender

// streaming packetvoidstreaming_data(constuint8_t* const data, constuint16_t size);
voidstreaming_data(constuint16_t ch, constuint8_t data);
voidstreaming(const String& ip, constuint32_t universe_);
voidstreaming(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_);
// one-line sendervoidsend(const String& ip, constuint32_t universe_, constuint8_t* const data, constuint16_t size);
voidsend(const String& ip, constuint8_t net_, constuint8_t subnet_, constuint8_t universe_, constuint8_t* const data, constuint16_t size);
// othersvoidphysical(constuint8_t i);
uint8_tsequence() const;

ArtnetReceiver

OpCode parse();
// subscriberstemplate <typename F> inlineautosubscribe(constuint8_t universe, F&& func);
template <typename F> inlineautosubscribe(constuint8_t universe, F* func);
template <typename F> inlineautosubscribe(F&& func);
template <typename F> inlineautosubscribe(F* func);
// for FastLEDinlinevoidforward(constuint8_t universe, CRGB* leds, constuint16_t num);
// unsubscribeinlinevoidunsubscribe(constuint8_t universe);
inlinevoidunsubscribe();
inlinevoidclear_subscribers();
// ArtPollReply informationvoidshortname(const String& sn);
voidlongname(const String& ln);
voidnodereport(const String& nr);
// othersinlineconst IPAddress& ip() const;
uint16_tport() const;
String id() const;
uint16_topcode() const;
uint16_topcode(constuint8_t* p) const;
uint16_tversion() const;
uint8_tsequence() const;
uint8_tphysical() const;
uint8_tnet() const;
uint8_tsubnet() const;
uint8_tuniverse() const;
uint16_tuniverse15bit() const;
uint16_tlength() const;
uint16_tsize() const;
uint8_t* data();
uint8_tdata(constuint16_t i) const;

Note

Some boards without enough memory (e.g. Uno, Nano, etc.) may not be able to use integrated sender/receiver because of the lack of enough memory. Please consider to use more powerful board or to use only sender OR receiver.

Reference

Embedded Libraries

License

MIT

About

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages