hpwit / artnetesp32v2

23 stars 3 forks source link

cannot display 48 universes #11

Open Xdevel0per opened 1 month ago

Xdevel0per commented 1 month ago

when trying to recive 48 universes of 1020 leds x 8 strips it says impossible to create buffer even when trying 800 * 8

15:19:56.670 -> [ 1245][I][artnetESP32V2.cpp:233] _initialize(): [ARTNETESP32] Initialize subArtnet Start Universe: 0 end Universe: 48, universes 49 15:19:56.702 -> [ 1249][I][artnetESP32V2.cpp:185] createBuffers(): [ARTNETESP32] impossible to create the buffer 0 15:19:56.702 -> [ 1258][I][artnetESP32V2.cpp:197] createBuffers(): [ARTNETESP32] nb total of buffers:0 15:19:56.702 -> [ 1266][I][artnetESP32V2.h:488] _udp_task_start(): [ARTNETESP32] QUEUES CREATED 15:19:56.702 -> [ 1273][I][artnetESP32V2.h:497] _udp_task_start(): [ARTNETESP32] no task handle 15:19:56.747 -> [ 1280][E][artnetESP32V2.cpp:350] listen(): failed to start task

I really need this to work, thx

hpwit commented 1 month ago

Hello can I see your code ?

Xdevel0per commented 1 month ago

define DEBUG_ETHERNET_WEBSERVER_PORT Serial

define UNIQUE_SUBARTNET

define FULL_DMA_BUFFER

include "FastLED.h"

include "I2SClocklessLedDriver.h"

// Debug Level from 0 to 4

define _ETHERNET_WEBSERVERLOGLEVEL 4

define ARTNET_CONNECT_MODE ARTNET_ETH

define NUM_LEDS_PER_STRIP 1020

define NUMSTRIPS 8

define NB_CHANNEL_PER_LED 3

define NUM_LEDS (NUM_LEDS_PER_STRIP * NUMSTRIPS)

define COLOR_RGB

define UNIVERSE_SIZE_IN_CHANNEL 510

define START_UNIVERSE 0

define NUMBER_OF_MAC 20

include

LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x3F for a 16 chars and 2 line display

CRGB leds[NUM_LEDS];

int pins[NUMSTRIPS] = { 13, 2, 14, 27, 26, 25, 33, 32 };

include

include "Arduino.h"

include "artnetESP32V2.h"

include

// define the number of bytes you want to access

define EEPROM_SIZE 5

WebServer server(80);

byte mac[][NUMBER_OF_MAC] = { { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x01 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x02 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x03 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x04 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x05 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x06 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x07 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x08 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x09 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x0A }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x0B }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x0C }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x0D }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x0E }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x0F }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x10 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x11 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x12 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x13 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x14 }, };

artnetESP32V2 artnet = artnetESP32V2();

I2SClocklessLedDriver driver; void displayfunction(void param) { subArtnet subartnet = (subArtnet *)param; driver.showPixels(NO_WAIT, subartnet->data); }

String webpage;

void handleRoot() { // Generate the dynamic webpage with input fields and submit button webpage = F("<!DOCTYPE HTML>"); webpage += F(""); webpage += F("Config<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"); webpage += F("<body style=\"background-color: black; color: white; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\">"); webpage += F(""); webpage += F("<div style=\"width: 100%; margin-bottom: 5px; font-size: 26px; height: 50px; justify-content: center; align-items: center; border-bottom: 1px white solid; display: flex;\">Config Edit

"); webpage += F("<div style=\" position: absolute;left: 50%;transform: translateX(-50%);\"><form action=\"/get\"> Ip Addr: <input type=\"number\" value=\"100\" name=\"ip-1\" min=\"0\" maxlength=\"3\" max=\"255\" required> . <input type=\"number\" value=\"100\" name=\"ip-2\" min=\"0\" maxlength=\"3\" max=\"255\" required> . <input type=\"number\" value=\"100\" name=\"ip-3\" min=\"0\" maxlength=\"3\" max=\"255\" required> . <input type=\"number\" value=\"100\" name=\"ip-4\" min=\"0\" maxlength=\"3\" max=\"255\" required style=\"margin-bottom: 50px;\">
"); webpage += F(""); webpage += F(" <input style=\"background-color: limegreen; padding-left: 10px; padding-right: 10px;\" type=\"submit\"value=\"Submit\">
"); webpage += F("
"); webpage += F(""); webpage += F("");

for (uint8_t i = 0; i < 5; i++) { Serial.println(EEPROM.read(i)); } server.send(200, F("text/html"), webpage); } void handleNotFound() { String message = F("File Not Found\n\n");

message += F("URI: "); message += server.uri(); message += F("\nMethod: "); message += (server.method() == HTTP_GET) ? F("GET") : F("POST"); message += F("\nArguments: "); message += server.args(); message += F("\n");

for (uint8_t i = 0; i < server.args(); i++) { message += " " + server.argName(i) + ": " + server.arg(i) + "\n"; }

server.send(404, F("text/plain"), message); }

void setup() { Serial.begin(115200);

while (!Serial && (millis() < 5000)) ; EEPROM.begin(EEPROM_SIZE); lcd.init(); lcd.clear(); lcd.backlight(); // Make sure backlight is on

// Print a message on both lines of the LCD. lcd.setCursor(0, 0); //Set cursor to character 2 on line 0 lcd.print("Loading.."); pinMode(34, INPUT);

uint8_t ip1 = 192; uint8_t ip2 = 168; uint8_t ip3 = 1; uint8_t ip4 = 11;

// if (digitalRead(34) == HIGH) { // uint8_t ip1 = 192; // uint8_t ip2 = 168; // uint8_t ip3 = 1; // uint8_t ip4 = 10; // } else { // uint8_t ip1 = EEPROM.read(0); // uint8_t ip2 = EEPROM.read(1); // uint8_t ip3 = EEPROM.read(2); // uint8_t ip4 = EEPROM.read(3); // }

Serial.println(ip1); Serial.println(ip2); Serial.println(ip3); Serial.println(ip4);

IPAddress myIP(ip1, ip2, ip3, ip4); IPAddress myGW(ip1, ip2, ip3, 1); IPAddress mySN(255, 255, 255, 0);

lcd.setCursor(2, 1); //Move cursor to character 2 on line 1 lcd.print("TEST!!"); driver.initled((uint8_t *)leds, pins, NUMSTRIPS, NUM_LEDS_PER_STRIP, ORDER_RGB); driver.setBrightness(255); ESP32_W5500_onEvent();

ETH.begin(MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST); ETH.config(myIP, myGW, mySN);

server.on(F("/"), handleRoot); server.on("/get", HTTP_GET, []() { int numParams = server.args();

// Loop through all parameters
for (int i = 0; i < numParams; i++) {
  // Get the parameter name
  String paramName = server.argName(i);

  // Get the parameter value
  String paramValue = server.arg(i);

  // Process the parameter
  Serial.print(paramName);
  Serial.print(": ");
  Serial.println(paramValue);
  EEPROM.write(i, paramValue.toInt());
}

EEPROM.commit();

String message = F("File Not Found\n\n");

message += F("URI: ");
message += server.uri();
message += F("\nMethod: ");
message += (server.method() == HTTP_GET) ? F("GET") : F("POST");
message += F("\nArguments: ");
message += server.args();
message += F("\n");

for (uint8_t i = 0; i < server.args(); i++) {
  message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
}

server.send(404, F("text/plain"), message);

}); server.onNotFound(handleNotFound);

server.begin();

Serial.print(F("HTTP HelloServer2 started @ IP : ")); Serial.println(ETH.localIP()); artnet.addSubArtnet(START_UNIVERSE, NUM_LEDS * NB_CHANNEL_PER_LED, UNIVERSE_SIZE_IN_CHANNEL, &displayfunction); artnet.setNodeName("Arnet Node esp32");

if (artnet.listen(6454)) { Serial.print("artnet Listening on IP: "); Serial.println(myIP); } ESP32_W5500_waitForConnect(); }

void loop() { server.handleClient(); }

================== log ===============

15:19:56.670 -> [ 1245][I][artnetESP32V2.cpp:233] _initialize(): [ARTNETESP32] Initialize subArtnet Start Universe: 0 end Universe: 48, universes 49 15:19:56.702 -> [ 1249][I][artnetESP32V2.cpp:185] createBuffers(): [ARTNETESP32] impossible to create the buffer 0 15:19:56.702 -> [ 1258][I][artnetESP32V2.cpp:197] createBuffers(): [ARTNETESP32] nb total of buffers:0 15:19:56.702 -> [ 1266][I][artnetESP32V2.h:488] _udp_task_start(): [ARTNETESP32] QUEUES CREATED 15:19:56.702 -> [ 1273][I][artnetESP32V2.h:497] _udp_task_start(): [ARTNETESP32] no task handle 15:19:56.747 -> [ 1280][E][artnetESP32V2.cpp:350] listen(): failed to start task

and im wondering if i can recive more, and also can i recive each port individually so that it displays even when data isnt full for example if i need only 1020 leds of the 8160?

hpwit commented 1 month ago

I think it's because you're using full dma comment the line #define full_dma buffer to have memory. Let me know

Xdevel0per commented 1 month ago

06:14:08.284 -> [ 1248][I][artnetESP32V2.cpp:197] createBuffers(): [ARTNETESP32] nb total of buffers:0 06:14:08.329 -> [ 1256][I][artnetESP32V2.h:488] _udp_task_start(): [ARTNETESP32] QUEUES CREATED 06:14:08.329 -> [ 1263][I][artnetESP32V2.h:497] _udp_task_start(): [ARTNETESP32] no task handle 06:14:08.329 -> [ 1270][E][artnetESP32V2.cpp:350] listen(): failed to start task 06:14:10.280 -> [ 3182][V][WiFiGeneric.cpp:431] _arduino_event_cb(): Ethernet Link Up 06:14:10.280 -> [ 3183][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 20 - ETH_CONNECTED 06:14:10.280 -> [ 3183][V][WiFiGeneric.cpp:446] _arduino_event_cb(): Ethernet got newip:192.168.1.11 06:14:10.280 -> ETH Connected 06:14:10.280 -> [ 3203][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 22 - ETH_GOT_IP 06:14:10.280 -> [ 3203][D][WiFiGeneric.cpp:1138] _eventCallback(): ETH IP: 192.168.1.11, MASK: 255.255.255.0, GW: 192.168.1.1 06:14:10.280 -> ETH MAC: D0:EF:76:48:BF:EF, IPv4: 192.168.1.11 06:14:10.313 -> FULL_DUPLEX, 100Mbps