From 70f69667e882ef2714d760a1324588b06ecdc99d Mon Sep 17 00:00:00 2001 From: Mr Frangipane Date: Fri, 5 Jan 2024 16:18:33 +0100 Subject: [PATCH 01/22] Create ArtnetEtherENC.h Allows to use https://github.com/JAndrassy/EthernetENC --- ArtnetEtherENC.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 ArtnetEtherENC.h diff --git a/ArtnetEtherENC.h b/ArtnetEtherENC.h new file mode 100644 index 0000000..8de9e82 --- /dev/null +++ b/ArtnetEtherENC.h @@ -0,0 +1,19 @@ +#pragma once +#ifndef ARTNET_ETHER_H +#define ARTNET_ETHER_H + +#define ARTNET_ENABLE_ETHER + +#include +#include +#include +#include +#include +#include "Artnet/util/TeensyDirtySTLErrorSolution/TeensyDirtySTLErrorSolution.h" +#include "Artnet/Manager.h" + +using Artnet = art_net::Manager; +using ArtnetSender = art_net::Sender; +using ArtnetReceiver = art_net::Receiver; + +#endif // ARTNET_ETHER_H From 0121a643a2a48558c333381ca7a0431af3440f01 Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Fri, 5 Jan 2024 16:44:41 +0100 Subject: [PATCH 02/22] fix mac address error when using EthernetENC --- Artnet/Receiver.h | 2 +- ArtnetEtherENC.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Artnet/Receiver.h b/Artnet/Receiver.h index 3b89372..b75a104 100644 --- a/Artnet/Receiver.h +++ b/Artnet/Receiver.h @@ -319,7 +319,7 @@ class Receiver_ { } template auto macAddress(uint8_t* mac) -> std::enable_if_t::value> { -#ifndef ESP8266 +#if !defined(ESP8266) && !defined(ARTNET_ETHER_IS_ENC28J60) Ethernet.MACAddress(mac); #endif } diff --git a/ArtnetEtherENC.h b/ArtnetEtherENC.h index 8de9e82..c5f5fbd 100644 --- a/ArtnetEtherENC.h +++ b/ArtnetEtherENC.h @@ -3,6 +3,7 @@ #define ARTNET_ETHER_H #define ARTNET_ENABLE_ETHER +#define ARTNET_ETHER_IS_ENC28J60 #include #include From a5aa0dd9e02e11c7606ab1a078ab9aa6d956e558 Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Mon, 8 Jan 2024 11:48:18 +0100 Subject: [PATCH 03/22] try to add examples and workflows --- .github/workflows/build.yml | 33 + README.md | 14 + .../receive_fastled/receive_fastled.ino | 50 + examples/EthernetENC/receiver/receiver.ino | 44 + .../EthernetENC/send_receive/send_receive.ino | 62 + examples/EthernetENC/sender/sender.ino | 37 + pi-pico-enc28j60-wiring.svg | 4883 +++++++++++++++++ 7 files changed, 5123 insertions(+) create mode 100644 examples/EthernetENC/receive_fastled/receive_fastled.ino create mode 100644 examples/EthernetENC/receiver/receiver.ino create mode 100644 examples/EthernetENC/send_receive/send_receive.ino create mode 100644 examples/EthernetENC/sender/sender.ino create mode 100644 pi-pico-enc28j60-wiring.svg diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7acdf24..dfd8ba4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -240,3 +240,36 @@ jobs: - name: ArxTypeTraits - name: FastLED verbose: true + build-etherenc: + name: "Build Test (EtherENC): ${{matrix.board.arch}}:${{matrix.board.name}}" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + board: + - vendor: rp2040 + arch: rp2040 + name: rpipico + include: + - index: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json + board: + vendor: rp2040 + steps: + - uses: actions/checkout@v4 + - name: compile example sketchs + uses: arduino/compile-sketches@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + fqbn: ${{matrix.board.vendor}}:${{matrix.board.arch}}:${{matrix.board.name}} + platforms: | + - name: ${{matrix.board.vendor}}:${{matrix.board.arch}} + source-url: ${{matrix.index}} + sketch-paths: | + - examples/EthernetENC + libraries: | + - source-path: ./ + - name: ArxContainer + - name: ArxTypeTraits + - name: FastLED + - name: EthernetENC + verbose: true diff --git a/README.md b/README.md index d20bfb2..a4a5f9e 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,9 @@ If you have already installed this library, please follow: - ESP32 (Ethernet and ETH) - ESP8266 - Almost all platforms without WiFi +- Raspberry Pi Pico with ENC28J60 (please read [Raspberry Pi Pico + ENC28J60](#raspberry-pi-pico-+-enc28j60)) + +https://github.com/Juddling/pi-pico-enc28j60 ## Usage @@ -319,6 +322,17 @@ uint8_t data(const uint16_t i) const; 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. +#### Raspberry Pi Pico + ENC28J60 + +When using the ENC28J60 controller with Raspberry Pi Pico (no wifi) + +- make sure to install the [EthernetENC](https://github.com/JAndrassy/EthernetENC)) library +- simply replace `#include ` with `#include ` + +![Wiring Diagram](/pi-pico-enc28j60-wiring.svg) + +Default wiring diagram provided by [@tobiasvogel](https://github.com/tobiasvogel) + ## Reference - [Spec (Art-Net 4)](http://artisticlicence.com/WebSiteMaster/User%20Guides/art-net.pdf) diff --git a/examples/EthernetENC/receive_fastled/receive_fastled.ino b/examples/EthernetENC/receive_fastled/receive_fastled.ino new file mode 100644 index 0000000..978754e --- /dev/null +++ b/examples/EthernetENC/receive_fastled/receive_fastled.ino @@ -0,0 +1,50 @@ +#include // include FastLED *before* Artnet +#include + + +// Ethernet stuff +const IPAddress ip(192, 168, 0, 201); +uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; + +ArtnetReceiver artnet; +uint8_t universe = 1; // 0 - 15 + +// FastLED +#define NUM_LEDS 1 +CRGB leds[NUM_LEDS]; +const uint8_t PIN_LED_DATA = 3; + +void setup() { + Serial.begin(115200); + delay(2000); + + FastLED.addLeds(leds, NUM_LEDS); + + Ethernet.begin(mac, ip); + artnet.begin(); + // artnet.subscribe_net(0); // optionally you can change + // artnet.subscribe_subnet(0); // optionally you can change + + // 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 + // if Artnet packet comes to this universe, this function is called + // artnet.subscribe(universe, [&](const uint8_t* data, const uint16_t size) + // { + // // set led + // // 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) { + // const size_t idx = pixel * 3; + // leds[pixel].r = data[idx + 0]; + // leds[pixel].g = data[idx + 1]; + // leds[pixel].b = data[idx + 2]; + // } + // }); +} + +void loop() { + artnet.parse(); // check if artnet packet has come and execute callback + FastLED.show(); +} diff --git a/examples/EthernetENC/receiver/receiver.ino b/examples/EthernetENC/receiver/receiver.ino new file mode 100644 index 0000000..784d9a7 --- /dev/null +++ b/examples/EthernetENC/receiver/receiver.ino @@ -0,0 +1,44 @@ +#include + + +// Ethernet stuff +const IPAddress ip(192, 168, 0, 201); +uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; + +ArtnetReceiver artnet; +uint32_t universe1 = 1; // 0 - 15 +uint32_t universe2 = 2; // 0 - 15 + +void callback(const uint8_t* data, const uint16_t size) { + // you can also use pre-defined callbacks +} + +void setup() { + Serial.begin(115200); + + Ethernet.begin(mac, ip); + artnet.begin(); + // artnet.subscribe_net(0); // optionally you can change + // artnet.subscribe_subnet(0); // optionally you can change + + // if Artnet packet comes to this universe, this function is called + artnet.subscribe(universe1, [&](const uint8_t* data, const uint16_t size) { + Serial.print("artnet data (universe : "); + Serial.print(universe1); + Serial.print(", size = "); + Serial.print(size); + Serial.print(") :"); + for (size_t i = 0; i < size; ++i) { + Serial.print(data[i]); + Serial.print(","); + } + Serial.println(); + }); + + // you can also use pre-defined callbacks + artnet.subscribe(universe2, callback); +} + +void loop() { + artnet.parse(); // check if artnet packet has come and execute callback +} diff --git a/examples/EthernetENC/send_receive/send_receive.ino b/examples/EthernetENC/send_receive/send_receive.ino new file mode 100644 index 0000000..259e68b --- /dev/null +++ b/examples/EthernetENC/send_receive/send_receive.ino @@ -0,0 +1,62 @@ +#ifdef __AVR__ +#warning THIS EXAMPLE MAY USE TOO MUCH MEMORY FOR AVR. WE RECOMMEND TO USE SENDER OR RECEIVER ONLY. +#endif + +#include + + +// Ethernet stuff +const IPAddress ip(192, 168, 0, 201); +uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; + +Artnet artnet; +const String target_ip = "192.168.0.200"; +uint8_t universe = 1; // 0 - 15 + +const uint16_t size = 512; +uint8_t data[size]; +uint8_t value = 0; + +void setup() { + Serial.begin(115200); + delay(2000); + + Ethernet.begin(mac, ip); + artnet.begin(); + // artnet.begin(net, subnet); // optionally you can change + + Serial.println("set subscriber"); + + // if Artnet packet comes to this universe, this function is called + artnet.subscribe(universe, [](const uint8_t* data, const uint16_t size) { + Serial.print("artnet data (universe : "); + Serial.print(universe); + Serial.print(", size = "); + Serial.print(size); + Serial.print(") :"); + for (size_t i = 0; i < size; ++i) { + Serial.print(data[i]); + Serial.print(","); + } + Serial.println(); + }); + + // if Artnet packet comes, this function is called to every universe + artnet.subscribe([&](const uint32_t univ, const uint8_t* data, const uint16_t size) { + Serial.print("ArtNet data has come to universe: "); + Serial.println(univ); + }); + + Serial.println("start"); +} + +void loop() { + artnet.parse(); // check if artnet packet has come and execute callback + + value = (millis() / 4) % 256; + memset(data, value, size); + + artnet.streaming_data(data, size); + artnet.streaming(target_ip, universe); // automatically send set data in 40fps + // artnet.streaming(target_ip, net, subnet, univ); // or you can set net, subnet, and universe +} diff --git a/examples/EthernetENC/sender/sender.ino b/examples/EthernetENC/sender/sender.ino new file mode 100644 index 0000000..77781a1 --- /dev/null +++ b/examples/EthernetENC/sender/sender.ino @@ -0,0 +1,37 @@ +#include + + +// Ethernet stuff +const IPAddress ip(192, 168, 0, 201); +uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; + +ArtnetSender artnet; +const String target_ip = "192.168.0.200"; +uint32_t universe = 1; + +const uint16_t size = 512; +uint8_t data[size]; +uint8_t value = 0; + +void setup() { + Serial.begin(115200); + delay(2000); + + Ethernet.begin(mac, ip); + artnet.begin(); + // artnet.begin(net, subnet); // optionally you can change + + Serial.println("start"); +#ifdef UDP_TX_PACKET_MAX_SIZE + Serial.println(UDP_TX_PACKET_MAX_SIZE); +#endif +} + +void loop() { + value = (millis() / 4) % 256; + memset(data, value, size); + + artnet.streaming_data(data, size); + artnet.streaming(target_ip, universe); // automatically send set data in 40fps + // artnet.streaming(target_ip, net, subnet, univ); // or you can set net, subnet, and universe +} diff --git a/pi-pico-enc28j60-wiring.svg b/pi-pico-enc28j60-wiring.svg new file mode 100644 index 0000000..93aa388 --- /dev/null +++ b/pi-pico-enc28j60-wiring.svg @@ -0,0 +1,4883 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CLKOUT + WOL + SI + CS + VCC + + + + + + + + + INT + SO + SCK + RESET + GND + + + + + + + + + + + + 16.000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + D + + + E + + + B + + + U + + + G + + + B + + + O + + + O + + + T + + + S + + + E + + + L + + + L + + + E + + + D + + + 1 + + + 2 + + + 3 + + + 9 + + + U + + + S + + + B + + + + R + + + a + + + s + + + p + + + b + + + e + + + r + + + r + + + y + + + + + + P + + + i + + + + + + P + + + i + + + c + + + o + + + + + + © + + + 2 + + + 0 + + + 2 + + + 0 + + + R + + + P + + + 2 + + + - + + + 8 + + + 0 + + + + + + + + + + + + + + + 2 + + + 0 + + + / + + + 2 + + + 1 + + + P + + + 6 + + + 4 + + + M + + + 1 + + + 5 + + + . + + + 0 + + + 0 + + + + + + T + + + T + + + T + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GND (Pin 38) + + + + + + + white + + + + + + + GND + + + + + + + + + 3V3 Out (Pin 36) + + + + + + + gray + + + + + + + VCC + + + + + + + + + GP19/SPI0 TX (Pin 25) + + + + + + + SI + + + + + + + blue + + + + + + + + + GP18/SPI0 SCK (Pin 24) + + + + + + + SCK + + + + + + + yellow + + + + + + + + + GP17/SPI0 CSn (Pin 22) + + + + + + + green + + + + + + + CS + + + + + + + + + GP16/SPI0 RX (Pin 21) + + + + + + + SO + + + + + + + orange + + + + + + + + ENC28J60 + + + + + + + Pi Pico + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 67d4d45942c5433dc51e6aa56817fa3ab8a3b1e4 Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Mon, 8 Jan 2024 11:51:23 +0100 Subject: [PATCH 04/22] fix readme --- README.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a4a5f9e..f7b3be6 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,16 @@ If you have already installed this library, please follow: - Almost all platforms without WiFi - Raspberry Pi Pico with ENC28J60 (please read [Raspberry Pi Pico + ENC28J60](#raspberry-pi-pico-+-enc28j60)) -https://github.com/Juddling/pi-pico-enc28j60 +##### Raspberry Pi Pico + ENC28J60 + +When using the ENC28J60 controller with Raspberry Pi Pico (no wifi) + +- make sure to install the [EthernetENC](https://github.com/JAndrassy/EthernetENC)) library +- simply replace `#include ` with `#include ` + +![Wiring Diagram](/pi-pico-enc28j60-wiring.svg) + +Default wiring diagram provided by [@tobiasvogel](https://github.com/tobiasvogel) ## Usage @@ -322,17 +331,6 @@ uint8_t data(const uint16_t i) const; 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. -#### Raspberry Pi Pico + ENC28J60 - -When using the ENC28J60 controller with Raspberry Pi Pico (no wifi) - -- make sure to install the [EthernetENC](https://github.com/JAndrassy/EthernetENC)) library -- simply replace `#include ` with `#include ` - -![Wiring Diagram](/pi-pico-enc28j60-wiring.svg) - -Default wiring diagram provided by [@tobiasvogel](https://github.com/tobiasvogel) - ## Reference - [Spec (Art-Net 4)](http://artisticlicence.com/WebSiteMaster/User%20Guides/art-net.pdf) From dd1b268ed6ce4aebd4b201d60c1ad03ee3923780 Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Mon, 8 Jan 2024 11:52:21 +0100 Subject: [PATCH 05/22] fix readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f7b3be6..92e0f7b 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ If you have already installed this library, please follow: - ESP32 (Ethernet and ETH) - ESP8266 - Almost all platforms without WiFi -- Raspberry Pi Pico with ENC28J60 (please read [Raspberry Pi Pico + ENC28J60](#raspberry-pi-pico-+-enc28j60)) +- Raspberry Pi Pico with ENC28J60 (please read following section) ##### Raspberry Pi Pico + ENC28J60 From 5c82eecd1804a3415b1e776d66804f76c458c4b3 Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Mon, 8 Jan 2024 11:53:06 +0100 Subject: [PATCH 06/22] fix readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 92e0f7b..0c0372b 100644 --- a/README.md +++ b/README.md @@ -47,13 +47,13 @@ If you have already installed this library, please follow: When using the ENC28J60 controller with Raspberry Pi Pico (no wifi) -- make sure to install the [EthernetENC](https://github.com/JAndrassy/EthernetENC)) library +- make sure to install the [EthernetENC](https://github.com/JAndrassy/EthernetENC) library - simply replace `#include ` with `#include ` -![Wiring Diagram](/pi-pico-enc28j60-wiring.svg) - Default wiring diagram provided by [@tobiasvogel](https://github.com/tobiasvogel) +![Wiring Diagram](/pi-pico-enc28j60-wiring.svg) + ## Usage This library has following Art-Net controller options. From 9312719de2417e6f63b9bae8106138e133fdf088 Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Mon, 8 Jan 2024 11:57:21 +0100 Subject: [PATCH 07/22] make notes about ENC28J60 collapsible/exandable --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c0372b..1d8aa13 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,8 @@ If you have already installed this library, please follow: - Almost all platforms without WiFi - Raspberry Pi Pico with ENC28J60 (please read following section) -##### Raspberry Pi Pico + ENC28J60 +
+ Notes for Raspberry Pi Pico with ENC28J60 (click to expand) When using the ENC28J60 controller with Raspberry Pi Pico (no wifi) @@ -53,6 +54,7 @@ When using the ENC28J60 controller with Raspberry Pi Pico (no wifi) Default wiring diagram provided by [@tobiasvogel](https://github.com/tobiasvogel) ![Wiring Diagram](/pi-pico-enc28j60-wiring.svg) +
## Usage From d89e9ec6a39caa8d8f5511e98ed903ddf0f219f3 Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Mon, 8 Jan 2024 15:56:13 +0100 Subject: [PATCH 08/22] modify build for ENC28J60 to support any platform + fix readme --- .github/workflows/build.yml | 43 +++++++++++++++++++++++++++++++++++-- README.md | 15 +++++-------- 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfd8ba4..88aadb1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -242,15 +242,54 @@ jobs: verbose: true build-etherenc: name: "Build Test (EtherENC): ${{matrix.board.arch}}:${{matrix.board.name}}" - runs-on: ubuntu-latest + runs-on: ubuntu-latest strategy: fail-fast: false matrix: board: + - vendor: arduino + arch: avr + name: uno + - vendor: arduino + arch: megaavr + name: uno2018 + - vendor: arduino + arch: samd + name: mkrvidor4000 + - vendor: arduino + arch: samd + name: mkrwifi1010 + - vendor: arduino + arch: samd + name: mkr1000 + - vendor: arduino + arch: samd + name: nano_33_iot + - vendor: esp8266 + arch: esp8266 + name: generic + - vendor: esp32 + arch: esp32 + name: esp32 + - vendor: esp32 + arch: esp32 + name: esp32s3 + - vendor: esp32 + arch: esp32 + name: esp32c3 - vendor: rp2040 arch: rp2040 - name: rpipico + name: rpipicow include: + - index: https://downloads.arduino.cc/packages/package_index.json + board: + vendor: arduino + - index: https://arduino.esp8266.com/stable/package_esp8266com_index.json + board: + vendor: esp8266 + - index: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json + board: + vendor: esp32 - index: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json board: vendor: rp2040 diff --git a/README.md b/README.md index 1d8aa13..a3f7011 100644 --- a/README.md +++ b/README.md @@ -41,19 +41,15 @@ If you have already installed this library, please follow: - ESP32 (Ethernet and ETH) - ESP8266 - Almost all platforms without WiFi -- Raspberry Pi Pico with ENC28J60 (please read following section) +- Anyplatform supported by ENC28J60 (please read following section)
- Notes for Raspberry Pi Pico with ENC28J60 (click to expand) + Notes for ENC28J60 ethernet controller (click to expand) -When using the ENC28J60 controller with Raspberry Pi Pico (no wifi) +When using the ENC28J60 controller - make sure to install the [EthernetENC](https://github.com/JAndrassy/EthernetENC) library - simply replace `#include ` with `#include ` - -Default wiring diagram provided by [@tobiasvogel](https://github.com/tobiasvogel) - -![Wiring Diagram](/pi-pico-enc28j60-wiring.svg)
## Usage @@ -215,12 +211,11 @@ void loop() { - 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) - These universes (targets of the callbacks) are reflected to `net_sw` `sub_sw` `sw_in` in `ArtPollreply` automatically ```C++ artnet.begin(net, subnet); // net and subnet can be set only once -artnet.subscribe(univ1, callback1); // 4 callbacks can be set +artnet.subscribe(univ1, callback1); // 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 @@ -229,7 +224,7 @@ artnet.subscribe(univ4, callback4); // Art-Net devices Or you can register callbacks based on 15 bit universe. But these universes are not reflected to `ArtPollReply` automatically. ```C++ -artnet.subscribe15bit(univ15bit1, callback1); // 4 callbacks can be set +artnet.subscribe15bit(univ15bit1, callback1); // callbacks can be set artnet.subscribe15bit(univ15bit2, callback2); // these universes are NOT reported to artnet.subscribe15bit(univ15bit3, callback3); // Art-Net controller if it polls artnet.subscribe15bit(univ15bit4, callback4); // Art-Net devices From 519fa04731e77caec13904638ed9bb16f702ca17 Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Mon, 8 Jan 2024 16:06:16 +0100 Subject: [PATCH 09/22] fix build tabulation --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88aadb1..0867a19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -242,7 +242,7 @@ jobs: verbose: true build-etherenc: name: "Build Test (EtherENC): ${{matrix.board.arch}}:${{matrix.board.name}}" - runs-on: ubuntu-latest + runs-on: ubuntu-latest strategy: fail-fast: false matrix: From b4df2244faa6df0d9837bcf8c3ecfa981039d0bf Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Mon, 8 Jan 2024 23:27:17 +0100 Subject: [PATCH 10/22] add explanation for 4 callacks limitation --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a3f7011..5210655 100644 --- a/README.md +++ b/README.md @@ -213,6 +213,8 @@ void loop() { - Universe (0-15) can be set in `artnet.subscribe(universe, callback)`, - These universes (targets of the callbacks) are reflected to `net_sw` `sub_sw` `sw_in` in `ArtPollreply` automatically +PortTypes, GoodInput/Output, SwIn, etc., are limited to 4 ports. If more than 4 callbacks are needed, it is better to subscribe to more than four and make public 4 of them + ```C++ artnet.begin(net, subnet); // net and subnet can be set only once artnet.subscribe(univ1, callback1); // callbacks can be set From c4a09e8b7985b892c51bf9df127a81188d26091b Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Tue, 9 Jan 2024 12:07:26 +0100 Subject: [PATCH 11/22] remove MAC address condition (latest github ENC supports it) + update readme --- Artnet/Receiver.h | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Artnet/Receiver.h b/Artnet/Receiver.h index b75a104..2e8a371 100644 --- a/Artnet/Receiver.h +++ b/Artnet/Receiver.h @@ -319,9 +319,9 @@ class Receiver_ { } template auto macAddress(uint8_t* mac) -> std::enable_if_t::value> { -#if !defined(ESP8266) && !defined(ARTNET_ETHER_IS_ENC28J60) +//#if !defined(ESP8266) && !defined(ARTNET_ETHER_IS_ENC28J60) Ethernet.MACAddress(mac); -#endif +//#endif } #endif // ARTNET_ENABLE_ETHER diff --git a/README.md b/README.md index 5210655..5cbcced 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ If you have already installed this library, please follow: When using the ENC28J60 controller -- make sure to install the [EthernetENC](https://github.com/JAndrassy/EthernetENC) library +- make sure to **clone** the [EthernetENC](https://github.com/JAndrassy/EthernetENC) library (version =< 2.0.4 doesn't support MAC address) - simply replace `#include ` with `#include ` @@ -213,7 +213,7 @@ void loop() { - Universe (0-15) can be set in `artnet.subscribe(universe, callback)`, - These universes (targets of the callbacks) are reflected to `net_sw` `sub_sw` `sw_in` in `ArtPollreply` automatically -PortTypes, GoodInput/Output, SwIn, etc., are limited to 4 ports. If more than 4 callbacks are needed, it is better to subscribe to more than four and make public 4 of them +PortTypes, GoodInput/Output, SwIn, etc., are limited to 4 ports for now. If more than 4 callbacks are needed, it is better to subscribe to more than four and make public 4 of them ```C++ artnet.begin(net, subnet); // net and subnet can be set only once From af4f950a2cfb4ebac02ffb2fe5e0157a0eee6ce1 Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Tue, 9 Jan 2024 12:13:31 +0100 Subject: [PATCH 12/22] remove avr:uno from workflow / fix lib url from workflow --- .github/workflows/build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0867a19..0171d66 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -247,9 +247,10 @@ jobs: fail-fast: false matrix: board: - - vendor: arduino - arch: avr - name: uno + # temporarily disabled due to memory shortage in `sender` example + # - vendor: arduino + # arch: avr + # name: uno - vendor: arduino arch: megaavr name: uno2018 @@ -310,5 +311,5 @@ jobs: - name: ArxContainer - name: ArxTypeTraits - name: FastLED - - name: EthernetENC + - source-url: https://github.com/JAndrassy/EthernetENC.git verbose: true From 78d82d1ad595c28de7a70d218fb2187b367202aa Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Tue, 9 Jan 2024 12:18:20 +0100 Subject: [PATCH 13/22] fix(workflow): split sketch-path to reduce memory footprint for avr boards --- .github/workflows/build.yml | 3 ++- Artnet/Receiver.h | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0171d66..2fe22bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -305,7 +305,8 @@ jobs: - name: ${{matrix.board.vendor}}:${{matrix.board.arch}} source-url: ${{matrix.index}} sketch-paths: | - - examples/EthernetENC + - examples/EthernetENC/receiver + - examples/EthernetENC/sender libraries: | - source-path: ./ - name: ArxContainer diff --git a/Artnet/Receiver.h b/Artnet/Receiver.h index 2e8a371..77f88a8 100644 --- a/Artnet/Receiver.h +++ b/Artnet/Receiver.h @@ -319,9 +319,7 @@ class Receiver_ { } template auto macAddress(uint8_t* mac) -> std::enable_if_t::value> { -//#if !defined(ESP8266) && !defined(ARTNET_ETHER_IS_ENC28J60) Ethernet.MACAddress(mac); -//#endif } #endif // ARTNET_ENABLE_ETHER From c447be0e4db4ee74810e84fd1762764914ceab9b Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Tue, 9 Jan 2024 12:22:17 +0100 Subject: [PATCH 14/22] fix(readme): use suggested formulation for ArtPoll explanation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5cbcced..7aafe68 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ void loop() { - Universe (0-15) can be set in `artnet.subscribe(universe, callback)`, - These universes (targets of the callbacks) are reflected to `net_sw` `sub_sw` `sw_in` in `ArtPollreply` automatically -PortTypes, GoodInput/Output, SwIn, etc., are limited to 4 ports for now. If more than 4 callbacks are needed, it is better to subscribe to more than four and make public 4 of them +PortTypes, GoodInput/Output, SwIn, etc., are limited to 4 ports. Only the first four ports are reflected if you subscribe to more than four callbacks. ```C++ artnet.begin(net, subnet); // net and subnet can be set only once From ed18b378876ea556b63814eca20cdb2cc32c6d14 Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Tue, 9 Jan 2024 17:06:45 +0100 Subject: [PATCH 15/22] fix: remove unused svg file --- pi-pico-enc28j60-wiring.svg | 4883 ----------------------------------- 1 file changed, 4883 deletions(-) delete mode 100644 pi-pico-enc28j60-wiring.svg diff --git a/pi-pico-enc28j60-wiring.svg b/pi-pico-enc28j60-wiring.svg deleted file mode 100644 index 93aa388..0000000 --- a/pi-pico-enc28j60-wiring.svg +++ /dev/null @@ -1,4883 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CLKOUT - WOL - SI - CS - VCC - - - - - - - - - INT - SO - SCK - RESET - GND - - - - - - - - - - - - 16.000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - D - - - E - - - B - - - U - - - G - - - B - - - O - - - O - - - T - - - S - - - E - - - L - - - L - - - E - - - D - - - 1 - - - 2 - - - 3 - - - 9 - - - U - - - S - - - B - - - - R - - - a - - - s - - - p - - - b - - - e - - - r - - - r - - - y - - - - - - P - - - i - - - - - - P - - - i - - - c - - - o - - - - - - © - - - 2 - - - 0 - - - 2 - - - 0 - - - R - - - P - - - 2 - - - - - - - 8 - - - 0 - - - - - - - - - - - - - - - 2 - - - 0 - - - / - - - 2 - - - 1 - - - P - - - 6 - - - 4 - - - M - - - 1 - - - 5 - - - . - - - 0 - - - 0 - - - - - - T - - - T - - - T - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GND (Pin 38) - - - - - - - white - - - - - - - GND - - - - - - - - - 3V3 Out (Pin 36) - - - - - - - gray - - - - - - - VCC - - - - - - - - - GP19/SPI0 TX (Pin 25) - - - - - - - SI - - - - - - - blue - - - - - - - - - GP18/SPI0 SCK (Pin 24) - - - - - - - SCK - - - - - - - yellow - - - - - - - - - GP17/SPI0 CSn (Pin 22) - - - - - - - green - - - - - - - CS - - - - - - - - - GP16/SPI0 RX (Pin 21) - - - - - - - SO - - - - - - - orange - - - - - - - - ENC28J60 - - - - - - - Pi Pico - - - - - - - - - - - - - - - - - - - - - - - - - - - - From ad5dd565b94861640c7e0f8a764ad0dbf3422026 Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Tue, 9 Jan 2024 22:50:30 +0100 Subject: [PATCH 16/22] fix(ArtnetEntherENC.h): remove unused directive --- ArtnetEtherENC.h | 1 - 1 file changed, 1 deletion(-) diff --git a/ArtnetEtherENC.h b/ArtnetEtherENC.h index c5f5fbd..8de9e82 100644 --- a/ArtnetEtherENC.h +++ b/ArtnetEtherENC.h @@ -3,7 +3,6 @@ #define ARTNET_ETHER_H #define ARTNET_ENABLE_ETHER -#define ARTNET_ETHER_IS_ENC28J60 #include #include From b4cb6d37811ac652564678737b46ea4ead010915 Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Wed, 10 Jan 2024 08:22:42 +0100 Subject: [PATCH 17/22] test(workflow): enable avr:uno to check memory usage (since sketch-path was split) --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2fe22bd..5a48f3f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -240,6 +240,7 @@ jobs: - name: ArxTypeTraits - name: FastLED verbose: true + build-etherenc: name: "Build Test (EtherENC): ${{matrix.board.arch}}:${{matrix.board.name}}" runs-on: ubuntu-latest @@ -247,10 +248,11 @@ jobs: fail-fast: false matrix: board: - # temporarily disabled due to memory shortage in `sender` example - # - vendor: arduino - # arch: avr - # name: uno + # temporarily enabled to check if memory shortage in `sender` example still valid + - vendor: arduino + arch: avr + name: uno + # ---------------------- - vendor: arduino arch: megaavr name: uno2018 From 05f228857021a511980e8c71c5ce8add851f2b9a Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Wed, 10 Jan 2024 08:33:24 +0100 Subject: [PATCH 18/22] test(workflows/ethernetENC): add fastled and send_receive folders (disable avr:uno memory shortage still going on) --- .github/workflows/build.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a48f3f..180bcd9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -248,11 +248,10 @@ jobs: fail-fast: false matrix: board: - # temporarily enabled to check if memory shortage in `sender` example still valid - - vendor: arduino - arch: avr - name: uno - # ---------------------- + # temporarily disabled due to memory shortage in `sender` example + # - vendor: arduino + # arch: avr + # name: uno - vendor: arduino arch: megaavr name: uno2018 @@ -309,6 +308,8 @@ jobs: sketch-paths: | - examples/EthernetENC/receiver - examples/EthernetENC/sender + - examples/EthernetENC/receiver_fastled + - examples/EthernetENC/send_receive libraries: | - source-path: ./ - name: ArxContainer From 9ddd952feb6468877b3cecb34d2c805b49cd89b4 Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Wed, 10 Jan 2024 08:40:57 +0100 Subject: [PATCH 19/22] fix(workflows/ethernetENC): name folders correctly --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 180bcd9..ebcd6a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -306,10 +306,10 @@ jobs: - name: ${{matrix.board.vendor}}:${{matrix.board.arch}} source-url: ${{matrix.index}} sketch-paths: | + - examples/EthernetENC/receive_fastled - examples/EthernetENC/receiver - - examples/EthernetENC/sender - - examples/EthernetENC/receiver_fastled - examples/EthernetENC/send_receive + - examples/EthernetENC/sender libraries: | - source-path: ./ - name: ArxContainer From c04d767a6bf8c2d50b8d369bcda8bdbeb338e22d Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Wed, 10 Jan 2024 09:10:18 +0100 Subject: [PATCH 20/22] fix(workflows/ethernetENC): remove FastLED because not supported by mkrvidor4000 --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ebcd6a0..2bc3121 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -306,10 +306,11 @@ jobs: - name: ${{matrix.board.vendor}}:${{matrix.board.arch}} source-url: ${{matrix.index}} sketch-paths: | - - examples/EthernetENC/receive_fastled - examples/EthernetENC/receiver - examples/EthernetENC/send_receive - examples/EthernetENC/sender + # disabled due to FastLED not supporting mkrvidor4000 + # - examples/EthernetENC/receive_fastled libraries: | - source-path: ./ - name: ArxContainer From 743aa1ccfe8e6f5bdc86c426d4b35feb9b2cfa32 Mon Sep 17 00:00:00 2001 From: MrFrangipane Date: Wed, 10 Jan 2024 09:27:40 +0100 Subject: [PATCH 21/22] fix(workflows/ethernetENC): remove mkrvidor4000 and reinstate FastLED --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2bc3121..1ece935 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -255,9 +255,10 @@ jobs: - vendor: arduino arch: megaavr name: uno2018 - - vendor: arduino - arch: samd - name: mkrvidor4000 + # temporarily disabled due to FastLED not supporting mkrvidor4000 + # - vendor: arduino + # arch: samd + # name: mkrvidor4000 - vendor: arduino arch: samd name: mkrwifi1010 @@ -306,11 +307,10 @@ jobs: - name: ${{matrix.board.vendor}}:${{matrix.board.arch}} source-url: ${{matrix.index}} sketch-paths: | + - examples/EthernetENC/receive_fastled - examples/EthernetENC/receiver - examples/EthernetENC/send_receive - examples/EthernetENC/sender - # disabled due to FastLED not supporting mkrvidor4000 - # - examples/EthernetENC/receive_fastled libraries: | - source-path: ./ - name: ArxContainer From 72f22b92f105e2ee183922e0bb6445273c541b83 Mon Sep 17 00:00:00 2001 From: Mr Frangipane Date: Wed, 10 Jan 2024 09:48:07 +0100 Subject: [PATCH 22/22] Update README.md Co-authored-by: Hideaki Tai --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7aafe68..ca0cab0 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ If you have already installed this library, please follow: - ESP32 (Ethernet and ETH) - ESP8266 - Almost all platforms without WiFi -- Anyplatform supported by ENC28J60 (please read following section) +- Any platform supported by ENC28J60 (please read following section)
Notes for ENC28J60 ethernet controller (click to expand)