From 52ac9fd37bbc6c1a57fb56197281b016717faacc Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Sun, 13 Jan 2019 22:59:47 -0500 Subject: [PATCH 01/18] ESP32 APA102 --- Arduino/E131_PixelPusher/E131_PixelPusher.ino | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/Arduino/E131_PixelPusher/E131_PixelPusher.ino b/Arduino/E131_PixelPusher/E131_PixelPusher.ino index f5bcc4d..9c91194 100644 --- a/Arduino/E131_PixelPusher/E131_PixelPusher.ino +++ b/Arduino/E131_PixelPusher/E131_PixelPusher.ino @@ -39,9 +39,19 @@ ESPAsyncE131 e131(UNIVERSE_COUNT); AsyncWebServer server(HTTP_PORT); #ifdef ESP32 - #define PIN 2 //Use any pin under 32 - NeoEsp32BitBangWs2813Method dma = NeoEsp32BitBangWs2813Method(PIN, ledCount, 3); - DNSServer dns; + //#define PIN 2 //Use any pin under 32 + //NeoEsp32BitBangWs2813Method dma = NeoEsp32BitBangWs2813Method(PIN, ledCount, 3); + //DNSServer dns; + + //APA102/DotStar + //Hardware SPI method: GPIO14 is CLK, GPIO13 is DATA + //DotStarSpiMethod dma = DotStarSpiMethod(ledCount, 3); + // + //Software SPI method: Any pin can be clock and data + #define PIN_CLK 14 + #define PIN_DATA 13 + DotStarMethod dma = DotStarMethod(PIN_CLK, PIN_DATA, ledCount, 3); + #elif defined(ESP8266) NeoEsp8266Dma800KbpsMethod dma = NeoEsp8266Dma800KbpsMethod(ledCount, 3); //uses RX/GPIO3 pin @@ -53,11 +63,12 @@ AsyncWebServer server(HTTP_PORT); //#define PIN_CLK 14 //#define PIN_DATA 13 //DotStarMethod dma = DotStarMethod(PIN_CLK, PIN_DATA, ledCount, 3); - #if defined(ESP8266) and (defined(PIO_PLATFORM) or defined(USE_EADNS)) - AsyncDNSServer dns; - #else - DNSServer dns; - #endif +#endif + +#if defined(ESP8266) and (defined(PIO_PLATFORM) or defined(USE_EADNS)) +AsyncDNSServer dns; +#else +DNSServer dns; #endif uint8_t *pixel = (uint8_t *)malloc(dma.getPixelsSize()); From 51419e2080aac65b36b6214a2e7423506f15e8f3 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Sun, 13 Jan 2019 23:19:52 -0500 Subject: [PATCH 02/18] SPI pins different for ESP32 --- Arduino/E131_PixelPusher/E131_PixelPusher.ino | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Arduino/E131_PixelPusher/E131_PixelPusher.ino b/Arduino/E131_PixelPusher/E131_PixelPusher.ino index 9c91194..052ce39 100644 --- a/Arduino/E131_PixelPusher/E131_PixelPusher.ino +++ b/Arduino/E131_PixelPusher/E131_PixelPusher.ino @@ -44,13 +44,13 @@ AsyncWebServer server(HTTP_PORT); //DNSServer dns; //APA102/DotStar - //Hardware SPI method: GPIO14 is CLK, GPIO13 is DATA - //DotStarSpiMethod dma = DotStarSpiMethod(ledCount, 3); + //Hardware SPI method: GPIO18 is CLK, GPIO23 is DATA + DotStarSpiMethod dma = DotStarSpiMethod(ledCount, 3); // //Software SPI method: Any pin can be clock and data - #define PIN_CLK 14 - #define PIN_DATA 13 - DotStarMethod dma = DotStarMethod(PIN_CLK, PIN_DATA, ledCount, 3); + //#define PIN_CLK 18 + //#define PIN_DATA 23 + //DotStarMethod dma = DotStarMethod(PIN_CLK, PIN_DATA, ledCount, 3); #elif defined(ESP8266) NeoEsp8266Dma800KbpsMethod dma = NeoEsp8266Dma800KbpsMethod(ledCount, 3); //uses RX/GPIO3 pin @@ -91,6 +91,10 @@ void setup() char NameChipId[64] = {0}, chipId[9] = {0}; #ifdef ESP32 + Serial.print("Hardware SPI //DATA PIN: "); + Serial.println(MOSI); //GPIO23? + Serial.print("Hardware SPI //CLOCK PIN: "); + Serial.println(SCK); //GPIO18? snprintf(chipId, sizeof(chipId), "%08x", (uint32_t)ESP.getEfuseMac()); snprintf(NameChipId, sizeof(NameChipId), "%s_%08x", HOSTNAME, (uint32_t)ESP.getEfuseMac()); From 55aeaa5ae9664bddd72371a2e6065271f5e2373c Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Sun, 13 Jan 2019 23:31:27 -0500 Subject: [PATCH 03/18] AsyncTCP will not compile with ESP32@1.5.1 --- platformio.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index a870e49..61ec159 100644 --- a/platformio.ini +++ b/platformio.ini @@ -65,8 +65,8 @@ lib_deps = [env:esp32dev] board = esp32dev framework = ${common.framework} -platform = ${common:esp32.platform} -;platform = https://github.com/platformio/platform-espressif32.git#feature/stage +;platform = ${common:esp32.platform} +platform = https://github.com/platformio/platform-espressif32.git#feature/stage monitor_speed = ${common.monitor_speed} upload_speed = ${common.upload_speed} build_flags = From e6a36206c4ba3c29684daa1cf0b8494e56730ccb Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Sun, 13 Jan 2019 23:37:08 -0500 Subject: [PATCH 04/18] Update README.md --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5553b65..900c58d 100644 --- a/README.md +++ b/README.md @@ -17,15 +17,16 @@ Minimalistic Async code around Async E131 for ESP8266/ESP32 [platformio.ini](https://github.com/debsahu/E131_PixelPusher/blob/master/platformio.ini) is included, use [PlatformIO](https://platformio.org/platformio-ide) and it will take care of installing the following libraries. -| Library | Link | -|---------------------------|------------------------------------------------------------| -|ESPAsyncE131 |https://github.com/forkineye/ESPAsyncE131 | -|ESPAsyncUDP |https://github.com/me-no-dev/ESPAsyncUDP | -|ESPAsyncTCP |https://github.com/me-no-dev/ESPAsyncTCP | -|NeoPixelBus |https://github.com/Makuna/NeoPixelBus | -|ESPAsyncWiFiManager |https://github.com/alanswx/ESPAsyncWiFiManager | -|ESPAsyncDNSServer |https://github.com/devyte/ESPAsyncDNSServer | -|ESP Async WebServer |https://github.com/me-no-dev/ESPAsyncWebServer | +| Library | Link | Platform | +|---------------------------|------------------------------------------------------------|-------------| +|ESPAsyncE131 |https://github.com/forkineye/ESPAsyncE131 |ESP8266/32 | +|ESPAsyncUDP |https://github.com/me-no-dev/ESPAsyncUDP |ESP8266 | +|ESPAsyncTCP |https://github.com/me-no-dev/ESPAsyncTCP |ESP8266 | +|NeoPixelBus |https://github.com/Makuna/NeoPixelBus |ESP8266/32 | +|ESPAsyncWiFiManager |https://github.com/alanswx/ESPAsyncWiFiManager |ESP8266/32 | +|ESPAsyncDNSServer |https://github.com/devyte/ESPAsyncDNSServer |ESP8266 | +|ESP Async WebServer |https://github.com/me-no-dev/ESPAsyncWebServer |ESP8266/32 | +|AsyncTCP |https://github.com/me-no-dev/AsyncTCP |ESP32 | ## Pushing E1.31 UDP Data From c64dbc9325f1934d828fb6d7604977b64d9a6dda Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Mon, 14 Jan 2019 18:09:51 -0500 Subject: [PATCH 05/18] Update platformio.ini --- README.md | 19 ++++++++++--------- platformio.ini | 6 +++--- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5553b65..900c58d 100644 --- a/README.md +++ b/README.md @@ -17,15 +17,16 @@ Minimalistic Async code around Async E131 for ESP8266/ESP32 [platformio.ini](https://github.com/debsahu/E131_PixelPusher/blob/master/platformio.ini) is included, use [PlatformIO](https://platformio.org/platformio-ide) and it will take care of installing the following libraries. -| Library | Link | -|---------------------------|------------------------------------------------------------| -|ESPAsyncE131 |https://github.com/forkineye/ESPAsyncE131 | -|ESPAsyncUDP |https://github.com/me-no-dev/ESPAsyncUDP | -|ESPAsyncTCP |https://github.com/me-no-dev/ESPAsyncTCP | -|NeoPixelBus |https://github.com/Makuna/NeoPixelBus | -|ESPAsyncWiFiManager |https://github.com/alanswx/ESPAsyncWiFiManager | -|ESPAsyncDNSServer |https://github.com/devyte/ESPAsyncDNSServer | -|ESP Async WebServer |https://github.com/me-no-dev/ESPAsyncWebServer | +| Library | Link | Platform | +|---------------------------|------------------------------------------------------------|-------------| +|ESPAsyncE131 |https://github.com/forkineye/ESPAsyncE131 |ESP8266/32 | +|ESPAsyncUDP |https://github.com/me-no-dev/ESPAsyncUDP |ESP8266 | +|ESPAsyncTCP |https://github.com/me-no-dev/ESPAsyncTCP |ESP8266 | +|NeoPixelBus |https://github.com/Makuna/NeoPixelBus |ESP8266/32 | +|ESPAsyncWiFiManager |https://github.com/alanswx/ESPAsyncWiFiManager |ESP8266/32 | +|ESPAsyncDNSServer |https://github.com/devyte/ESPAsyncDNSServer |ESP8266 | +|ESP Async WebServer |https://github.com/me-no-dev/ESPAsyncWebServer |ESP8266/32 | +|AsyncTCP |https://github.com/me-no-dev/AsyncTCP |ESP32 | ## Pushing E1.31 UDP Data diff --git a/platformio.ini b/platformio.ini index 61ec159..76e02f9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -31,7 +31,7 @@ lib_deps = ESPAsyncDNSServer [common:esp32] -platform = espressif32@1.5.0 +platform = espressif32@1.6.0 build_flags = -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH -D ARDUINO_ARCH_ESP32 @@ -65,8 +65,8 @@ lib_deps = [env:esp32dev] board = esp32dev framework = ${common.framework} -;platform = ${common:esp32.platform} -platform = https://github.com/platformio/platform-espressif32.git#feature/stage +platform = ${common:esp32.platform} +;platform = https://github.com/platformio/platform-espressif32.git#feature/stage monitor_speed = ${common.monitor_speed} upload_speed = ${common.upload_speed} build_flags = From 1339941844c5e51cd1089f6106d27a65f3645558 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Mon, 21 Jan 2019 23:29:57 -0500 Subject: [PATCH 06/18] v1.2.0 - Add web interface - user can choose starting universe, unicast/umulticast, total number of universe --- Arduino/E131_PixelPusher/E131_PixelPusher.ino | 258 ++++++++++++++++-- Arduino/E131_PixelPusher/version.h | 8 +- data/data.json | 6 + data/index.htm | 150 ++++++++++ data/index.min.htm | 1 + data/index.min.htm.gz | Bin 0 -> 1383 bytes 6 files changed, 392 insertions(+), 31 deletions(-) create mode 100644 data/data.json create mode 100644 data/index.htm create mode 100644 data/index.min.htm create mode 100644 data/index.min.htm.gz diff --git a/Arduino/E131_PixelPusher/E131_PixelPusher.ino b/Arduino/E131_PixelPusher/E131_PixelPusher.ino index 052ce39..70d49a7 100644 --- a/Arduino/E131_PixelPusher/E131_PixelPusher.ino +++ b/Arduino/E131_PixelPusher/E131_PixelPusher.ino @@ -24,24 +24,156 @@ #include //https://github.com/alanswx/ESPAsyncWiFiManager #include //https://github.com/me-no-dev/ESPAsyncWebServer #include //https://github.com/Makuna/NeoPixelBus -#include +#include #include "version.h" +#define WIFI_HTM_GZ_PROGMEM //comment to serve minimized html instead of gziped version +//#define SERIAL_DEBUG //uncomment to see if E1.31 data is received +//#define SHOW_FPS_SERIAL //uncomment to see Serial FPS + #define HOSTNAME "E131PixelPusher" #define HTTP_PORT 80 -#define UNIVERSE 1 // First DMX Universe to listen for -#define UNIVERSE_COUNT 7 // Total number of Universes to listen for, starting at UNIVERSE max 7 for multicast and 12 for unicast -uint16_t ledCount = UNIVERSE_COUNT * 170; // 170 LEDs per Universe +uint8_t UNIVERSE = 1; // First DMX Universe to listen for +uint8_t UNIVERSE_COUNT = 7; // Total number of Universes to listen for, starting at UNIVERSE max 7 for multicast and 12 for unicast +uint16_t ledCount = 12 * 170; // 170 LEDs per Universe +bool unicast_flag = false; + +#ifndef WIFI_HTM_GZ_PROGMEM +//size: 3202 +static const char index_htm[] PROGMEM = R"=====( +

E1.31 Pixel Pusher

Pixels:
Mode:
Start Universe:
Max Universe :

Update Firmware?
+)====="; +#else +//gziped: 1383 (~57% compression) +#define index_htm_gz_len 1383 +static const uint8_t index_htm_gz[] PROGMEM = { + 0x1f, 0x8b, 0x08, 0x00, 0x0d, 0x95, 0x46, 0x5c, 0x00, 0x03, 0xcd, 0x57, + 0x6d, 0x53, 0xe3, 0x36, 0x10, 0xfe, 0x2b, 0x42, 0x4c, 0x99, 0xa4, 0x17, + 0xdb, 0x31, 0x2f, 0x07, 0x38, 0x71, 0xda, 0x3b, 0xca, 0xb5, 0xd7, 0xb9, + 0xe3, 0x98, 0x39, 0xe8, 0x4c, 0xa7, 0x6f, 0x23, 0xdb, 0xeb, 0x58, 0x8d, + 0x2d, 0xb9, 0x92, 0x4c, 0xc8, 0x01, 0xff, 0xbd, 0x2b, 0xcb, 0x0e, 0x81, + 0x1e, 0x57, 0xfa, 0xad, 0x5f, 0x88, 0x25, 0xed, 0xdb, 0xb3, 0xbb, 0x7a, + 0x56, 0x4c, 0xb7, 0xbe, 0xfb, 0x70, 0x72, 0xf1, 0xf3, 0xf9, 0x29, 0x29, + 0x4c, 0x55, 0xce, 0xa6, 0xf6, 0x2f, 0x29, 0x99, 0x98, 0xc7, 0x14, 0x04, + 0xc5, 0x35, 0xb0, 0x6c, 0x36, 0xad, 0xc0, 0x30, 0x14, 0x30, 0xb5, 0x07, + 0x7f, 0x35, 0xfc, 0x2a, 0xa6, 0x27, 0x52, 0x18, 0x10, 0xc6, 0xbb, 0x58, + 0xd5, 0x40, 0x49, 0xea, 0x56, 0x31, 0x35, 0x70, 0x6d, 0x02, 0x6b, 0x62, + 0x42, 0xd2, 0x82, 0x29, 0x0d, 0x26, 0x6e, 0x4c, 0xee, 0x1d, 0xd1, 0xce, + 0x84, 0x60, 0x15, 0xc4, 0xf4, 0x8a, 0xc3, 0xb2, 0x96, 0xca, 0x6c, 0x28, + 0x2e, 0x79, 0x66, 0x8a, 0x38, 0x83, 0x2b, 0x9e, 0x82, 0xd7, 0x2e, 0x50, + 0x45, 0xa7, 0x8a, 0xd7, 0x66, 0x96, 0x37, 0x22, 0x35, 0x5c, 0x0a, 0xf2, + 0x4e, 0xb2, 0xec, 0xb5, 0xcc, 0x56, 0x83, 0xe1, 0xcd, 0x15, 0x53, 0x04, + 0x2d, 0x05, 0x19, 0x33, 0x8c, 0x4e, 0x72, 0x30, 0x69, 0x31, 0x80, 0xd1, + 0x0d, 0x3a, 0x29, 0x64, 0x16, 0xd1, 0xef, 0x4f, 0x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c, 0xc0, + 0x5c, 0xdd, 0xad, 0x0b, 0x88, 0x46, 0x38, 0x56, 0x0c, 0x7e, 0x62, 0xe5, + 0xba, 0x86, 0xcf, 0x08, 0x70, 0x64, 0x9e, 0x96, 0xda, 0x88, 0x6e, 0x24, + 0xe2, 0x30, 0x3c, 0x1e, 0x4f, 0x5c, 0x71, 0x69, 0x23, 0x78, 0xca, 0xb4, + 0xa1, 0xf1, 0xbd, 0x72, 0xae, 0xaa, 0x4a, 0xb5, 0x79, 0x71, 0x1a, 0x3b, + 0x3b, 0x03, 0x11, 0xef, 0x8e, 0xf7, 0xc7, 0xc3, 0xd1, 0xd6, 0x00, 0x66, + 0xe6, 0xf6, 0x16, 0xb3, 0xfc, 0x22, 0x9c, 0xc6, 0xe3, 0xdb, 0xdb, 0x36, + 0xf1, 0xed, 0x72, 0x38, 0x13, 0xc3, 0xdb, 0x5b, 0x7b, 0xbe, 0xb3, 0xc3, + 0x4a, 0x50, 0x06, 0xeb, 0x6b, 0x98, 0x32, 0x58, 0x52, 0x82, 0x4e, 0xae, + 0x00, 0xfb, 0x9c, 0xa4, 0x4c, 0x18, 0x92, 0x00, 0x29, 0xf8, 0xbc, 0x00, + 0x45, 0x4c, 0xc1, 0x04, 0x31, 0xd2, 0xb0, 0x92, 0x88, 0xa6, 0x4a, 0x70, + 0x47, 0xe6, 0x6b, 0x61, 0xbd, 0x45, 0x87, 0xa3, 0xde, 0xd3, 0xda, 0xe6, + 0xd9, 0x5a, 0xee, 0xdc, 0xf6, 0x81, 0x5e, 0x9b, 0x14, 0x30, 0x67, 0x06, + 0x35, 0x83, 0x4f, 0xa0, 0xa4, 0x55, 0x7d, 0x10, 0xda, 0x5a, 0xff, 0xc4, + 0x8a, 0xb3, 0xb6, 0xef, 0xac, 0x7b, 0x43, 0x2a, 0x26, 0x56, 0x0f, 0x7d, + 0x6e, 0x85, 0x1b, 0xc5, 0x48, 0x59, 0x99, 0x3a, 0x4f, 0x58, 0x8b, 0xff, + 0xde, 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x25, 0x6f, 0xb8, 0xaa, 0x96, 0x4c, 0xc1, + 0x37, 0xd3, 0x80, 0x39, 0x49, 0x7b, 0xf9, 0x3a, 0x57, 0xee, 0x9e, 0xd3, + 0x7b, 0x6d, 0xfb, 0xc2, 0xd7, 0x51, 0x10, 0xb8, 0x03, 0x3f, 0x95, 0x55, + 0x90, 0x41, 0xa2, 0x59, 0xd1, 0x04, 0xa7, 0xe1, 0x5e, 0xf8, 0x47, 0x1b, + 0xb7, 0xbb, 0x8e, 0xf6, 0x8a, 0x3e, 0xdc, 0x21, 0xc9, 0x8a, 0x7c, 0xdb, + 0x89, 0xb7, 0xde, 0x5c, 0x74, 0xfd, 0xf0, 0x5b, 0x4f, 0xc1, 0xc0, 0x12, + 0x83, 0x65, 0x09, 0xfb, 0xff, 0xc6, 0xdf, 0x38, 0x71, 0xd5, 0x73, 0x7f, + 0x0c, 0x00, 0x00 +}; +#endif -// ESPAsyncE131 instance with UNIVERSE_COUNT buffer slots -ESPAsyncE131 e131(UNIVERSE_COUNT); +//ESPAsyncE131 pointer +ESPAsyncE131* e131; AsyncWebServer server(HTTP_PORT); #ifdef ESP32 //#define PIN 2 //Use any pin under 32 //NeoEsp32BitBangWs2813Method dma = NeoEsp32BitBangWs2813Method(PIN, ledCount, 3); - //DNSServer dns; //APA102/DotStar //Hardware SPI method: GPIO18 is CLK, GPIO23 is DATA @@ -71,9 +203,16 @@ AsyncDNSServer dns; DNSServer dns; #endif +struct { + bool unicast = false; + uint16_t startUniverse = UNIVERSE; + uint16_t noOfUniverses = UNIVERSE_COUNT; +} config; + +int eeprom_addr = 0; + uint8_t *pixel = (uint8_t *)malloc(dma.getPixelsSize()); -//#define SHOW_FPS_SERIAL //uncomment to see Serial FPS #ifdef SHOW_FPS_SERIAL uint64_t frameCt = 0; uint64_t PM = 0; @@ -83,12 +222,46 @@ float interval = 10 * 1000.0; // 10s bool shouldReboot = false; const char update_html[] PROGMEM = "Firmware Update

Update Firmware


"; +void initE131(void){ + ledCount = (UNIVERSE_COUNT - UNIVERSE + 1) * 170; + e131 = new ESPAsyncE131(ledCount); + if (e131->begin((unicast_flag) ? E131_UNICAST : E131_MULTICAST, UNIVERSE, UNIVERSE_COUNT)) // Listen via Multicast + Serial.println(F(">>> Listening for E1.31 data...")); + else + Serial.println(F(">>> e131.begin failed :(")); +} + +void readEEPROM(void){ + EEPROM.get(eeprom_addr, config); + unicast_flag = config.unicast; + UNIVERSE = config.startUniverse; + UNIVERSE_COUNT = config.noOfUniverses; + #ifdef SERIAL_DEBUG + Serial.printf("READ>> Mode: %s Start Universe: %d No of Universes: %d", (unicast_flag)?"unicast":"multicast", UNIVERSE, UNIVERSE_COUNT); + #endif +} + +void writeEEPROM(void){ + config.unicast = unicast_flag; + config.startUniverse = UNIVERSE; + config.noOfUniverses = UNIVERSE_COUNT; + #ifdef SERIAL_DEBUG + Serial.printf("WRITE>> Mode: %s Start Universe: %d No of Universes: %d", (unicast_flag)?"unicast":"multicast", UNIVERSE, UNIVERSE_COUNT); + #endif + EEPROM.put(eeprom_addr, config); + EEPROM.commit(); +} + void setup() { SPIFFS.begin(); + EEPROM.begin(512); Serial.begin(115200); delay(10); + Serial.println(); + readEEPROM(); + char NameChipId[64] = {0}, chipId[9] = {0}; #ifdef ESP32 Serial.print("Hardware SPI //DATA PIN: "); @@ -120,7 +293,37 @@ void setup() Serial.println(WiFi.localIP()); server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) { - request->send(200, "text/html", "

Send E1.31 Multicast UDP Request to " + WiFi.localIP().toString() + "



Update Firmware?

E131_PixelPusher by @debsahu"); + #ifdef WIFI_HTM_GZ_PROGMEM + AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", index_htm_gz, index_htm_gz_len); + response->addHeader("Content-Encoding", "gzip"); + request->send(response); + #else + request->send_P(200, "text/html", index_htm); + #endif + }); + server.on("/data", HTTP_GET, [](AsyncWebServerRequest *request) { + request->send(200, "application/json", "{\"ct\":" + String(ledCount) + ",\"mode\":\"" + String((unicast_flag) ? "unicast" : "multicast") + "\",\"su\":" + String(UNIVERSE) + ",\"uct\":" + String(UNIVERSE_COUNT) + "}"); + }); + server.on("/updateparams", HTTP_POST, [](AsyncWebServerRequest *request) { + bool hasReqArgs = false; + if (request->hasParam("pixelct", true)) { + unicast_flag = (request->getParam("mode", true)->value() == "unicast") ? true : false; + hasReqArgs = true; + } + if (request->hasParam("su", true)) { + UNIVERSE = constrain(request->getParam("su", true)->value().toInt(), 1, (unicast_flag)?12:7); + hasReqArgs = true; + } + if (request->hasParam("uct", true)) { + UNIVERSE_COUNT = constrain(request->getParam("uct", true)->value().toInt(), 1, (unicast_flag)?12:7); + hasReqArgs = true; + } + if (hasReqArgs){ + initE131(); + writeEEPROM(); + hasReqArgs = false; + } + request->send(200, "text/html", "LED Count: "+ String(ledCount) + ", Mode: " + String((unicast_flag) ? "unicast" : "multicast") + ", Starting Universe: " + String(UNIVERSE) + ", Universe Count: " + String(UNIVERSE_COUNT) + ""); }); server.on("/status", HTTP_GET, [](AsyncWebServerRequest *request) { request->send(200, "text/plain", SKETCH_VERSION); @@ -139,7 +342,7 @@ void setup() return; } if(!index){ - Serial.printf("Update Start: %s\n", filename.c_str()); + if(Serial) Serial.printf("Update Start: %s\n", filename.c_str()); #ifdef ESP32 uint32_t maxSketchSpace = len; // for ESP32 you just supply the length of file #elif defined(ESP8266) @@ -147,19 +350,19 @@ void setup() uint32_t maxSketchSpace = ((ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000); #endif if(!Update.begin(maxSketchSpace)) { - Update.printError(Serial); + if(Serial) Update.printError(Serial); } } if(!Update.hasError()){ if(Update.write(data, len) != len) { - Update.printError(Serial); + if(Serial) Update.printError(Serial); } } if(final){ if(Update.end(true)) - Serial.printf("Update Success: %uB\n", index+len); + if(Serial) Serial.printf("Update Success: %uB\n", index+len); else { - Update.printError(Serial); + if(Serial) Update.printError(Serial); } } }); @@ -180,14 +383,9 @@ void setup() DefaultHeaders::Instance().addHeader("Access-Control-Allow-Origin", "*"); server.begin(); - // Choose one to begin listening for E1.31 data - //if (e131.begin(E131_UNICAST)) // Listen via Unicast - if (e131.begin(E131_MULTICAST, UNIVERSE, UNIVERSE_COUNT)) // Listen via Multicast - Serial.println(F(">>> Listening for E1.31 data...")); - else - Serial.println(F(">>> e131.begin failed :(")); + initE131(); delay(1000); -#ifndef SHOW_FPS_SERIAL +#if !defined(SHOW_FPS_SERIAL) or !defined(SERIAL_DEBUG) Serial.end(); #endif dma.Initialize(); @@ -200,10 +398,10 @@ void loop() MDNS.update(); #endif - if (!e131.isEmpty()) + if (!e131->isEmpty()) { e131_packet_t packet; - e131.pull(&packet); // Pull packet from ring buffer + e131->pull(&packet); // Pull packet from ring buffer uint16_t universe = htons(packet.universe); uint8_t *data = packet.property_values + 1; @@ -211,12 +409,14 @@ void loop() if (universe < UNIVERSE || universe > UNIVERSE_COUNT) return; //async will take care about filling the buffer - // Serial.printf("Universe %u / %u Channels | Packet#: %u / Errors: %u / CH1: %u\n", - // htons(packet.universe), // The Universe for this packet - // htons(packet.property_value_count) - 1, // Start code is ignored, we're interested in dimmer data - // e131.stats.num_packets, // Packet counter - // e131.stats.packet_errors, // Packet error counter - // packet.property_values[1]); // Dimmer data for Channel 1 + #ifdef SERIAL_DEBUG + Serial.printf("Universe %u / %u Channels | Packet#: %u / Errors: %u / CH1: %u\n", + htons(packet.universe), // The Universe for this packet + htons(packet.property_value_count) - 1, // Start code is ignored, we're interested in dimmer data + e131->stats.num_packets, // Packet counter + e131->stats.packet_errors, // Packet error counter + packet.property_values[1]); // Dimmer data for Channel 1 + #endif uint16_t multipacketOffset = (universe - UNIVERSE) * 170; //if more than 170 LEDs (510 channels), client will send in next higher universe if (ledCount <= multipacketOffset) diff --git a/Arduino/E131_PixelPusher/version.h b/Arduino/E131_PixelPusher/version.h index 7b9bcd1..cc483a6 100644 --- a/Arduino/E131_PixelPusher/version.h +++ b/Arduino/E131_PixelPusher/version.h @@ -1,4 +1,4 @@ -#define SKETCH_VERSION "1.1.2" +#define SKETCH_VERSION "1.2.0" /* * Dec 13, 2018 v1.0.0 @@ -21,6 +21,10 @@ * - Added ESP32 support (check platformio.ini for compiling details) * - APA102/DotStar relavent lines * -* Jab 8, 2019 v1.1.2 (commented by default so version remains same) +* Jan 8, 2019 v1.1.2 (commented by default so version remains same) * - Added Arduino IDE compatibility mode, DNS server is not Async for ArduinoIDE +* +* Jan 21, 2019 v1.2.0 +* - Add web interface +* - user can choose starting universe, unicast/umulticast, total number of universe */ \ No newline at end of file diff --git a/data/data.json b/data/data.json new file mode 100644 index 0000000..3a80462 --- /dev/null +++ b/data/data.json @@ -0,0 +1,6 @@ +{ + "ct":256, + "mode": "unicast", + "su":1, + "uct":7 +} \ No newline at end of file diff --git a/data/index.htm b/data/index.htm new file mode 100644 index 0000000..bc48400 --- /dev/null +++ b/data/index.htm @@ -0,0 +1,150 @@ + + + + + + + + + + + +
+

E1.31 Pixel Pusher

+
+ Pixels: +
+ Mode: + +
+ Start Universe: +
+ Max Universe : +
+ +
+
+
Update Firmware? +
+ + + + + \ No newline at end of file diff --git a/data/index.min.htm b/data/index.min.htm new file mode 100644 index 0000000..e89743e --- /dev/null +++ b/data/index.min.htm @@ -0,0 +1 @@ +

E1.31 Pixel Pusher

Pixels:
Mode:
Start Universe:
Max Universe :

Update Firmware?
\ No newline at end of file diff --git a/data/index.min.htm.gz b/data/index.min.htm.gz new file mode 100644 index 0000000000000000000000000000000000000000..ec26705752eafcdb95fb3ea443f1ebb80d6eb7c8 GIT binary patch literal 1383 zcmV-t1(^CDiwFP>l}20u1I<@$Q{y%e{wqREnWPunF)s%=aoRh|wb!}hm^tW7r*9+M z>sXB~xspuC0sp-#%MO7aSNg4Ah$ZdYv%7j$Ot-%KaB}hU`6($(RnDgNFDaRr#}ov` zHLz?pt-vr8FtrDNHT){3CsG&?#=BV6KuPLWF*R^)0&8MI(t;@sCT>jb9nsE&U=_sl zio>#&%4{eud1i_@gDakb*Dg>+r;68RmNz0bTnh3|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zJlb}NXV+^;wryzJ9e?m9ITQFg zSCFq;9eb($C2zQ@mQ2An(||cid-*z7?w-?oZTrI4Q4qKTKb2LGL84jF1gGI%_(vPJ pyN>pXKHMS6ihSFNx87WI{qS2)!N3xOWeNNL#@{$`)pLIg002%!x=;WB literal 0 HcmV?d00001 From 5ab6abc7839bf3fa3d7215c720dc9319a2975c82 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Mon, 21 Jan 2019 23:37:53 -0500 Subject: [PATCH 07/18] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 900c58d..b644ec3 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # E131_PixelPusher -[![Build Status](https://travis-ci.com/debsahu/E131_PixelPusher.svg?branch=master)](https://travis-ci.com/debsahu/E131_PixelPusher) [![License: MIT](https://img.shields.io/github/license/debsahu/E131_PixelPusher.svg)](https://opensource.org/licenses/MIT) [![version](https://img.shields.io/github/release/debsahu/E131_PixelPusher.svg)](https://github.com/debsahu/E131_PixelPusher/releases/tag/1.1.2) [![LastCommit](https://img.shields.io/github/last-commit/debsahu/E131_PixelPusher.svg?style=social)](https://github.com/debsahu/E131_PixelPusher/commits/master) +[![Build Status](https://travis-ci.com/debsahu/E131_PixelPusher.svg?branch=master)](https://travis-ci.com/debsahu/E131_PixelPusher) [![License: MIT](https://img.shields.io/github/license/debsahu/E131_PixelPusher.svg)](https://opensource.org/licenses/MIT) [![version](https://img.shields.io/github/release/debsahu/E131_PixelPusher.svg)](https://github.com/debsahu/E131_PixelPusher/releases/tag/1.2.0) [![LastCommit](https://img.shields.io/github/last-commit/debsahu/E131_PixelPusher.svg?style=social)](https://github.com/debsahu/E131_PixelPusher/commits/master) Minimalistic Async code around Async E131 for ESP8266/ESP32 - Completely Async +- Web-interface to set starting universe, unicast/umulticast, total number of universes - WiFiManager Captive Portal to get WiFi credentials (Compile with `-DUSE_EADNS` for ESP8266) - Subscribes to E131 multicast - Connect RX/GPIO3 to DIN of NeoPixel strip, and any PIN ( Date: Tue, 22 Jan 2019 09:48:15 -0500 Subject: [PATCH 08/18] Update E131_PixelPusher.ino - fix variable naming for better readability - e131 initialization was wrong! fixed. --- Arduino/E131_PixelPusher/E131_PixelPusher.ino | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/Arduino/E131_PixelPusher/E131_PixelPusher.ino b/Arduino/E131_PixelPusher/E131_PixelPusher.ino index 70d49a7..d30f4b2 100644 --- a/Arduino/E131_PixelPusher/E131_PixelPusher.ino +++ b/Arduino/E131_PixelPusher/E131_PixelPusher.ino @@ -34,8 +34,8 @@ #define HOSTNAME "E131PixelPusher" #define HTTP_PORT 80 -uint8_t UNIVERSE = 1; // First DMX Universe to listen for -uint8_t UNIVERSE_COUNT = 7; // Total number of Universes to listen for, starting at UNIVERSE max 7 for multicast and 12 for unicast +uint8_t START_UNIVERSE = 1; // First DMX Universe to listen for +uint8_t UNIVERSE_COUNT = 7; // Total number of Universes to listen for, starting at START_UNIVERSE max 7 for multicast and 12 for unicast uint16_t ledCount = 12 * 170; // 170 LEDs per Universe bool unicast_flag = false; @@ -205,7 +205,7 @@ DNSServer dns; struct { bool unicast = false; - uint16_t startUniverse = UNIVERSE; + uint16_t startUniverse = START_UNIVERSE; uint16_t noOfUniverses = UNIVERSE_COUNT; } config; @@ -223,9 +223,10 @@ bool shouldReboot = false; const char update_html[] PROGMEM = "Firmware Update

Update Firmware


"; void initE131(void){ - ledCount = (UNIVERSE_COUNT - UNIVERSE + 1) * 170; - e131 = new ESPAsyncE131(ledCount); - if (e131->begin((unicast_flag) ? E131_UNICAST : E131_MULTICAST, UNIVERSE, UNIVERSE_COUNT)) // Listen via Multicast + uint8_t TOTAL_UNIVERSES = (UNIVERSE_COUNT - START_UNIVERSE + 1); + ledCount = TOTAL_UNIVERSES * 170; + e131 = new ESPAsyncE131(TOTAL_UNIVERSES); + if (e131->begin((unicast_flag) ? E131_UNICAST : E131_MULTICAST, START_UNIVERSE, UNIVERSE_COUNT)) // Listen via Unicast/Multicast Serial.println(F(">>> Listening for E1.31 data...")); else Serial.println(F(">>> e131.begin failed :(")); @@ -234,19 +235,19 @@ void initE131(void){ void readEEPROM(void){ EEPROM.get(eeprom_addr, config); unicast_flag = config.unicast; - UNIVERSE = config.startUniverse; + START_UNIVERSE = config.startUniverse; UNIVERSE_COUNT = config.noOfUniverses; #ifdef SERIAL_DEBUG - Serial.printf("READ>> Mode: %s Start Universe: %d No of Universes: %d", (unicast_flag)?"unicast":"multicast", UNIVERSE, UNIVERSE_COUNT); + Serial.printf("READ>> Mode: %s Start Universe: %d No of Universes: %d", (unicast_flag)?"unicast":"multicast", START_UNIVERSE, UNIVERSE_COUNT); #endif } void writeEEPROM(void){ config.unicast = unicast_flag; - config.startUniverse = UNIVERSE; + config.startUniverse = START_UNIVERSE; config.noOfUniverses = UNIVERSE_COUNT; #ifdef SERIAL_DEBUG - Serial.printf("WRITE>> Mode: %s Start Universe: %d No of Universes: %d", (unicast_flag)?"unicast":"multicast", UNIVERSE, UNIVERSE_COUNT); + Serial.printf("WRITE>> Mode: %s Start Universe: %d No of Universes: %d", (unicast_flag)?"unicast":"multicast", START_UNIVERSE, UNIVERSE_COUNT); #endif EEPROM.put(eeprom_addr, config); EEPROM.commit(); @@ -302,7 +303,7 @@ void setup() #endif }); server.on("/data", HTTP_GET, [](AsyncWebServerRequest *request) { - request->send(200, "application/json", "{\"ct\":" + String(ledCount) + ",\"mode\":\"" + String((unicast_flag) ? "unicast" : "multicast") + "\",\"su\":" + String(UNIVERSE) + ",\"uct\":" + String(UNIVERSE_COUNT) + "}"); + request->send(200, "application/json", "{\"ct\":" + String(ledCount) + ",\"mode\":\"" + String((unicast_flag) ? "unicast" : "multicast") + "\",\"su\":" + String(START_UNIVERSE) + ",\"uct\":" + String(UNIVERSE_COUNT) + "}"); }); server.on("/updateparams", HTTP_POST, [](AsyncWebServerRequest *request) { bool hasReqArgs = false; @@ -311,7 +312,7 @@ void setup() hasReqArgs = true; } if (request->hasParam("su", true)) { - UNIVERSE = constrain(request->getParam("su", true)->value().toInt(), 1, (unicast_flag)?12:7); + START_UNIVERSE = constrain(request->getParam("su", true)->value().toInt(), 1, (unicast_flag)?12:7); hasReqArgs = true; } if (request->hasParam("uct", true)) { @@ -323,7 +324,7 @@ void setup() writeEEPROM(); hasReqArgs = false; } - request->send(200, "text/html", "LED Count: "+ String(ledCount) + ", Mode: " + String((unicast_flag) ? "unicast" : "multicast") + ", Starting Universe: " + String(UNIVERSE) + ", Universe Count: " + String(UNIVERSE_COUNT) + ""); + request->send(200, "text/html", "LED Count: "+ String(ledCount) + ", Mode: " + String((unicast_flag) ? "unicast" : "multicast") + ", Starting Universe: " + String(START_UNIVERSE) + ", Universe Count: " + String(UNIVERSE_COUNT) + ""); }); server.on("/status", HTTP_GET, [](AsyncWebServerRequest *request) { request->send(200, "text/plain", SKETCH_VERSION); @@ -406,7 +407,7 @@ void loop() uint16_t universe = htons(packet.universe); uint8_t *data = packet.property_values + 1; - if (universe < UNIVERSE || universe > UNIVERSE_COUNT) + if (universe < START_UNIVERSE || universe > UNIVERSE_COUNT) return; //async will take care about filling the buffer #ifdef SERIAL_DEBUG @@ -418,7 +419,7 @@ void loop() packet.property_values[1]); // Dimmer data for Channel 1 #endif - uint16_t multipacketOffset = (universe - UNIVERSE) * 170; //if more than 170 LEDs (510 channels), client will send in next higher universe + uint16_t multipacketOffset = (universe - START_UNIVERSE) * 170; //if more than 170 LEDs (510 channels), client will send in next higher universe if (ledCount <= multipacketOffset) return; uint16_t len = (170 + multipacketOffset > ledCount) ? (ledCount - multipacketOffset) * 3 : 510; From 47f0f7467f14b3ad68451ee607d1bb395ce69944 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Thu, 24 Jan 2019 17:13:12 -0500 Subject: [PATCH 09/18] Convert everything to pointers --- Arduino/E131_PixelPusher/E131_PixelPusher.ino | 478 ++++++++++-------- data/index.htm | 6 +- data/index.min.htm | 2 +- data/index.min.htm.gz | Bin 1383 -> 1384 bytes platformio.ini | 2 +- 5 files changed, 260 insertions(+), 228 deletions(-) diff --git a/Arduino/E131_PixelPusher/E131_PixelPusher.ino b/Arduino/E131_PixelPusher/E131_PixelPusher.ino index d30f4b2..372e937 100644 --- a/Arduino/E131_PixelPusher/E131_PixelPusher.ino +++ b/Arduino/E131_PixelPusher/E131_PixelPusher.ino @@ -1,7 +1,7 @@ #ifdef ESP32 #include #include -#include //https://github.com/me-no-dev/AsyncTCP +#include //https://github.com/me-no-dev/AsyncTCP #include #include #include @@ -10,10 +10,10 @@ #include #include #include -#include //https://github.com/me-no-dev/ESPAsyncTCP -#include //https://github.com/me-no-dev/ESPAsyncUDP +#include //https://github.com/me-no-dev/ESPAsyncTCP +#include //https://github.com/me-no-dev/ESPAsyncUDP #if defined(ESP8266) and (defined(PIO_PLATFORM) or defined(USE_EADNS)) -#include //https://github.com/devyte/ESPAsyncDNSServer +#include //https://github.com/devyte/ESPAsyncDNSServer #else #include #endif @@ -27,174 +27,173 @@ #include #include "version.h" -#define WIFI_HTM_GZ_PROGMEM //comment to serve minimized html instead of gziped version +#define WIFI_HTM_GZ_PROGMEM //comment to serve minimized html instead of gziped version //#define SERIAL_DEBUG //uncomment to see if E1.31 data is received //#define SHOW_FPS_SERIAL //uncomment to see Serial FPS #define HOSTNAME "E131PixelPusher" #define HTTP_PORT 80 -uint8_t START_UNIVERSE = 1; // First DMX Universe to listen for -uint8_t UNIVERSE_COUNT = 7; // Total number of Universes to listen for, starting at START_UNIVERSE max 7 for multicast and 12 for unicast -uint16_t ledCount = 12 * 170; // 170 LEDs per Universe +uint8_t START_UNIVERSE = 1; // First DMX Universe to listen for +uint8_t END_UNIVERSE = 7; // Total number of Universes to listen for, starting at START_UNIVERSE max 7 for multicast and 12 for unicast +uint16_t ledCount = 12 * 170; // 170 LEDs per Universe bool unicast_flag = false; #ifndef WIFI_HTM_GZ_PROGMEM -//size: 3202 +//size: 3195 static const char index_htm[] PROGMEM = R"=====( -

E1.31 Pixel Pusher

Pixels:
Mode:
Start Universe:
Max Universe :

Update Firmware?
+

E1.31 Pixel Pusher

Pixels:
Mode:
Start Universe:
End Universe :

Update Firmware?
)====="; #else -//gziped: 1383 (~57% compression) -#define index_htm_gz_len 1383 +//gziped: 1384 (~57% compression) +#define index_htm_gz_len 1384 static const uint8_t index_htm_gz[] PROGMEM = { - 0x1f, 0x8b, 0x08, 0x00, 0x0d, 0x95, 0x46, 0x5c, 0x00, 0x03, 0xcd, 0x57, - 0x6d, 0x53, 0xe3, 0x36, 0x10, 0xfe, 0x2b, 0x42, 0x4c, 0x99, 0xa4, 0x17, - 0xdb, 0x31, 0x2f, 0x07, 0x38, 0x71, 0xda, 0x3b, 0xca, 0xb5, 0xd7, 0xb9, - 0xe3, 0x98, 0x39, 0xe8, 0x4c, 0xa7, 0x6f, 0x23, 0xdb, 0xeb, 0x58, 0x8d, - 0x2d, 0xb9, 0x92, 0x4c, 0xc8, 0x01, 0xff, 0xbd, 0x2b, 0xcb, 0x0e, 0x81, - 0x1e, 0x57, 0xfa, 0xad, 0x5f, 0x88, 0x25, 0xed, 0xdb, 0xb3, 0xbb, 0x7a, - 0x56, 0x4c, 0xb7, 0xbe, 0xfb, 0x70, 0x72, 0xf1, 0xf3, 0xf9, 0x29, 0x29, - 0x4c, 0x55, 0xce, 0xa6, 0xf6, 0x2f, 0x29, 0x99, 0x98, 0xc7, 0x14, 0x04, - 0xc5, 0x35, 0xb0, 0x6c, 0x36, 0xad, 0xc0, 0x30, 0x14, 0x30, 0xb5, 0x07, - 0x7f, 0x35, 0xfc, 0x2a, 0xa6, 0x27, 0x52, 0x18, 0x10, 0xc6, 0xbb, 0x58, - 0xd5, 0x40, 0x49, 0xea, 0x56, 0x31, 0x35, 0x70, 0x6d, 0x02, 0x6b, 0x62, - 0x42, 0xd2, 0x82, 0x29, 0x0d, 0x26, 0x6e, 0x4c, 0xee, 0x1d, 0xd1, 0xce, - 0x84, 0x60, 0x15, 0xc4, 0xf4, 0x8a, 0xc3, 0xb2, 0x96, 0xca, 0x6c, 0x28, - 0x2e, 0x79, 0x66, 0x8a, 0x38, 0x83, 0x2b, 0x9e, 0x82, 0xd7, 0x2e, 0x50, - 0x45, 0xa7, 0x8a, 0xd7, 0x66, 0x96, 0x37, 0x22, 0x35, 0x5c, 0x0a, 0xf2, - 0x4e, 0xb2, 0xec, 0xb5, 0xcc, 0x56, 0x83, 0xe1, 0xcd, 0x15, 0x53, 0x04, - 0x2d, 0x05, 0x19, 0x33, 0x8c, 0x4e, 0x72, 0x30, 0x69, 0x31, 0x80, 0xd1, - 0x0d, 0x3a, 0x29, 0x64, 0x16, 0xd1, 0xef, 0x4f, 0x2f, 0xe8, 0xdd, 0xd0, - 0x37, 0x05, 0x88, 0x41, 0xaf, 0x3e, 0x80, 0xe1, 0x0d, 0xcf, 0x07, 0xe0, - 0xcb, 0xc5, 0x50, 0x81, 0x69, 0x94, 0x20, 0xe0, 0xff, 0xa9, 0xf1, 0x60, - 0x38, 0x31, 0x85, 0x92, 0x4b, 0x22, 0x60, 0x49, 0x4e, 0x95, 0x92, 0x6a, - 0x40, 0xcf, 0xc0, 0x2c, 0xa5, 0x5a, 0x10, 0x05, 0xba, 0x96, 0x42, 0x03, - 0x59, 0x32, 0x4d, 0x84, 0x34, 0x44, 0x2e, 0x7c, 0x3a, 0xfc, 0x9c, 0x69, - 0x84, 0xa2, 0x65, 0x09, 0x7e, 0x29, 0xe7, 0x03, 0xfa, 0xb1, 0x49, 0x53, - 0xd0, 0x3a, 0xa2, 0xa3, 0x1f, 0x3f, 0x7e, 0x38, 0xf3, 0xb5, 0x51, 0x5c, - 0xcc, 0x79, 0xbe, 0x42, 0xc1, 0xe1, 0x28, 0x93, 0x69, 0x53, 0x21, 0x6a, - 0x7f, 0x0e, 0xe6, 0xb4, 0x04, 0xfb, 0xf9, 0x7a, 0xf5, 0x36, 0x1b, 0xd0, - 0x9a, 0x5f, 0x43, 0x99, 0x1a, 0x3a,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 0x5c, 0xdd, 0xad, 0x0b, 0x88, 0x46, 0x38, 0x56, 0x0c, 0x7e, 0x66, 0xc5, + 0xba, 0x86, 0xcf, 0x08, 0x70, 0x60, 0x9e, 0x96, 0xda, 0x88, 0x6e, 0x20, + 0xe2, 0x30, 0x3c, 0x1e, 0x8e, 0x5c, 0x71, 0x69, 0x2d, 0x78, 0xca, 0xb4, + 0xa1, 0xf1, 0xbd, 0xf2, 0x4c, 0x95, 0xa5, 0x6a, 0xf2, 0xe2, 0x34, 0x76, + 0x76, 0x7a, 0x22, 0xde, 0x1d, 0xee, 0x0f, 0xfb, 0x83, 0xad, 0x1e, 0x4c, + 0xcc, 0xed, 0x2d, 0x66, 0xf9, 0x45, 0x38, 0x8e, 0x87, 0xb7, 0xb7, 0x4d, + 0xe2, 0x9b, 0x65, 0x7f, 0x22, 0xfa, 0xb7, 0xb7, 0xf6, 0x7c, 0x67, 0x87, + 0x15, 0xa0, 0x0c, 0xd6, 0xd7, 0x30, 0x65, 0xb0, 0xa4, 0x04, 0x9d, 0x5c, + 0x01, 0xf6, 0x39, 0x49, 0x99, 0x30, 0x24, 0x01, 0x92, 0xf3, 0x79, 0x0e, + 0x8a, 0x98, 0x9c, 0x61, 0x7b, 0x89, 0x6c, 0x53, 0x66, 0x8b, 0xf6, 0x07, + 0x9d, 0xfd, 0xb5, 0xa5, 0xd3, 0xba, 0x4c, 0x50, 0x5e, 0xce, 0xc8, 0x99, + 0xad, 0xbe, 0x5e, 0x1b, 0x12, 0x30, 0x67, 0x06, 0x15, 0x83, 0x4f, 0xa0, + 0xa4, 0x55, 0x7d, 0x10, 0xd0, 0x5a, 0xff, 0xc4, 0x8a, 0xb3, 0xa6, 0xdb, + 0xac, 0x53, 0x43, 0x4a, 0x26, 0x56, 0x6b, 0x97, 0xda, 0x2a, 0x6e, 0x85, + 0x1b, 0x25, 0x48, 0x59, 0x91, 0x3a, 0x4f, 0x58, 0x81, 0xff, 0xde, 0x89, + 0xcf, 0xa9, 0x83, 0xf7, 0x8c, 0x92, 0xbe, 0x78, 0x10, 0x53, 0x0e, 0xe9, + 0xe2, 0xd2, 0x95, 0x0b, 0xa3, 0x7a, 0x4e, 0xe5, 0x5e, 0x3d, 0x1d, 0x49, + 0xe3, 0xa4, 0x64, 0xd7, 0x31, 0x0d, 0x77, 0xe9, 0xbf, 0xb5, 0x75, 0x27, + 0xd7, 0x8f, 0x9e, 0x63, 0xf0, 0xf0, 0x79, 0xf6, 0x0e, 0x91, 0x21, 0xc6, + 0x41, 0xcb, 0x5e, 0x63, 0x6d, 0x56, 0x05, 0x4c, 0xf0, 0x8a, 0x25, 0x89, + 0x19, 0x24, 0x48, 0x5f, 0x37, 0x96, 0x25, 0x3d, 0xbc, 0x0a, 0x73, 0x11, + 0xa5, 0xa8, 0x0f, 0x6a, 0x94, 0xca, 0x02, 0xaf, 0xcb, 0xf6, 0x6c, 0x36, + 0xbb, 0x6b, 0x05, 0x7d, 0xc3, 0x4d, 0x01, 0x03, 0xe6, 0x34, 0x36, 0xcf, + 0xe7, 0xdc, 0xe4, 0x75, 0x42, 0xd8, 0xa0, 0x95, 0x64, 0xce, 0x5e, 0x06, + 0xa9, 0x54, 0xcc, 0xe6, 0x33, 0x12, 0x52, 0xc0, 0x5d, 0xa3, 0xd7, 0x30, + 0x69, 0x14, 0x0e, 0x87, 0xdf, 0x8c, 0x72, 0xc0, 0xce, 0x34, 0xee, 0xbb, + 0x64, 0x6a, 0xce, 0x45, 0xc4, 0x6a, 0x23, 0x47, 0x09, 0x4b, 0x17, 0x73, + 0x25, 0x6b, 0x91, 0x79, 0xad, 0x97, 0xf4, 0x65, 0xb2, 0x97, 0xed, 0x8f, + 0x66, 0xc8, 0xcd, 0xde, 0x8c, 0x95, 0xbc, 0x58, 0x45, 0x9a, 0x09, 0xed, + 0x69, 0x50, 0x7c, 0x36, 0xf2, 0x96, 0x90, 0x2c, 0xb8, 0xf1, 0x12, 0x79, + 0xed, 0x69, 0xfe, 0x09, 0x1b, 0x3c,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x25, 0x53, + 0xf0, 0x6a, 0x1c, 0x30, 0x27, 0x69, 0xef, 0x5f, 0xeb, 0xca, 0x5d, 0x75, + 0x7a, 0xaf, 0x6d, 0x9f, 0xf6, 0x3a, 0x0a, 0x02, 0x77, 0xe0, 0xa7, 0xb2, + 0x0c, 0x32, 0x48, 0x34, 0xcb, 0xeb, 0x60, 0x1a, 0xee, 0x85, 0x7f, 0x36, + 0x71, 0xbb, 0x1b, 0x69, 0x6f, 0xe9, 0xc3, 0x1d, 0x92, 0xac, 0xc8, 0x77, + 0xad, 0x78, 0xe3, 0xcd, 0x45, 0xd7, 0xcd, 0xbf, 0xf5, 0x20, 0x0c, 0x2c, + 0x37, 0x58, 0xa2, 0xb0, 0xff, 0x68, 0xfc, 0x03, 0x01, 0x5c, 0xa4, 0x8b, + 0x78, 0x0c, 0x00, 0x00}; #endif //ESPAsyncE131 pointer -ESPAsyncE131* e131; +ESPAsyncE131 *e131; AsyncWebServer server(HTTP_PORT); #ifdef ESP32 - //#define PIN 2 //Use any pin under 32 - //NeoEsp32BitBangWs2813Method dma = NeoEsp32BitBangWs2813Method(PIN, ledCount, 3); - - //APA102/DotStar - //Hardware SPI method: GPIO18 is CLK, GPIO23 is DATA - DotStarSpiMethod dma = DotStarSpiMethod(ledCount, 3); - // - //Software SPI method: Any pin can be clock and data - //#define PIN_CLK 18 - //#define PIN_DATA 23 - //DotStarMethod dma = DotStarMethod(PIN_CLK, PIN_DATA, ledCount, 3); - +//#define PIN 2 //Use any pin under 32 +//NeoEsp32BitBangWs2813Method* dma; + +//APA102/DotStar +//Hardware SPI method: GPIO18 is CLK, GPIO23 is DATA +DotStarSpiMethod *dma; +// +//Software SPI method: Any pin can be clock and data +//#define PIN_CLK 18 +//#define PIN_DATA 23 +//DotStarMethod* dma; + #elif defined(ESP8266) - NeoEsp8266Dma800KbpsMethod dma = NeoEsp8266Dma800KbpsMethod(ledCount, 3); //uses RX/GPIO3 pin - - //APA102/DotStar - //Hardware SPI method: GPIO14 is CLK, GPIO13 is DATA - //DotStarSpiMethod dma = DotStarSpiMethod(ledCount, 3); - // - //Software SPI method: Any pin can be clock and data - //#define PIN_CLK 14 - //#define PIN_DATA 13 - //DotStarMethod dma = DotStarMethod(PIN_CLK, PIN_DATA, ledCount, 3); +NeoEsp8266Dma800KbpsMethod *dma; //uses RX/GPIO3 pin + +//APA102/DotStar +//Hardware SPI method: GPIO14 is CLK, GPIO13 is DATA +//DotStarSpiMethod* dma; +// +//Software SPI method: Any pin can be clock and data +//#define PIN_CLK 14 +//#define PIN_DATA 13 +//DotStarMethod* dma; #endif #if defined(ESP8266) and (defined(PIO_PLATFORM) or defined(USE_EADNS)) @@ -203,15 +202,16 @@ AsyncDNSServer dns; DNSServer dns; #endif -struct { +struct +{ bool unicast = false; uint16_t startUniverse = START_UNIVERSE; - uint16_t noOfUniverses = UNIVERSE_COUNT; + uint16_t noOfUniverses = END_UNIVERSE; } config; int eeprom_addr = 0; -uint8_t *pixel = (uint8_t *)malloc(dma.getPixelsSize()); +uint8_t *pixel = (uint8_t *)malloc(ledCount); #ifdef SHOW_FPS_SERIAL uint64_t frameCt = 0; @@ -222,33 +222,59 @@ float interval = 10 * 1000.0; // 10s bool shouldReboot = false; const char update_html[] PROGMEM = "Firmware Update

Update Firmware


"; -void initE131(void){ - uint8_t TOTAL_UNIVERSES = (UNIVERSE_COUNT - START_UNIVERSE + 1); +void initDMA(void) +{ + if (dma) + { + delete dma; + } +#ifdef ESP32 + //dma = new NeoEsp32BitBangWs2813Method(PIN, ledCount, 3); + dma = new DotStarSpiMethod(ledCount, 3); + //dma = new DotStarMethod(PIN_CLK, PIN_DATA, ledCount, 3); + +#elif defined(ESP8266) + dma = new NeoEsp8266Dma800KbpsMethod(ledCount, 3); + //dma = new DotStarSpiMethod(ledCount, 3); + //dma = new DotStarMethod(PIN_CLK, PIN_DATA, ledCount, 3); +#endif + dma->Initialize(); + pixel = (uint8_t *)realloc(pixel, ledCount); +} + +void initE131(void) +{ + uint8_t TOTAL_UNIVERSES = (END_UNIVERSE - START_UNIVERSE + 1); ledCount = TOTAL_UNIVERSES * 170; + initDMA(); + if (e131) + delete e131; e131 = new ESPAsyncE131(TOTAL_UNIVERSES); - if (e131->begin((unicast_flag) ? E131_UNICAST : E131_MULTICAST, START_UNIVERSE, UNIVERSE_COUNT)) // Listen via Unicast/Multicast + if (e131->begin((unicast_flag) ? E131_UNICAST : E131_MULTICAST, START_UNIVERSE, END_UNIVERSE)) // Listen via Unicast/Multicast Serial.println(F(">>> Listening for E1.31 data...")); else Serial.println(F(">>> e131.begin failed :(")); } -void readEEPROM(void){ +void readEEPROM(void) +{ EEPROM.get(eeprom_addr, config); unicast_flag = config.unicast; START_UNIVERSE = config.startUniverse; - UNIVERSE_COUNT = config.noOfUniverses; - #ifdef SERIAL_DEBUG - Serial.printf("READ>> Mode: %s Start Universe: %d No of Universes: %d", (unicast_flag)?"unicast":"multicast", START_UNIVERSE, UNIVERSE_COUNT); - #endif + END_UNIVERSE = config.noOfUniverses; +#ifdef SERIAL_DEBUG + Serial.printf("READ>> Mode: %s Start Universe: %d No of Universes: %d", (unicast_flag) ? "unicast" : "multicast", START_UNIVERSE, END_UNIVERSE); +#endif } -void writeEEPROM(void){ +void writeEEPROM(void) +{ config.unicast = unicast_flag; config.startUniverse = START_UNIVERSE; - config.noOfUniverses = UNIVERSE_COUNT; - #ifdef SERIAL_DEBUG - Serial.printf("WRITE>> Mode: %s Start Universe: %d No of Universes: %d", (unicast_flag)?"unicast":"multicast", START_UNIVERSE, UNIVERSE_COUNT); - #endif + config.noOfUniverses = END_UNIVERSE; +#ifdef SERIAL_DEBUG + Serial.printf("WRITE>> Mode: %s Start Universe: %d No of Universes: %d", (unicast_flag) ? "unicast" : "multicast", START_UNIVERSE, END_UNIVERSE); +#endif EEPROM.put(eeprom_addr, config); EEPROM.commit(); } @@ -264,26 +290,26 @@ void setup() readEEPROM(); char NameChipId[64] = {0}, chipId[9] = {0}; - #ifdef ESP32 - Serial.print("Hardware SPI //DATA PIN: "); - Serial.println(MOSI); //GPIO23? - Serial.print("Hardware SPI //CLOCK PIN: "); - Serial.println(SCK); //GPIO18? - snprintf(chipId, sizeof(chipId), "%08x", (uint32_t)ESP.getEfuseMac()); - snprintf(NameChipId, sizeof(NameChipId), "%s_%08x", HOSTNAME, (uint32_t)ESP.getEfuseMac()); - - WiFi.mode(WIFI_STA); // Make sure you're in station mode - WiFi.setHostname(const_cast(NameChipId)); - AsyncWiFiManager wifiManager(&server, &dns); - #else - snprintf(chipId, sizeof(chipId), "%06x", ESP.getChipId()); - snprintf(NameChipId, sizeof(NameChipId), "%s_%06x", HOSTNAME, ESP.getChipId()); - - WiFi.mode(WIFI_STA); // Make sure you're in station mode - WiFi.hostname(const_cast(NameChipId)); - AsyncWiFiManager wifiManager(&server, &dns); //Local intialization. Once its business is done, there is no need to keep it around - #endif - wifiManager.setConfigPortalTimeout(180); //sets timeout until configuration portal gets turned off, useful to make it all retry or go to sleep in seconds +#ifdef ESP32 + Serial.print("Hardware SPI //DATA PIN: "); + Serial.println(MOSI); //GPIO23? + Serial.print("Hardware SPI //CLOCK PIN: "); + Serial.println(SCK); //GPIO18? + snprintf(chipId, sizeof(chipId), "%08x", (uint32_t)ESP.getEfuseMac()); + snprintf(NameChipId, sizeof(NameChipId), "%s_%08x", HOSTNAME, (uint32_t)ESP.getEfuseMac()); + + WiFi.mode(WIFI_STA); // Make sure you're in station mode + WiFi.setHostname(const_cast(NameChipId)); + AsyncWiFiManager wifiManager(&server, &dns); +#else + snprintf(chipId, sizeof(chipId), "%06x", ESP.getChipId()); + snprintf(NameChipId, sizeof(NameChipId), "%s_%06x", HOSTNAME, ESP.getChipId()); + + WiFi.mode(WIFI_STA); // Make sure you're in station mode + WiFi.hostname(const_cast(NameChipId)); + AsyncWiFiManager wifiManager(&server, &dns); //Local intialization. Once its business is done, there is no need to keep it around +#endif + wifiManager.setConfigPortalTimeout(180); //sets timeout until configuration portal gets turned off, useful to make it all retry or go to sleep in seconds if (!wifiManager.autoConnect(NameChipId)) { Serial.println("Failed to connect and hit timeout"); @@ -294,37 +320,41 @@ void setup() Serial.println(WiFi.localIP()); server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) { - #ifdef WIFI_HTM_GZ_PROGMEM +#ifdef WIFI_HTM_GZ_PROGMEM AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", index_htm_gz, index_htm_gz_len); response->addHeader("Content-Encoding", "gzip"); request->send(response); - #else +#else request->send_P(200, "text/html", index_htm); - #endif +#endif }); server.on("/data", HTTP_GET, [](AsyncWebServerRequest *request) { - request->send(200, "application/json", "{\"ct\":" + String(ledCount) + ",\"mode\":\"" + String((unicast_flag) ? "unicast" : "multicast") + "\",\"su\":" + String(START_UNIVERSE) + ",\"uct\":" + String(UNIVERSE_COUNT) + "}"); + request->send(200, "application/json", "{\"ct\":" + String(ledCount) + ",\"mode\":\"" + String((unicast_flag) ? "unicast" : "multicast") + "\",\"su\":" + String(START_UNIVERSE) + ",\"uct\":" + String(END_UNIVERSE - START_UNIVERSE + 1) + "}"); }); server.on("/updateparams", HTTP_POST, [](AsyncWebServerRequest *request) { bool hasReqArgs = false; - if (request->hasParam("pixelct", true)) { + if (request->hasParam("pixelct", true)) + { unicast_flag = (request->getParam("mode", true)->value() == "unicast") ? true : false; hasReqArgs = true; } - if (request->hasParam("su", true)) { - START_UNIVERSE = constrain(request->getParam("su", true)->value().toInt(), 1, (unicast_flag)?12:7); + if (request->hasParam("su", true)) + { + START_UNIVERSE = constrain(request->getParam("su", true)->value().toInt(), 1, (unicast_flag) ? 12 : 7); hasReqArgs = true; } - if (request->hasParam("uct", true)) { - UNIVERSE_COUNT = constrain(request->getParam("uct", true)->value().toInt(), 1, (unicast_flag)?12:7); + if (request->hasParam("uct", true)) + { + END_UNIVERSE = constrain(request->getParam("uct", true)->value().toInt(), 1, (unicast_flag) ? 12 : 7); hasReqArgs = true; } - if (hasReqArgs){ + if (hasReqArgs) + { initE131(); writeEEPROM(); hasReqArgs = false; } - request->send(200, "text/html", "LED Count: "+ String(ledCount) + ", Mode: " + String((unicast_flag) ? "unicast" : "multicast") + ", Starting Universe: " + String(START_UNIVERSE) + ", Universe Count: " + String(UNIVERSE_COUNT) + ""); + request->send(200, "text/html", "LED Count: " + String(ledCount) + ", Mode: " + String((unicast_flag) ? "unicast" : "multicast") + ", Starting Universe: " + String(START_UNIVERSE) + ", Universe Count: " + String(END_UNIVERSE - START_UNIVERSE + 1) + ""); }); server.on("/status", HTTP_GET, [](AsyncWebServerRequest *request) { request->send(200, "text/plain", SKETCH_VERSION); @@ -337,19 +367,18 @@ void setup() shouldReboot = !Update.hasError(); AsyncWebServerResponse *response = request->beginResponse(200, "text/html", shouldReboot ? "Update Success, rebooting..." : "FAIL"); response->addHeader("Connection", "close"); - request->send(response); - }, [](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) { + request->send(response); }, [](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) { if (!filename.endsWith(".bin")) { return; } if(!index){ if(Serial) Serial.printf("Update Start: %s\n", filename.c_str()); - #ifdef ESP32 +#ifdef ESP32 uint32_t maxSketchSpace = len; // for ESP32 you just supply the length of file - #elif defined(ESP8266) +#elif defined(ESP8266) Update.runAsync(true); // There is no async for ESP32 uint32_t maxSketchSpace = ((ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000); - #endif +#endif if(!Update.begin(maxSketchSpace)) { if(Serial) Update.printError(Serial); } @@ -368,16 +397,19 @@ void setup() } }); MDNS.setInstanceName(String(HOSTNAME " (" + String(chipId) + ")").c_str()); - if (MDNS.begin(NameChipId)) { + if (MDNS.begin(NameChipId)) + { MDNS.addService("http", "tcp", HTTP_PORT); MDNS.addService("e131", "udp", E131_DEFAULT_PORT); - #ifndef ARDUINO_ESP8266_RELEASE_2_4_2 +#ifndef ARDUINO_ESP8266_RELEASE_2_4_2 MDNS.addServiceTxt("e131", "udp", "CID", String(chipId)); MDNS.addServiceTxt("e131", "udp", "Model", "E131_PixelPusher"); MDNS.addServiceTxt("e131", "udp", "Manuf", "debsahu"); - #endif +#endif Serial.printf(">>> MDNS Started: http://%s.local/\n", NameChipId); - } else { + } + else + { Serial.println(F(">>> Error setting up mDNS responder <<<")); } @@ -389,15 +421,14 @@ void setup() #if !defined(SHOW_FPS_SERIAL) or !defined(SERIAL_DEBUG) Serial.end(); #endif - dma.Initialize(); memset(pixel, 0, sizeof(pixel)); } void loop() { - #ifdef ESP8266 - MDNS.update(); - #endif +#ifdef ESP8266 + MDNS.update(); +#endif if (!e131->isEmpty()) { @@ -407,17 +438,17 @@ void loop() uint16_t universe = htons(packet.universe); uint8_t *data = packet.property_values + 1; - if (universe < START_UNIVERSE || universe > UNIVERSE_COUNT) + if (universe < START_UNIVERSE || universe > END_UNIVERSE) return; //async will take care about filling the buffer - #ifdef SERIAL_DEBUG +#ifdef SERIAL_DEBUG Serial.printf("Universe %u / %u Channels | Packet#: %u / Errors: %u / CH1: %u\n", htons(packet.universe), // The Universe for this packet htons(packet.property_value_count) - 1, // Start code is ignored, we're interested in dimmer data - e131->stats.num_packets, // Packet counter - e131->stats.packet_errors, // Packet error counter + e131->stats.num_packets, // Packet counter + e131->stats.packet_errors, // Packet error counter packet.property_values[1]); // Dimmer data for Channel 1 - #endif +#endif uint16_t multipacketOffset = (universe - START_UNIVERSE) * 170; //if more than 170 LEDs (510 channels), client will send in next higher universe if (ledCount <= multipacketOffset) @@ -426,10 +457,10 @@ void loop() memcpy(pixel + multipacketOffset * 3, data, len); // Burden on source to send in correct color order } - if (dma.IsReadyToUpdate()) + if (dma->IsReadyToUpdate()) { - memcpy(dma.getPixels(), pixel, dma.getPixelsSize()); - dma.Update(); + memcpy(dma->getPixels(), pixel, dma->getPixelsSize()); + dma->Update(); #ifdef SHOW_FPS_SERIAL frameCt++; #endif @@ -444,10 +475,11 @@ void loop() } #endif - if(shouldReboot) { - #ifdef SHOW_FPS_SERIAL + if (shouldReboot) + { +#ifdef SHOW_FPS_SERIAL Serial.println("Rebooting..."); - #endif +#endif delay(100); ESP.restart(); } diff --git a/data/index.htm b/data/index.htm index bc48400..347c1e6 100644 --- a/data/index.htm +++ b/data/index.htm @@ -31,7 +31,7 @@ var maxUniverse = 170 * 7; if(document.frmmr.mode.value == "unicast") maxUniverse = 170 * 12; if( suval > uctval || (uctval - suval + 1) <= 0 || 170 * (uctval - suval + 1) > maxUniverse) { - if(suval > uctval) alert("Starting universe cant be higher than total number of universes!"); + if(suval > uctval) alert("Starting universe cant be higher than ending universe!"); if(uctval - suval + 1 <= 0) alert("Number of Pixels cant be negative/zero!"); if(170 * (uctval - suval + 1) > maxUniverse) alert("Cant access that many universes!"); return false; @@ -133,9 +133,9 @@

E1.31 Pixel Pusher


- Start Universe: + Start Universe:
- Max Universe : + End Universe :
diff --git a/data/index.min.htm b/data/index.min.htm index e89743e..c52823a 100644 --- a/data/index.min.htm +++ b/data/index.min.htm @@ -1 +1 @@ -

E1.31 Pixel Pusher

Pixels:
Mode:
Start Universe:
Max Universe :

Update Firmware?
\ No newline at end of file +

E1.31 Pixel Pusher

Pixels:
Mode:
Start Universe:
End Universe :

Update Firmware?
\ No newline at end of file diff --git a/data/index.min.htm.gz b/data/index.min.htm.gz index ec26705752eafcdb95fb3ea443f1ebb80d6eb7c8..73c71b37ead54292cc37a2b5b539f46d6a8acba8 100644 GIT binary patch literal 1384 zcmV-u1(*6CiwFStGfG?l1I1TuQ{y%e{wqREnWPunF)s%=ajthX*Iwt2V+QC?*ZeA`CsG&?#=BTmKuPLWF*R^)0&8MK(wr#`Ca%rQJEE-#!Agkf z6^CUdmDx~S^33FM23I@n%b!t5Db^Rjzihe0G zK;hFgB7DGH-K`6VMmSaserCnG zhR+CaV4jxRh;AU_FgzZPTybeFc*?Y)@xAg)m8EL(;xu-4dLrH(?hpHetsYFw?JZ{c zML3R!x3^8=n`M6@`nR|Cd}oIhpbXa6FlDf$1f5&~_BlzJFeCwz^LY-6n4DpIiELA5 zi}nYd{k5gjx=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yN>pXKHMS6ihSFNx87WI{qS2)!N3xOWeNNL#@{$`)pLIg002%!x=;WB diff --git a/platformio.ini b/platformio.ini index 76e02f9..beb3968 100644 --- a/platformio.ini +++ b/platformio.ini @@ -12,7 +12,7 @@ monitor_speed = 115200 upload_speed = 115200 lib_deps = ESPAsyncE131=https://github.com/forkineye/ESPAsyncE131 - NeoPixelBus + NeoPixelBus=https://github.com/Makuna/NeoPixelBus ESP Async WebServer ESPAsyncWiFiManager From 6b5c88fc82a5fcb985beb34ec464f6ed96680d04 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Mon, 28 Jan 2019 01:32:31 -0500 Subject: [PATCH 10/18] minor fixes - MDNS.setInstanceName still crashing - fix dropdown name/value - use first char to check EEPROM is first time being written --- Arduino/E131_PixelPusher/E131_PixelPusher.ino | 289 +++++++++--------- data/index.htm | 2 +- data/index.min.htm | 2 +- data/index.min.htm.gz | Bin 1384 -> 1385 bytes 4 files changed, 154 insertions(+), 139 deletions(-) diff --git a/Arduino/E131_PixelPusher/E131_PixelPusher.ino b/Arduino/E131_PixelPusher/E131_PixelPusher.ino index 372e937..3341da3 100644 --- a/Arduino/E131_PixelPusher/E131_PixelPusher.ino +++ b/Arduino/E131_PixelPusher/E131_PixelPusher.ino @@ -42,128 +42,129 @@ bool unicast_flag = false; #ifndef WIFI_HTM_GZ_PROGMEM //size: 3195 static const char index_htm[] PROGMEM = R"=====( -

E1.31 Pixel Pusher

Pixels:
Mode:
Start Universe:
End Universe :

Update Firmware?
+

E1.31 Pixel Pusher

Pixels:
Mode:
Start Universe:
End Universe :

Update Firmware?
)====="; #else -//gziped: 1384 (~57% compression) -#define index_htm_gz_len 1384 +//gziped: 1385 (~57% compression) +#define index_htm_gz_len 1385 static const uint8_t index_htm_gz[] PROGMEM = { - 0x1f, 0x8b, 0x08, 0x00, 0xf8, 0x33, 0x4a, 0x5c, 0x00, 0x03, 0xc5, 0x57, - 0x6d, 0x53, 0xe3, 0x36, 0x10, 0xfe, 0x2b, 0x42, 0x4c, 0x99, 0xa4, 0x17, - 0xdb, 0x31, 0x2f, 0x07, 0x38, 0x71, 0xae, 0x77, 0x34, 0xd7, 0x5e, 0xe7, - 0x8e, 0x63, 0x06, 0xe8, 0x4c, 0xa7, 0x6f, 0x23, 0xdb, 0x9b, 0x58, 0x8d, - 0x2d, 0xb9, 0x92, 0x4c, 0xc8, 0x01, 0xff, 0xbd, 0x2b, 0xcb, 0x0e, 0x81, - 0x3b, 0xae, 0xf4, 0x53, 0xbf, 0x10, 0x4b, 0xda, 0xb7, 0x67, 0x77, 0xf5, - 0xac, 0x18, 0x6f, 0x7d, 0xff, 0xf1, 0xe4, 0xe2, 0x97, 0xb3, 0x29, 0xc9, - 0x4d, 0x59, 0x4c, 0xc6, 0xf6, 0x2f, 0x29, 0x98, 0x98, 0xc7, 0x14, 0x04, - 0xc5, 0x35, 0xb0, 0x6c, 0x32, 0x2e, 0xc1, 0x30, 0x14, 0x30, 0x95, 0x07, - 0x7f, 0xd7, 0xfc, 0x2a, 0xa6, 0x27, 0x52, 0x18, 0x10, 0xc6, 0xbb, 0x58, - 0x55, 0x40, 0x49, 0xea, 0x56, 0x31, 0x35, 0x70, 0x6d, 0x02, 0x6b, 0x62, - 0x44, 0xd2, 0x9c, 0x29, 0x0d, 0x26, 0xae, 0xcd, 0xcc, 0x3b, 0xa2, 0xad, - 0x09, 0xc1, 0x4a, 0x88, 0xe9, 0x15, 0x87, 0x65, 0x25, 0x95, 0xd9, 0x50, - 0x5c, 0xf2, 0xcc, 0xe4, 0x71, 0x06, 0x57, 0x3c, 0x05, 0xaf, 0x59, 0xa0, - 0x8a, 0x4e, 0x15, 0xaf, 0xcc, 0x64, 0x56, 0x8b, 0xd4, 0x70, 0x29, 0xc8, - 0x7b, 0xc9, 0xb2, 0x37, 0x32, 0x5b, 0xf5, 0xfa, 0x37, 0x57, 0x4c, 0x11, - 0xb4, 0x14, 0x64, 0xcc, 0x30, 0x3a, 0x9a, 0x81, 0x49, 0xf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, 0x85, - 0x1b, 0x25, 0x48, 0x59, 0x91, 0x3a, 0x4f, 0x58, 0x81, 0xff, 0xde, 0x89, - 0xcf, 0xa9, 0x83, 0xf7, 0x8c, 0x92, 0xbe, 0x78, 0x10, 0x53, 0x0e, 0xe9, - 0xe2, 0xd2, 0x95, 0x0b, 0xa3, 0x7a, 0x4e, 0xe5, 0x5e, 0x3d, 0x1d, 0x49, - 0xe3, 0xa4, 0x64, 0xd7, 0x31, 0x0d, 0x77, 0xe9, 0xbf, 0xb5, 0x75, 0x27, - 0xd7, 0x8f, 0x9e, 0x63, 0xf0, 0xf0, 0x79, 0xf6, 0x0e, 0x91, 0x21, 0xc6, - 0x41, 0xcb, 0x5e, 0x63, 0x6d, 0x56, 0x05, 0x4c, 0xf0, 0x8a, 0x25, 0x89, - 0x19, 0x24, 0x48, 0x5f, 0x37, 0x96, 0x25, 0x3d, 0xbc, 0x0a, 0x73, 0x11, - 0xa5, 0xa8, 0x0f, 0x6a, 0x94, 0xca, 0x02, 0xaf, 0xcb, 0xf6, 0x6c, 0x36, - 0xbb, 0x6b, 0x05, 0x7d, 0xc3, 0x4d, 0x01, 0x03, 0xe6, 0x34, 0x36, 0xcf, - 0xe7, 0xdc, 0xe4, 0x75, 0x42, 0xd8, 0xa0, 0x95, 0x64, 0xce, 0x5e, 0x06, - 0xa9, 0x54, 0xcc, 0xe6, 0x33, 0x12, 0x52, 0xc0, 0x5d, 0xa3, 0xd7, 0x30, - 0x69, 0x14, 0x0e, 0x87, 0xdf, 0x8c, 0x72, 0xc0, 0xce, 0x34, 0xee, 0xbb, - 0x64, 0x6a, 0xce, 0x45, 0xc4, 0x6a, 0x23, 0x47, 0x09, 0x4b, 0x17, 0x73, - 0x25, 0x6b, 0x91, 0x79, 0xad, 0x97, 0xf4, 0x65, 0xb2, 0x97, 0xed, 0x8f, - 0x66, 0xc8, 0xcd, 0xde, 0x8c, 0x95, 0xbc, 0x58, 0x45, 0x9a, 0x09, 0xed, - 0x69, 0x50, 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xf0, 0x8a, 0x25, 0x89, + 0x19, 0x24, 0x48, 0x5f, 0x37, 0x96, 0x25, 0x3d, 0xbc, 0x0a, 0x73, 0x11, + 0xa5, 0xa8, 0x0f, 0x6a, 0x94, 0xca, 0x02, 0xaf, 0xcb, 0xf6, 0x6c, 0x36, + 0xbb, 0x6b, 0x05, 0x7d, 0xc3, 0x4d, 0x01, 0x03, 0xe6, 0x34, 0x36, 0xcf, + 0xe7, 0xdc, 0xe4, 0x75, 0x42, 0xd8, 0xa0, 0x95, 0x64, 0xce, 0x5e, 0x06, + 0xa9, 0x54, 0xcc, 0xe6, 0x33, 0x12, 0x52, 0xc0, 0x5d, 0xa3, 0xd7, 0x30, + 0x69, 0x14, 0x0e, 0x87, 0xdf, 0x8c, 0x72, 0xc0, 0xce, 0x34, 0xee, 0xbb, + 0x64, 0x6a, 0xce, 0x45, 0xc4, 0x6a, 0x23, 0x47, 0x09, 0x4b, 0x17, 0x73, + 0x25, 0x6b, 0x91, 0x79, 0xad, 0x97, 0xf4, 0x65, 0xb2, 0x97, 0xed, 0x8f, + 0x66, 0xc8, 0xcd, 0xde, 0x8c, 0x95, 0xbc, 0x58, 0x45, 0x9a, 0x09, 0xed, + 0x69, 0x50, 0x7c, 0x36, 0xf2, 0x96, 0x90, 0x2c, 0xb8, 0xf1, 0x12, 0x79, + 0xed, 0x69, 0xfe, 0x09, 0x1b, 0x3c, 0x4a, 0xa4, 0xca, 0x40, 0xd9, 0x9d, + 0x91, 0x57, 0xca, 0x4f, 0x4f, 0x1c, 0x7d, 0x71, 0xf7, 0x6e, 0x7b, 0xa9, + 0x58, 0x55, 0x81, 0x6a, 0x43, 0xdd, 0x3d, 0x18, 0x56, 0xd7, 0x5d, 0xac, + 0xbb, 0x87, 0x76, 0xe1, 0x84, 0xa3, 0xdd, 0xea, 0x9a, 0x20, 0xc3, 0xf0, + 0x8c, 0x6c, 0x1f, 0x1d, 0xec, 0x85, 0x27, 0x2f, 0xdb, 0x03, 0x4f, 0xb1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9b, 0x8b, 0xae, 0x1b, 0x80, 0xeb, 0x49, 0x18, + 0x58, 0x72, 0xb0, 0x4c, 0x61, 0xff, 0xd3, 0xf8, 0x07, 0xce, 0x1f, 0x2f, + 0x41, 0x79, 0x0c, 0x00, 0x00 +}; #endif //ESPAsyncE131 pointer @@ -206,12 +207,12 @@ struct { bool unicast = false; uint16_t startUniverse = START_UNIVERSE; - uint16_t noOfUniverses = END_UNIVERSE; + uint16_t endUniverse = END_UNIVERSE; } config; int eeprom_addr = 0; -uint8_t *pixel = (uint8_t *)malloc(ledCount); +uint8_t *pixel; #ifdef SHOW_FPS_SERIAL uint64_t frameCt = 0; @@ -220,6 +221,7 @@ float interval = 10 * 1000.0; // 10s #endif bool shouldReboot = false; +bool updatedParams = false; const char update_html[] PROGMEM = "Firmware Update

Update Firmware


"; void initDMA(void) @@ -227,6 +229,7 @@ void initDMA(void) if (dma) { delete dma; + delete pixel; } #ifdef ESP32 //dma = new NeoEsp32BitBangWs2813Method(PIN, ledCount, 3); @@ -239,18 +242,18 @@ void initDMA(void) //dma = new DotStarMethod(PIN_CLK, PIN_DATA, ledCount, 3); #endif dma->Initialize(); - pixel = (uint8_t *)realloc(pixel, ledCount); + pixel = (uint8_t *)malloc(ledCount); } void initE131(void) { uint8_t TOTAL_UNIVERSES = (END_UNIVERSE - START_UNIVERSE + 1); ledCount = TOTAL_UNIVERSES * 170; - initDMA(); if (e131) delete e131; + initDMA(); e131 = new ESPAsyncE131(TOTAL_UNIVERSES); - if (e131->begin((unicast_flag) ? E131_UNICAST : E131_MULTICAST, START_UNIVERSE, END_UNIVERSE)) // Listen via Unicast/Multicast + if (e131->begin((unicast_flag) ? E131_UNICAST : E131_MULTICAST, START_UNIVERSE, TOTAL_UNIVERSES)) // Listen via Unicast/Multicast Serial.println(F(">>> Listening for E1.31 data...")); else Serial.println(F(">>> e131.begin failed :(")); @@ -258,24 +261,30 @@ void initE131(void) void readEEPROM(void) { - EEPROM.get(eeprom_addr, config); - unicast_flag = config.unicast; - START_UNIVERSE = config.startUniverse; - END_UNIVERSE = config.noOfUniverses; + char eeprominit = char(EEPROM.read(eeprom_addr)); + if (eeprominit != 'w') { + EEPROM.write(eeprom_addr, 'w'); + writeEEPROM(); + } else { + EEPROM.get(eeprom_addr + 1, config); + unicast_flag = config.unicast; + START_UNIVERSE = config.startUniverse; + END_UNIVERSE = config.endUniverse; #ifdef SERIAL_DEBUG - Serial.printf("READ>> Mode: %s Start Universe: %d No of Universes: %d", (unicast_flag) ? "unicast" : "multicast", START_UNIVERSE, END_UNIVERSE); + Serial.printf("READ>> Mode: %s Start Universe: %d End Universe: %d\n", (unicast_flag) ? "unicast" : "multicast", START_UNIVERSE, END_UNIVERSE); #endif + } } void writeEEPROM(void) { config.unicast = unicast_flag; config.startUniverse = START_UNIVERSE; - config.noOfUniverses = END_UNIVERSE; + config.endUniverse = END_UNIVERSE; #ifdef SERIAL_DEBUG - Serial.printf("WRITE>> Mode: %s Start Universe: %d No of Universes: %d", (unicast_flag) ? "unicast" : "multicast", START_UNIVERSE, END_UNIVERSE); + Serial.printf("WRITE>> Mode: %s Start Universe: %d End Universe: %d\n", (unicast_flag) ? "unicast" : "multicast", START_UNIVERSE, END_UNIVERSE); #endif - EEPROM.put(eeprom_addr, config); + EEPROM.put(eeprom_addr + 1, config); EEPROM.commit(); } @@ -333,7 +342,7 @@ void setup() }); server.on("/updateparams", HTTP_POST, [](AsyncWebServerRequest *request) { bool hasReqArgs = false; - if (request->hasParam("pixelct", true)) + if (request->hasParam("mode", true)) { unicast_flag = (request->getParam("mode", true)->value() == "unicast") ? true : false; hasReqArgs = true; @@ -350,8 +359,7 @@ void setup() } if (hasReqArgs) { - initE131(); - writeEEPROM(); + updatedParams = true; hasReqArgs = false; } request->send(200, "text/html", "LED Count: " + String(ledCount) + ", Mode: " + String((unicast_flag) ? "unicast" : "multicast") + ", Starting Universe: " + String(START_UNIVERSE) + ", Universe Count: " + String(END_UNIVERSE - START_UNIVERSE + 1) + ""); @@ -395,8 +403,9 @@ void setup() if(Serial) Update.printError(Serial); } } }); - +#if !(defined(ARDUINO_ESP8266_RELEASE_2_5_0_BETA3) or defined(ARDUINO_ESP8266_GIT_DESC)) MDNS.setInstanceName(String(HOSTNAME " (" + String(chipId) + ")").c_str()); +#endif if (MDNS.begin(NameChipId)) { MDNS.addService("http", "tcp", HTTP_PORT); @@ -430,6 +439,12 @@ void loop() MDNS.update(); #endif + if (updatedParams) { + initE131(); + writeEEPROM(); + updatedParams = false; + } + if (!e131->isEmpty()) { e131_packet_t packet; @@ -483,4 +498,4 @@ void loop() delay(100); ESP.restart(); } -} \ No newline at end of file +} diff --git a/data/index.htm b/data/index.htm index 347c1e6..f17abbd 100644 --- a/data/index.htm +++ b/data/index.htm @@ -130,7 +130,7 @@

E1.31 Pixel Pusher

Mode:
Start Universe: diff --git a/data/index.min.htm b/data/index.min.htm index c52823a..5b99c5a 100644 --- a/data/index.min.htm +++ b/data/index.min.htm @@ -1 +1 @@ -

E1.31 Pixel Pusher

Pixels:
Mode:
Start Universe:
End Universe :

Update Firmware?
\ No newline at end of file +

E1.31 Pixel Pusher

Pixels:
Mode:
Start Universe:
End Universe :

Update Firmware?
\ No newline at end of file diff --git a/data/index.min.htm.gz b/data/index.min.htm.gz index 73c71b37ead54292cc37a2b5b539f46d6a8acba8..833f31d1172675eb8f4de2a7b7f4c24de11bb7fc 100644 GIT binary patch delta 271 zcmV+q0r39l3h4?5ABzY8@1Rbx2W13*agxNjg>3TS^8LjlrNA9FK{nHgT(&a+A#qXF zE?nfYHdy;*@bwl`(TpHUu;)_9Wr3X%e?H+b%`I1wl4E*9i*y02y2A41T(>WT`%hm% zW3d870lM{j{Vg9lDAxyOQzt}IABiF zUclCsyX*8`+rI5}6a?004^Ukaz$9 delta 270 zcmV+p0rCFn3g`+4ABzY8_%lke2W13*6C}NOr z(IS<#vDz<#kGGhLW&%-yEtf(r3v875^8trhZmE)#9J3o*pbJ>l6;?0jx_uzrfBFg< zi@o62KYq)84+cBid;6p2Pk$px8{^3CrU-WNXuAP571BE8i ze`9Jvw7uMrQ5U}JRoXSdWz)*G6K%)i4_+o`0-xmyX6tUpc4~gfTdv9_Q}AjWFehp6 zU+caMn9g?ibcddBi%|+MEzx5yt UEH_x9u>WZM0|8v5i+BtG0B5X#-T(jq From 851c5c4fd8c7ddb13e3861d03c7607da3b366eb1 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Mon, 28 Jan 2019 01:59:45 -0500 Subject: [PATCH 11/18] Update E131_PixelPusher.ino - make code more readable - remove extra bool, not required --- Arduino/E131_PixelPusher/E131_PixelPusher.ino | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Arduino/E131_PixelPusher/E131_PixelPusher.ino b/Arduino/E131_PixelPusher/E131_PixelPusher.ino index 3341da3..4658c2b 100644 --- a/Arduino/E131_PixelPusher/E131_PixelPusher.ino +++ b/Arduino/E131_PixelPusher/E131_PixelPusher.ino @@ -341,26 +341,20 @@ void setup() request->send(200, "application/json", "{\"ct\":" + String(ledCount) + ",\"mode\":\"" + String((unicast_flag) ? "unicast" : "multicast") + "\",\"su\":" + String(START_UNIVERSE) + ",\"uct\":" + String(END_UNIVERSE - START_UNIVERSE + 1) + "}"); }); server.on("/updateparams", HTTP_POST, [](AsyncWebServerRequest *request) { - bool hasReqArgs = false; if (request->hasParam("mode", true)) { unicast_flag = (request->getParam("mode", true)->value() == "unicast") ? true : false; - hasReqArgs = true; + updatedParams = true; } if (request->hasParam("su", true)) { START_UNIVERSE = constrain(request->getParam("su", true)->value().toInt(), 1, (unicast_flag) ? 12 : 7); - hasReqArgs = true; + updatedParams = true; } if (request->hasParam("uct", true)) { END_UNIVERSE = constrain(request->getParam("uct", true)->value().toInt(), 1, (unicast_flag) ? 12 : 7); - hasReqArgs = true; - } - if (hasReqArgs) - { updatedParams = true; - hasReqArgs = false; } request->send(200, "text/html", "LED Count: " + String(ledCount) + ", Mode: " + String((unicast_flag) ? "unicast" : "multicast") + ", Starting Universe: " + String(START_UNIVERSE) + ", Universe Count: " + String(END_UNIVERSE - START_UNIVERSE + 1) + ""); }); @@ -450,10 +444,10 @@ void loop() e131_packet_t packet; e131->pull(&packet); // Pull packet from ring buffer - uint16_t universe = htons(packet.universe); + uint16_t CURRENT_UNIVERSE = htons(packet.universe); uint8_t *data = packet.property_values + 1; - if (universe < START_UNIVERSE || universe > END_UNIVERSE) + if (CURRENT_UNIVERSE < START_UNIVERSE || CURRENT_UNIVERSE > END_UNIVERSE) return; //async will take care about filling the buffer #ifdef SERIAL_DEBUG @@ -465,7 +459,7 @@ void loop() packet.property_values[1]); // Dimmer data for Channel 1 #endif - uint16_t multipacketOffset = (universe - START_UNIVERSE) * 170; //if more than 170 LEDs (510 channels), client will send in next higher universe + uint16_t multipacketOffset = (CURRENT_UNIVERSE - START_UNIVERSE) * 170; //if more than 170 LEDs (510 channels), client will send in next higher universe if (ledCount <= multipacketOffset) return; uint16_t len = (170 + multipacketOffset > ledCount) ? (ledCount - multipacketOffset) * 3 : 510; From d023da56f9e34926b7b5524a388cf264ee0ff215 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Mon, 28 Jan 2019 08:12:20 -0500 Subject: [PATCH 12/18] Update E131_PixelPusher.ino - set all pixels to 0 after initialization --- Arduino/E131_PixelPusher/E131_PixelPusher.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Arduino/E131_PixelPusher/E131_PixelPusher.ino b/Arduino/E131_PixelPusher/E131_PixelPusher.ino index 4658c2b..99aaad3 100644 --- a/Arduino/E131_PixelPusher/E131_PixelPusher.ino +++ b/Arduino/E131_PixelPusher/E131_PixelPusher.ino @@ -243,6 +243,7 @@ void initDMA(void) #endif dma->Initialize(); pixel = (uint8_t *)malloc(ledCount); + memset(pixel, 0, sizeof(pixel)); } void initE131(void) @@ -424,7 +425,6 @@ void setup() #if !defined(SHOW_FPS_SERIAL) or !defined(SERIAL_DEBUG) Serial.end(); #endif - memset(pixel, 0, sizeof(pixel)); } void loop() From bdc21e133d2fc41393c979f4d12d6ea8af844c06 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Thu, 31 Jan 2019 15:34:07 -0500 Subject: [PATCH 13/18] v1.2.1 - Fix ESP32 specific issues - Use Adafruit's Dotstar SPI method using hardware support - MDNS.setinstance is causing significant FPS drop, commented for now --- Arduino/E131_PixelPusher/E131_PixelPusher.ino | 372 ++++++++++-------- Arduino/E131_PixelPusher/version.h | 7 +- README.md | 5 +- platformio.ini | 14 +- 4 files changed, 215 insertions(+), 183 deletions(-) diff --git a/Arduino/E131_PixelPusher/E131_PixelPusher.ino b/Arduino/E131_PixelPusher/E131_PixelPusher.ino index 99aaad3..2d934e0 100644 --- a/Arduino/E131_PixelPusher/E131_PixelPusher.ino +++ b/Arduino/E131_PixelPusher/E131_PixelPusher.ino @@ -3,9 +3,8 @@ #include #include //https://github.com/me-no-dev/AsyncTCP #include -#include #include -#include +// #include //https://github.com/tzapu/WiFiManager/tree/development #elif defined(ESP8266) #include #include @@ -21,15 +20,24 @@ #error Platform not supported #endif #include //https://github.com/forkineye/ESPAsyncE131 -#include //https://github.com/alanswx/ESPAsyncWiFiManager #include //https://github.com/me-no-dev/ESPAsyncWebServer -#include //https://github.com/Makuna/NeoPixelBus +#include //https://github.com/alanswx/ESPAsyncWiFiManager + #include #include "version.h" -#define WIFI_HTM_GZ_PROGMEM //comment to serve minimized html instead of gziped version -//#define SERIAL_DEBUG //uncomment to see if E1.31 data is received -//#define SHOW_FPS_SERIAL //uncomment to see Serial FPS +#define USE_NEOPIXELS 2 // Use any pin under 32 +// #define USE_DOTSTAR //comment above line to use APA102 + +#ifdef USE_NEOPIXELS +#include //https://github.com/Makuna/NeoPixelBus +#elseif defined(USE_DOTSTAR) +#include //https://github.com/debsahu/Adafruit_DotStar +#endif + +#define WIFI_HTM_GZ_PROGMEM //comment to serve minimized html instead of gziped version +//#define SERIAL_DEBUG //uncomment to see if E1.31 data is received +//#define SHOW_FPS_SERIAL //uncomment to see Serial FPS #define HOSTNAME "E131PixelPusher" #define HTTP_PORT 80 @@ -39,6 +47,10 @@ uint8_t END_UNIVERSE = 7; // Total number of Universes to listen for, starti uint16_t ledCount = 12 * 170; // 170 LEDs per Universe bool unicast_flag = false; +#if defined(USE_NEOPIXELS) and defined(USE_DOTSTAR) +#error "Choose only one type of LEDs" +#endif + #ifndef WIFI_HTM_GZ_PROGMEM //size: 3195 static const char index_htm[] PROGMEM = R"=====( @@ -48,123 +60,122 @@ static const char index_htm[] PROGMEM = R"=====( //gziped: 1385 (~57% compression) #define index_htm_gz_len 1385 static const uint8_t index_htm_gz[] PROGMEM = { - 0x1f, 0x8b, 0x08, 0x00, 0xef, 0xa0, 0x4e, 0x5c, 0x00, 0x03, 0xc5, 0x57, - 0x6d, 0x53, 0xe3, 0x36, 0x10, 0xfe, 0x2b, 0x42, 0x4c, 0x99, 0xa4, 0x17, - 0xdb, 0x31, 0x2f, 0x07, 0x38, 0x71, 0xae, 0x77, 0x34, 0xd7, 0x5e, 0xe7, - 0x8e, 0x63, 0x06, 0xe8, 0x4c, 0xa7, 0x6f, 0x23, 0xdb, 0x9b, 0x58, 0x8d, - 0x2d, 0xb9, 0x92, 0x4c, 0xc8, 0x01, 0xff, 0xbd, 0x2b, 0xcb, 0x0e, 0x81, - 0x3b, 0xae, 0xf4, 0x53, 0xbf, 0x10, 0x4b, 0xda, 0xb7, 0x67, 0x77, 0xf5, - 0xac, 0x18, 0x6f, 0x7d, 0xff, 0xf1, 0xe4, 0xe2, 0x97, 0xb3, 0x29, 0xc9, - 0x4d, 0x59, 0x4c, 0xc6, 0xf6, 0x2f, 0x29, 0x98, 0x98, 0xc7, 0x14, 0x04, - 0xc5, 0x35, 0xb0, 0x6c, 0x32, 0x2e, 0xc1, 0x30, 0x14, 0x30, 0x95, 0x07, - 0x7f, 0xd7, 0xfc, 0x2a, 0xa6, 0x27, 0x52, 0x18, 0x10, 0xc6, 0xbb, 0x58, - 0x55, 0x40, 0x49, 0xea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x03, 0xe6, 0x34, 0x36, 0xcf, - 0xe7, 0xdc, 0xe4, 0x75, 0x42, 0xd8, 0xa0, 0x95, 0x64, 0xce, 0x5e, 0x06, - 0xa9, 0x54, 0xcc, 0xe6, 0x33, 0x12, 0x52, 0xc0, 0x5d, 0xa3, 0xd7, 0x30, - 0x69, 0x14, 0x0e, 0x87, 0xdf, 0x8c, 0x72, 0xc0, 0xce, 0x34, 0xee, 0xbb, - 0x64, 0x6a, 0xce, 0x45, 0xc4, 0x6a, 0x23, 0x47, 0x09, 0x4b, 0x17, 0x73, - 0x25, 0x6b, 0x91, 0x79, 0xad, 0x97, 0xf4, 0x65, 0xb2, 0x97, 0xed, 0x8f, - 0x66, 0xc8, 0xcd, 0xde, 0x8c, 0x95, 0xbc, 0x58, 0x45, 0x9a, 0x09, 0xed, - 0x69, 0x50, 0x7c, 0x36, 0xf2, 0x96, 0x90, 0x2c, 0xb8, 0xf1, 0x12, 0x79, - 0xed, 0x69, 0xfe, 0x09, 0x1b, 0x3c, 0x4a, 0xa4, 0xca, 0x40, 0xd9, 0x9d, - 0x91, 0x57, 0xca, 0x4f, 0x4f, 0x1c, 0x7d, 0x71, 0xf7, 0x6e, 0x7b, 0xa9, - 0x58, 0x55, 0x81, 0x6a, 0x43, 0xdd, 0x3d, 0x18, 0x56, 0xd7, 0x5d, 0xac, - 0xbb, 0x87, 0x76, 0xe1, 0x84, 0xa3, 0xdd, 0xea, 0x9a, 0x20, 0xc3, 0xf0, - 0x8c, 0x6c, 0x1f, 0x1d, 0xec, 0x85, 0x27, 0x2f, 0xdb, 0x03, 0x4f, 0xb1, - 0x8c, 0xd7, 0x3a, 0x3a, 0x42, 0xd1, 0x16, 0xd7, 0xee, 0x01, 0xca, 0x5a, - 0x70, 0xe4, 0x09, 0x84, 0x07, 0x47, 0xc3, 0xc3, 0xe3, 0xc3, 0x36, 0xd5, - 0x37, 0x9d, 0x56, 0xe3, 0xec, 0x33, 0xd9, 0xe1, 0xf0, 0xe8, 0xe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 0xf3, 0x0b, 0x8a, 0x64, 0x68, 0x2f, 0x01, 0xbe, 0x0d, 0xea, 0xca, 0xce, - 0x9a, 0x8a, 0x29, 0x56, 0x6a, 0x8a, 0x31, 0x61, 0xb5, 0x4b, 0x8e, 0x6f, - 0x8d, 0x76, 0xf8, 0x3f, 0x18, 0x46, 0x74, 0xe2, 0x48, 0x31, 0x22, 0x63, - 0x5d, 0x21, 0x75, 0xdb, 0x40, 0x3b, 0x12, 0x44, 0x6c, 0x76, 0x0f, 0xb1, - 0xa9, 0xc9, 0x07, 0x64, 0xa0, 0x68, 0xac, 0xa1, 0x80, 0xd4, 0x34, 0x42, - 0xcd, 0xcc, 0x6d, 0x63, 0x73, 0xdf, 0x52, 0x24, 0x45, 0xad, 0x62, 0xfa, - 0x90, 0xd5, 0xd0, 0x8a, 0xac, 0xba, 0x21, 0x88, 0x93, 0x74, 0x4d, 0x72, - 0x93, 0xcb, 0xd3, 0x77, 0x27, 0xaf, 0xcf, 0x2f, 0xc6, 0x81, 0x3b, 0x7f, - 0x2c, 0x57, 0xd6, 0x85, 0x71, 0x92, 0xc4, 0xb9, 0x85, 0x6c, 0xf2, 0xe1, - 0xf2, 0xfd, 0xc5, 0x23, 0xa5, 0xc0, 0x1d, 0x36, 0x41, 0x36, 0xd3, 0x89, - 0x5c, 0xb6, 0x33, 0x00, 0x21, 0x71, 0x51, 0xd5, 0x2e, 0x5c, 0xe4, 0xb2, - 0x36, 0x58, 0xfb, 0x65, 0xf0, 0xf5, 0x16, 0x53, 0xd1, 0x8c, 0x20, 0x4a, - 0xb0, 0xe7, 0x52, 0xc8, 0x65, 0x81, 0x9d, 0x12, 0x7f, 0x3e, 0xe1, 0x30, - 0xcd, 0x2d, 0x57, 0x92, 0x92, 0x63, 0x7a, 0x43, 0x8b, 0x74, 0x01, 0xab, - 0xba, 0xc2, 0xf2, 0xe5, 0x5c, 0xb7, 0x2f, 0x84, 0xfb, 0x4f, 0x5f, 0x41, - 0x63, 0xb1, 0x17,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c5, 0x57, + 0x6d, 0x53, 0xe3, 0x36, 0x10, 0xfe, 0x2b, 0x42, 0x4c, 0x99, 0xa4, 0x17, + 0xdb, 0x31, 0x2f, 0x07, 0x38, 0x71, 0xae, 0x77, 0x34, 0xd7, 0x5e, 0xe7, + 0x8e, 0x63, 0x06, 0xe8, 0x4c, 0xa7, 0x6f, 0x23, 0xdb, 0x9b, 0x58, 0x8d, + 0x2d, 0xb9, 0x92, 0x4c, 0xc8, 0x01, 0xff, 0xbd, 0x2b, 0xcb, 0x0e, 0x81, + 0x3b, 0xae, 0xf4, 0x53, 0xbf, 0x10, 0x4b, 0xda, 0xb7, 0x67, 0x77, 0xf5, + 0xac, 0x18, 0x6f, 0x7d, 0xff, 0xf1, 0xe4, 0xe2, 0x97, 0xb3, 0x29, 0xc9, + 0x4d, 0x59, 0x4c, 0xc6, 0xf6, 0x2f, 0x29, 0x98, 0x98, 0xc7, 0x14, 0x04, + 0xc5, 0x35, 0xb0, 0x6c, 0x32, 0x2e, 0xc1, 0x30, 0x14, 0x30, 0x95, 0x07, + 0x7f, 0xd7, 0xfc, 0x2a, 0xa6, 0x27, 0x52, 0x18, 0x10, 0xc6, 0xbb, 0x58, + 0x55, 0x40, 0x49, 0xea, 0x56, 0x31, 0x35, 0x70, 0x6d, 0x02, 0x6b, 0x62, + 0x44, 0xd2, 0x9c, 0x29, 0x0d, 0x26, 0xae, 0xcd, 0xcc, 0x3b, 0xa2, 0xad, + 0x09, 0xc1, 0x4a, 0x88, 0xe9, 0x15, 0x87, 0x65, 0x25, 0x95, 0xd9, 0x50, + 0x5c, 0xf2, 0xcc, 0xe4, 0x71, 0x06, 0x57, 0x3c, 0x05, 0xaf, 0x59, 0xa0, + 0x8a, 0x4e, 0x15, 0xaf, 0xcc, 0x64, 0x56, 0x8b, 0xd4, 0x70, 0x29, 0xc8, + 0x7b, 0xc9, 0xb2, 0x37, 0x32, 0x5b, 0xf5, 0xfa, 0x37, 0x57, 0x4c, 0x11, + 0xb4, 0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43, 0x4a, 0x26, 0x56, 0x6b, 0x97, 0xda, 0x2a, 0x6e, 0x85, + 0x1b, 0x25, 0x48, 0x59, 0x91, 0x3a, 0x4f, 0x58, 0x81, 0xff, 0xde, 0x89, + 0xcf, 0xa9, 0x83, 0xf7, 0x8c, 0x92, 0xbe, 0x78, 0x10, 0x53, 0x0e, 0xe9, + 0xe2, 0xd2, 0x95, 0x0b, 0xa3, 0x7a, 0x4e, 0xe5, 0x5e, 0x3d, 0x1d, 0x49, + 0xe3, 0xa4, 0x64, 0xd7, 0x31, 0x0d, 0x77, 0xe9, 0xbf, 0xb5, 0x75, 0x27, + 0xd7, 0x8f, 0x9e, 0x63, 0xf0, 0xf0, 0x79, 0xf6, 0x0e, 0x91, 0x21, 0xc6, + 0x41, 0xcb, 0x5e, 0x63, 0x6d, 0x56, 0x05, 0x4c, 0xf0, 0x8a, 0x25, 0x89, + 0x19, 0x24, 0x48, 0x5f, 0x37, 0x96, 0x25, 0x3d, 0xbc, 0x0a, 0x73, 0x11, + 0xa5, 0xa8, 0x0f, 0x6a, 0x94, 0xca, 0x02, 0xaf, 0xcb, 0xf6, 0x6c, 0x36, + 0xbb, 0x6b, 0x05, 0x7d, 0xc3, 0x4d, 0x01, 0x03, 0xe6, 0x34, 0x36, 0xcf, + 0xe7, 0xdc, 0xe4, 0x75, 0x42, 0xd8, 0xa0, 0x95, 0x64, 0xce, 0x5e, 0x06, + 0xa9, 0x54, 0xcc, 0xe6, 0x33, 0x12, 0x52, 0xc0, 0x5d, 0xa3, 0xd7, 0x30, + 0x69, 0x14, 0x0e, 0x87, 0xdf, 0x8c, 0x72, 0xc0, 0xce, 0x34, 0xee, 0xbb, + 0x64, 0x6a, 0xce, 0x45, 0xc4, 0x6a, 0x23, 0x47, 0x09, 0x4b, 0x17, 0x73, + 0x25, 0x6b, 0x91, 0x79, 0xad, 0x97, 0xf4, 0x65, 0xb2, 0x97, 0xed, 0x8f, + 0x66, 0xc8, 0xcd, 0xde, 0x8c, 0x95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6d, + 0x2b, 0xda, 0x96, 0xc7, 0x1f, 0xbc, 0x4d, 0xce, 0x04, 0xbe, 0xcb, 0x15, + 0xcc, 0xd6, 0xed, 0x8e, 0xfd, 0xd4, 0xfc, 0x92, 0xb7, 0x5c, 0x95, 0x4b, + 0xa6, 0xe0, 0xd5, 0x38, 0x60, 0x4e, 0xd2, 0x5e, 0xc0, 0xd6, 0x95, 0xbb, + 0xeb, 0xf4, 0x5e, 0xdb, 0xbe, 0xed, 0x75, 0x14, 0x04, 0xee, 0xc0, 0x4f, + 0x65, 0x19, 0x64, 0x90, 0x68, 0x96, 0xd7, 0xc1, 0x34, 0xdc, 0x0b, 0xff, + 0x6c, 0xe2, 0x76, 0x57, 0xd2, 0x5e, 0xd3, 0x87, 0x3b, 0x24, 0x59, 0x91, + 0xef, 0x5a, 0xf1, 0xc6, 0x9b, 0x8b, 0xae, 0x1b, 0x80, 0xeb, 0x49, 0x18, + 0x58, 0x72, 0xb0, 0x4c, 0x61, 0xff, 0xd3, 0xf8, 0x07, 0xce, 0x1f, 0x2f, + 0x41, 0x79, 0x0c, 0x00, 0x00}; #endif //ESPAsyncE131 pointer @@ -172,29 +183,28 @@ ESPAsyncE131 *e131; AsyncWebServer server(HTTP_PORT); #ifdef ESP32 -//#define PIN 2 //Use any pin under 32 -//NeoEsp32BitBangWs2813Method* dma; - -//APA102/DotStar -//Hardware SPI method: GPIO18 is CLK, GPIO23 is DATA -DotStarSpiMethod *dma; -// -//Software SPI method: Any pin can be clock and data -//#define PIN_CLK 18 -//#define PIN_DATA 23 -//DotStarMethod* dma; +#if defined(USE_NEOPIXELS) and defined(ESP32) +#define PIN USE_NEOPIXELS //Use any pin under 32 +NeoEsp32BitBangWs2813Method *dma; +// NeoEsp32RmtWs2813Method *dma; +#endif + +#if defined(USE_DOTSTAR) and defined(ESP32) +#define PIN_CLK SCK +#define PIN_DATA MOSI +Adafruit_DotStar *dma; +#endif #elif defined(ESP8266) +#if defined(USE_NEOPIXELS) and defined(ESP8266) NeoEsp8266Dma800KbpsMethod *dma; //uses RX/GPIO3 pin +#endif -//APA102/DotStar -//Hardware SPI method: GPIO14 is CLK, GPIO13 is DATA -//DotStarSpiMethod* dma; -// -//Software SPI method: Any pin can be clock and data -//#define PIN_CLK 14 -//#define PIN_DATA 13 -//DotStarMethod* dma; +#if defined(USE_DOTSTAR) and defined(ESP8266) +#define PIN_CLK SCK +#define PIN_DATA MOSI +Adafruit_DotStar *dma; +#endif #endif #if defined(ESP8266) and (defined(PIO_PLATFORM) or defined(USE_EADNS)) @@ -212,8 +222,6 @@ struct int eeprom_addr = 0; -uint8_t *pixel; - #ifdef SHOW_FPS_SERIAL uint64_t frameCt = 0; uint64_t PM = 0; @@ -227,23 +235,20 @@ const char update_html[] PROGMEM = "Initialize(); #endif +#if defined(USE_NEOPIXELS) and defined(ESP8266) + dma = new NeoEsp8266Dma800KbpsMethod(ledCount, 3); dma->Initialize(); - pixel = (uint8_t *)malloc(ledCount); - memset(pixel, 0, sizeof(pixel)); +#endif +#ifdef USE_DOTSTAR + dma = new Adafruit_DotStar(ledCount, DOTSTAR_BRG); + dma->begin(); +#endif } void initE131(void) @@ -263,10 +268,13 @@ void initE131(void) void readEEPROM(void) { char eeprominit = char(EEPROM.read(eeprom_addr)); - if (eeprominit != 'w') { + if (eeprominit != 'w') + { EEPROM.write(eeprom_addr, 'w'); writeEEPROM(); - } else { + } + else + { EEPROM.get(eeprom_addr + 1, config); unicast_flag = config.unicast; START_UNIVERSE = config.startUniverse; @@ -291,7 +299,6 @@ void writeEEPROM(void) void setup() { - SPIFFS.begin(); EEPROM.begin(512); Serial.begin(115200); delay(10); @@ -300,16 +307,20 @@ void setup() readEEPROM(); char NameChipId[64] = {0}, chipId[9] = {0}; -#ifdef ESP32 + +#ifdef USE_DOTSTAR Serial.print("Hardware SPI //DATA PIN: "); - Serial.println(MOSI); //GPIO23? + Serial.println(MOSI); //GPIO23:ESP32 GPIO13:ESP8266 Serial.print("Hardware SPI //CLOCK PIN: "); - Serial.println(SCK); //GPIO18? + Serial.println(SCK); //GPIO18:ESP32 GPIO14:ESP8266 +#endif +#ifdef ESP32 snprintf(chipId, sizeof(chipId), "%08x", (uint32_t)ESP.getEfuseMac()); snprintf(NameChipId, sizeof(NameChipId), "%s_%08x", HOSTNAME, (uint32_t)ESP.getEfuseMac()); WiFi.mode(WIFI_STA); // Make sure you're in station mode WiFi.setHostname(const_cast(NameChipId)); + // WiFiManager wifiManager; AsyncWiFiManager wifiManager(&server, &dns); #else snprintf(chipId, sizeof(chipId), "%06x", ESP.getChipId()); @@ -329,6 +340,8 @@ void setup() Serial.print(F(">>> Connected with IP: ")); Serial.println(WiFi.localIP()); + delay(5000); + server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) { #ifdef WIFI_HTM_GZ_PROGMEM AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", index_htm_gz, index_htm_gz_len); @@ -357,7 +370,7 @@ void setup() END_UNIVERSE = constrain(request->getParam("uct", true)->value().toInt(), 1, (unicast_flag) ? 12 : 7); updatedParams = true; } - request->send(200, "text/html", "LED Count: " + String(ledCount) + ", Mode: " + String((unicast_flag) ? "unicast" : "multicast") + ", Starting Universe: " + String(START_UNIVERSE) + ", Universe Count: " + String(END_UNIVERSE - START_UNIVERSE + 1) + ""); + request->send(200, "text/html", "LED Count: " + String((END_UNIVERSE - START_UNIVERSE + 1) * 170) + ", Mode: " + String((unicast_flag) ? "unicast" : "multicast") + ", Starting Universe: " + String(START_UNIVERSE) + ", Universe Count: " + String(END_UNIVERSE - START_UNIVERSE + 1) + ""); }); server.on("/status", HTTP_GET, [](AsyncWebServerRequest *request) { request->send(200, "text/plain", SKETCH_VERSION); @@ -396,11 +409,9 @@ void setup() if(Serial) Serial.printf("Update Success: %uB\n", index+len); else { if(Serial) Update.printError(Serial); - } - } }); -#if !(defined(ARDUINO_ESP8266_RELEASE_2_5_0_BETA3) or defined(ARDUINO_ESP8266_GIT_DESC)) - MDNS.setInstanceName(String(HOSTNAME " (" + String(chipId) + ")").c_str()); -#endif + } + } }); + if (MDNS.begin(NameChipId)) { MDNS.addService("http", "tcp", HTTP_PORT); @@ -410,6 +421,7 @@ void setup() MDNS.addServiceTxt("e131", "udp", "Model", "E131_PixelPusher"); MDNS.addServiceTxt("e131", "udp", "Manuf", "debsahu"); #endif + //MDNS.setInstanceName("E1.31 PixelPusher"); //Adding this line decreases FPS by 4 times Serial.printf(">>> MDNS Started: http://%s.local/\n", NameChipId); } else @@ -422,7 +434,7 @@ void setup() initE131(); delay(1000); -#if !defined(SHOW_FPS_SERIAL) or !defined(SERIAL_DEBUG) +#if !defined(SHOW_FPS_SERIAL) and !defined(SERIAL_DEBUG) Serial.end(); #endif } @@ -433,7 +445,8 @@ void loop() MDNS.update(); #endif - if (updatedParams) { + if (updatedParams) + { initE131(); writeEEPROM(); updatedParams = false; @@ -463,13 +476,22 @@ void loop() if (ledCount <= multipacketOffset) return; uint16_t len = (170 + multipacketOffset > ledCount) ? (ledCount - multipacketOffset) * 3 : 510; - memcpy(pixel + multipacketOffset * 3, data, len); // Burden on source to send in correct color order + //memcpy(pixel + multipacketOffset * 3, data, len); // Burden on source to send in correct color order + //memcpy(dma->getPixels() + multipacketOffset * 3, data, len); + memmove(&dma->getPixels()[multipacketOffset * 3], data, len); } + //memcpy(dma->getPixels(), pixel, dma->numPixels()); + +#ifdef USE_NEOPIXELS if (dma->IsReadyToUpdate()) +#endif { - memcpy(dma->getPixels(), pixel, dma->getPixelsSize()); +#ifdef USE_NEOPIXELS dma->Update(); +#elif defined(USE_DOTSTAR) + dma->show(); +#endif #ifdef SHOW_FPS_SERIAL frameCt++; #endif diff --git a/Arduino/E131_PixelPusher/version.h b/Arduino/E131_PixelPusher/version.h index cc483a6..b19b117 100644 --- a/Arduino/E131_PixelPusher/version.h +++ b/Arduino/E131_PixelPusher/version.h @@ -1,4 +1,4 @@ -#define SKETCH_VERSION "1.2.0" +#define SKETCH_VERSION "1.2.1" /* * Dec 13, 2018 v1.0.0 @@ -27,4 +27,9 @@ * Jan 21, 2019 v1.2.0 * - Add web interface * - user can choose starting universe, unicast/umulticast, total number of universe +* +* Jan 31, 2019 v1.2.1 +* - Fix ESP32 specific issues +* - Use Adafruit's Dotstar SPI method using hardware support +* - MDNS.setinstance is causing significant FPS drop, commented for now */ \ No newline at end of file diff --git a/README.md b/README.md index b644ec3..12dd546 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,9 @@ Minimalistic Async code around Async E131 for ESP8266/ESP32 - Subscribes to E131 multicast - Connect RX/GPIO3 to DIN of NeoPixel strip, and any PIN (/update for ESP8266, compile your own for ESP32 -- Included relavent lines for APA102/Dotstar LED strip +- Included relavent lines for APA102/Dotstar LED strip: Comment `//#define USE_NEOPIXELS xxx` and uncomment `#define USE_DOTSTAR` + - ESP8266 Hardware SPI: Uses GPIO14(SCK) for CLOCK and GPIO13(MOSI) for DATA + - ESP32 Hardware SPI: Uses GPIO18(SCK) for CLOCK and GPIO23(MOSI) for DATA [![E131_PixelPusher](https://img.youtube.com/vi/lZ09GlO2_8s/0.jpg)](https://www.youtube.com/watch?v=lZ09GlO2_8s) @@ -28,6 +30,7 @@ Minimalistic Async code around Async E131 for ESP8266/ESP32 |ESPAsyncDNSServer |https://github.com/devyte/ESPAsyncDNSServer |ESP8266 | |ESP Async WebServer |https://github.com/me-no-dev/ESPAsyncWebServer |ESP8266/32 | |AsyncTCP |https://github.com/me-no-dev/AsyncTCP |ESP32 | +|Adafruit's Dot Star |https://github.com/debsahu/Adafruit_DotStar |ESP8266/32 | ## Pushing E1.31 UDP Data diff --git a/platformio.ini b/platformio.ini index beb3968..3e3cbf7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -8,13 +8,15 @@ framework = arduino build_flags = -w monitor_speed = 115200 -; upload_speed = 921600 +upload_speed_fast = 921600 upload_speed = 115200 lib_deps = ESPAsyncE131=https://github.com/forkineye/ESPAsyncE131 NeoPixelBus=https://github.com/Makuna/NeoPixelBus + ; NeoPixelBus=https://github.com/Makuna/NeoPixelBus/archive/Esp32RMTExperimental.zip ESP Async WebServer ESPAsyncWiFiManager + https://github.com/debsahu/Adafruit_DotStar [common:esp8266] platform = espressif8266@1.8.0 @@ -33,7 +35,6 @@ lib_deps = [common:esp32] platform = espressif32@1.6.0 build_flags = - -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH -D ARDUINO_ARCH_ESP32 lib_ignore = ESPAsyncUDP @@ -59,16 +60,16 @@ board_build.flash_mode = ${common:esp8266.board_build.flash_mode} lib_deps = ${common.lib_deps} ${common:esp8266.lib_deps} -;targets = upload, monitor ;uncomment for upload and serial monitor +;targets = erase, upload, monitor ;uncomment for upload and serial monitor # see: http://docs.platformio.org/en/latest/platforms/espressif32.html [env:esp32dev] -board = esp32dev +board = lolin_d32 framework = ${common.framework} platform = ${common:esp32.platform} ;platform = https://github.com/platformio/platform-espressif32.git#feature/stage monitor_speed = ${common.monitor_speed} -upload_speed = ${common.upload_speed} +upload_speed = ${common.upload_speed_fast} build_flags = ${common.build_flags} ${common:esp32.build_flags} @@ -77,4 +78,5 @@ lib_ignore = lib_deps = ${common.lib_deps} ${common:esp32.lib_deps} -;targets = upload, monitor ;uncomment for upload and serial monitor \ No newline at end of file + ; WiFiManager=https://github.com/tzapu/WiFiManager/archive/development.zip +;targets = erase, upload, monitor ;uncomment for upload and serial monitor \ No newline at end of file From c1703ac5884b127ab923a6c82c93137fa0d929e2 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Thu, 31 Jan 2019 15:35:28 -0500 Subject: [PATCH 14/18] Update E131_PixelPusher.ino --- Arduino/E131_PixelPusher/E131_PixelPusher.ino | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Arduino/E131_PixelPusher/E131_PixelPusher.ino b/Arduino/E131_PixelPusher/E131_PixelPusher.ino index 2d934e0..0be1e16 100644 --- a/Arduino/E131_PixelPusher/E131_PixelPusher.ino +++ b/Arduino/E131_PixelPusher/E131_PixelPusher.ino @@ -22,7 +22,6 @@ #include //https://github.com/forkineye/ESPAsyncE131 #include //https://github.com/me-no-dev/ESPAsyncWebServer #include //https://github.com/alanswx/ESPAsyncWiFiManager - #include #include "version.h" @@ -31,7 +30,7 @@ #ifdef USE_NEOPIXELS #include //https://github.com/Makuna/NeoPixelBus -#elseif defined(USE_DOTSTAR) +#elif defined(USE_DOTSTAR) #include //https://github.com/debsahu/Adafruit_DotStar #endif From f4450943252c75f706dfcf40f4e353906a671141 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Thu, 31 Jan 2019 17:49:15 -0500 Subject: [PATCH 15/18] Update E131_PixelPusher.ino - Use buffers for NeoPixel DMA methods - Dont end serial after DMA is initialized --- Arduino/E131_PixelPusher/E131_PixelPusher.ino | 57 ++++++++++++------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/Arduino/E131_PixelPusher/E131_PixelPusher.ino b/Arduino/E131_PixelPusher/E131_PixelPusher.ino index 0be1e16..07d3ca7 100644 --- a/Arduino/E131_PixelPusher/E131_PixelPusher.ino +++ b/Arduino/E131_PixelPusher/E131_PixelPusher.ino @@ -29,13 +29,13 @@ // #define USE_DOTSTAR //comment above line to use APA102 #ifdef USE_NEOPIXELS -#include //https://github.com/Makuna/NeoPixelBus +#include //https://github.com/Makuna/NeoPixelBus #elif defined(USE_DOTSTAR) -#include //https://github.com/debsahu/Adafruit_DotStar +#include //https://github.com/debsahu/Adafruit_DotStar #endif -#define WIFI_HTM_GZ_PROGMEM //comment to serve minimized html instead of gziped version -//#define SERIAL_DEBUG //uncomment to see if E1.31 data is received +#define WIFI_HTM_GZ_PROGMEM //comment to serve minimized html instead of gziped version +// #define SERIAL_DEBUG //uncomment to see if E1.31 data is received //#define SHOW_FPS_SERIAL //uncomment to see Serial FPS #define HOSTNAME "E131PixelPusher" @@ -186,6 +186,8 @@ AsyncWebServer server(HTTP_PORT); #define PIN USE_NEOPIXELS //Use any pin under 32 NeoEsp32BitBangWs2813Method *dma; // NeoEsp32RmtWs2813Method *dma; +uint8_t *pixel = (uint8_t *)malloc(ledCount); +; #endif #if defined(USE_DOTSTAR) and defined(ESP32) @@ -197,6 +199,7 @@ Adafruit_DotStar *dma; #elif defined(ESP8266) #if defined(USE_NEOPIXELS) and defined(ESP8266) NeoEsp8266Dma800KbpsMethod *dma; //uses RX/GPIO3 pin +uint8_t *pixel; #endif #if defined(USE_DOTSTAR) and defined(ESP8266) @@ -234,19 +237,29 @@ const char update_html[] PROGMEM = "Initialize(); + pixel = (uint8_t *)malloc(ledCount); + memset(pixel, 0, sizeof(pixel)); #endif #if defined(USE_NEOPIXELS) and defined(ESP8266) - dma = new NeoEsp8266Dma800KbpsMethod(ledCount, 3); - dma->Initialize(); + delete pixel; +} +dma = new NeoEsp8266Dma800KbpsMethod(ledCount, 3); +dma->Initialize(); +pixel = (uint8_t *)malloc(ledCount); +memset(pixel, 0, sizeof(pixel)); #endif #ifdef USE_DOTSTAR - dma = new Adafruit_DotStar(ledCount, DOTSTAR_BRG); - dma->begin(); +} +dma = new Adafruit_DotStar(ledCount, DOTSTAR_BRG); +dma->begin(); #endif } @@ -322,12 +335,12 @@ void setup() // WiFiManager wifiManager; AsyncWiFiManager wifiManager(&server, &dns); #else - snprintf(chipId, sizeof(chipId), "%06x", ESP.getChipId()); - snprintf(NameChipId, sizeof(NameChipId), "%s_%06x", HOSTNAME, ESP.getChipId()); + snprintf(chipId, sizeof(chipId), "%06x", ESP.getChipId()); + snprintf(NameChipId, sizeof(NameChipId), "%s_%06x", HOSTNAME, ESP.getChipId()); - WiFi.mode(WIFI_STA); // Make sure you're in station mode - WiFi.hostname(const_cast(NameChipId)); - AsyncWiFiManager wifiManager(&server, &dns); //Local intialization. Once its business is done, there is no need to keep it around + WiFi.mode(WIFI_STA); // Make sure you're in station mode + WiFi.hostname(const_cast(NameChipId)); + AsyncWiFiManager wifiManager(&server, &dns); //Local intialization. Once its business is done, there is no need to keep it around #endif wifiManager.setConfigPortalTimeout(180); //sets timeout until configuration portal gets turned off, useful to make it all retry or go to sleep in seconds if (!wifiManager.autoConnect(NameChipId)) @@ -339,15 +352,13 @@ void setup() Serial.print(F(">>> Connected with IP: ")); Serial.println(WiFi.localIP()); - delay(5000); - server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) { #ifdef WIFI_HTM_GZ_PROGMEM AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", index_htm_gz, index_htm_gz_len); response->addHeader("Content-Encoding", "gzip"); request->send(response); #else - request->send_P(200, "text/html", index_htm); + request->send_P(200, "text/html", index_htm); #endif }); server.on("/data", HTTP_GET, [](AsyncWebServerRequest *request) { @@ -430,12 +441,11 @@ void setup() DefaultHeaders::Instance().addHeader("Access-Control-Allow-Origin", "*"); server.begin(); - - initE131(); - delay(1000); #if !defined(SHOW_FPS_SERIAL) and !defined(SERIAL_DEBUG) Serial.end(); #endif + initE131(); + delay(1000); } void loop() @@ -477,19 +487,22 @@ void loop() uint16_t len = (170 + multipacketOffset > ledCount) ? (ledCount - multipacketOffset) * 3 : 510; //memcpy(pixel + multipacketOffset * 3, data, len); // Burden on source to send in correct color order //memcpy(dma->getPixels() + multipacketOffset * 3, data, len); +#ifdef USE_NEOPIXELS + memmove(&pixel[multipacketOffset * 3], data, len); +#elif defined(USE_DOTSTAR) memmove(&dma->getPixels()[multipacketOffset * 3], data, len); +#endif } - //memcpy(dma->getPixels(), pixel, dma->numPixels()); - #ifdef USE_NEOPIXELS if (dma->IsReadyToUpdate()) #endif { #ifdef USE_NEOPIXELS + memcpy(dma->getPixels(), pixel, dma->getPixelsSize()); dma->Update(); #elif defined(USE_DOTSTAR) - dma->show(); + dma->show(); #endif #ifdef SHOW_FPS_SERIAL frameCt++; From 8c75e6f188d6df24f06efbd91a6b29b6eb72c4b2 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Tue, 12 Feb 2019 13:00:28 -0500 Subject: [PATCH 16/18] Update E131_PixelPusher.ino NeoEsp32I2s1800KbpsMethod instead of NeoEsp32BitBangWs2813Method for ESP32 --- Arduino/E131_PixelPusher/E131_PixelPusher.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Arduino/E131_PixelPusher/E131_PixelPusher.ino b/Arduino/E131_PixelPusher/E131_PixelPusher.ino index 07d3ca7..e28bae4 100644 --- a/Arduino/E131_PixelPusher/E131_PixelPusher.ino +++ b/Arduino/E131_PixelPusher/E131_PixelPusher.ino @@ -184,7 +184,7 @@ AsyncWebServer server(HTTP_PORT); #ifdef ESP32 #if defined(USE_NEOPIXELS) and defined(ESP32) #define PIN USE_NEOPIXELS //Use any pin under 32 -NeoEsp32BitBangWs2813Method *dma; +NeoEsp32I2s1800KbpsMethod *dma; // NeoEsp32RmtWs2813Method *dma; uint8_t *pixel = (uint8_t *)malloc(ledCount); ; @@ -242,7 +242,7 @@ void initDMA(void) #if defined(USE_NEOPIXELS) and defined(ESP32) delete pixel; } - dma = new NeoEsp32BitBangWs2813Method(PIN, ledCount, 3); + dma = new NeoEsp32I2s1800KbpsMethod(PIN, ledCount, 3); //dma = new NeoEsp32RmtWs2813Method(PIN, ledCount, 3); dma->Initialize(); pixel = (uint8_t *)malloc(ledCount); From c6930bdb71c7ef539674ed0b23ba01bfc55a3f22 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Tue, 12 Feb 2019 14:05:38 -0500 Subject: [PATCH 17/18] Update platformio.ini TRAVIS CI fix --- platformio.ini | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/platformio.ini b/platformio.ini index 3e3cbf7..44c5dcb 100644 --- a/platformio.ini +++ b/platformio.ini @@ -12,14 +12,16 @@ upload_speed_fast = 921600 upload_speed = 115200 lib_deps = ESPAsyncE131=https://github.com/forkineye/ESPAsyncE131 - NeoPixelBus=https://github.com/Makuna/NeoPixelBus + NeoPixelBus@2.4.2 ; NeoPixelBus=https://github.com/Makuna/NeoPixelBus/archive/Esp32RMTExperimental.zip ESP Async WebServer ESPAsyncWiFiManager https://github.com/debsahu/Adafruit_DotStar [common:esp8266] -platform = espressif8266@1.8.0 +; platform = espressif8266@1.8.0 +platform=https://github.com/Jason2866/platform-espressif8266.git#Tasmota +; platform = https://github.com/platformio/platform-espressif8266.git#feature/stage board_build.flash_mode = dout upload_resetmethod = nodemcu build_flags = @@ -34,6 +36,7 @@ lib_deps = [common:esp32] platform = espressif32@1.6.0 +;platform = https://github.com/platformio/platform-espressif32.git#feature/stage build_flags = -D ARDUINO_ARCH_ESP32 lib_ignore = @@ -47,8 +50,7 @@ lib_deps = [env:nodemcuv2] board = nodemcuv2 framework = ${common.framework} -; platform = ${common:esp8266.platform} -platform = https://github.com/platformio/platform-espressif8266.git#feature/stage +platform = ${common:esp8266.platform} build_flags = ${common.build_flags} ${common:esp8266.build_flags} @@ -67,7 +69,6 @@ lib_deps = board = lolin_d32 framework = ${common.framework} platform = ${common:esp32.platform} -;platform = https://github.com/platformio/platform-espressif32.git#feature/stage monitor_speed = ${common.monitor_speed} upload_speed = ${common.upload_speed_fast} build_flags = From 99c1fc3b222cdafec7a9e04dcff3a5f4efbf55a0 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Fri, 8 Nov 2019 09:51:20 -0500 Subject: [PATCH 18/18] updates keeping up SDK updates on PIO --- Arduino/E131_PixelPusher/E131_PixelPusher.ino | 2 +- platformio.ini | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Arduino/E131_PixelPusher/E131_PixelPusher.ino b/Arduino/E131_PixelPusher/E131_PixelPusher.ino index e28bae4..54ac2ab 100644 --- a/Arduino/E131_PixelPusher/E131_PixelPusher.ino +++ b/Arduino/E131_PixelPusher/E131_PixelPusher.ino @@ -500,7 +500,7 @@ void loop() { #ifdef USE_NEOPIXELS memcpy(dma->getPixels(), pixel, dma->getPixelsSize()); - dma->Update(); + dma->Update(true); #elif defined(USE_DOTSTAR) dma->show(); #endif diff --git a/platformio.ini b/platformio.ini index 44c5dcb..cb116fb 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1,7 +1,7 @@ [platformio] src_dir = ./Arduino/E131_PixelPusher/ -;env_default = nodemcuv2 -;env_default = esp32dev +;default_envs = nodemcuv2 +;default_envs = esp32dev [common] framework = arduino @@ -12,16 +12,20 @@ upload_speed_fast = 921600 upload_speed = 115200 lib_deps = ESPAsyncE131=https://github.com/forkineye/ESPAsyncE131 - NeoPixelBus@2.4.2 + NeoPixelBus@2.5.3 ; NeoPixelBus=https://github.com/Makuna/NeoPixelBus/archive/Esp32RMTExperimental.zip ESP Async WebServer ESPAsyncWiFiManager https://github.com/debsahu/Adafruit_DotStar [common:esp8266] -; platform = espressif8266@1.8.0 -platform=https://github.com/Jason2866/platform-espressif8266.git#Tasmota -; platform = https://github.com/platformio/platform-espressif8266.git#feature/stage +arduino_core_2_3_0 = espressif8266@1.5.0 +arduino_core_2_4_0 = espressif8266@1.6.0 +arduino_core_2_4_1 = espressif8266@1.7.3 +arduino_core_2_4_2 = espressif8266@1.8.0 +arduino_core_2_5_2 = espressif8266@2.2.3 +arduino_core_stage = https://github.com/platformio/platform-espressif8266.git#feature/stage +platform = ${common:esp8266.arduino_core_2_5_2} board_build.flash_mode = dout upload_resetmethod = nodemcu build_flags = @@ -35,7 +39,7 @@ lib_deps = ESPAsyncDNSServer [common:esp32] -platform = espressif32@1.6.0 +platform = espressif32@1.11.1 ;platform = https://github.com/platformio/platform-espressif32.git#feature/stage build_flags = -D ARDUINO_ARCH_ESP32