From 6e85b1bc53989e59224422117c3af31303f22312 Mon Sep 17 00:00:00 2001 From: Hans Eberle Date: Mon, 9 Mar 2026 18:11:17 +0100 Subject: [PATCH 1/2] Arduino Matrix Portal ESP32-s3 support added --- partitions_6MB.csv | 6 +++ platformio.ini | 32 ++++++++++++- src/displays/Esp32LedMatrix.cpp | 3 +- src/displays/Esp32LedMatrix.h | 17 ++++++- src/main.cpp | 76 ++++++++++++++++++++++++------- src/main.h | 5 +- src/transports/usb_transport.cpp | 2 +- src/transports/wifi_transport.cpp | 6 ++- 8 files changed, 122 insertions(+), 25 deletions(-) create mode 100644 partitions_6MB.csv diff --git a/partitions_6MB.csv b/partitions_6MB.csv new file mode 100644 index 0000000..a0b6629 --- /dev/null +++ b/partitions_6MB.csv @@ -0,0 +1,6 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +zedmd, app, ota_0, 0x10000, 0x200000, +spiffs, data, spiffs, 0x210000, 0x4D0000, +coredump, data, coredump, 0x6E0000, 0x20000, \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 6cdb602..06c553f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,11 +9,12 @@ ; https://docs.platformio.org/page/projectconf.html [platformio] -default_envs = S3-N16R8_128x32 +default_envs = MatrixPortalS3_128x32 [esp32] framework = arduino -platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip +;platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip +platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.37/platform-espressif32.zip board = esp32dev board_build.partitions = partitions.csv board_build.filesystem = littlefs @@ -319,3 +320,30 @@ lib_deps = ${ppucdmd.lib_deps} build_flags = ${ppucdmd.build_flags} -DZEDMD_HD=1 -DSPEAKER_LIGHTS=1 + +[env:MatrixPortalS3_128x32] +extends = esp32 +board = adafruit_matrixportal_esp32s3 +board_build.partitions = partitions_6MB.csv +board_build.filesystem = littlefs + +;debug_tool = esp-builtin +;debug_init_break = tbreak setup +;build_type = debug +monitor_port = COM8 +upload_port = COM9 +monitor_speed = 115200 + +lib_deps = ${esp32.lib_deps} + https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA#3.0.13 + https://github.com/adafruit/Adafruit_NeoPixel#1.12.4 + https://github.com/kitesurfer1404/WS2812FX#v1.4.5 +build_flags = ${esp32.build_flags} + -DBOARD_HAS_PSRAM=1 + -DARDUINO_USB_MODE=1 + -DARDUINO_USB_CDC_ON_BOOT=1 + ;-DZEDMD_NO_NETWORKING=1 + -DDISPLAY_LED_MATRIX=1 + -DARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3=1 + -DPIXEL_COLOR_DEPTH_BITS=8 + -DZEDMD_WIFI_ONLY=1 \ No newline at end of file diff --git a/src/displays/Esp32LedMatrix.cpp b/src/displays/Esp32LedMatrix.cpp index 9231e0f..7493985 100644 --- a/src/displays/Esp32LedMatrix.cpp +++ b/src/displays/Esp32LedMatrix.cpp @@ -1,6 +1,7 @@ #if defined(DISPLAY_LED_MATRIX) && defined(ESP_BUILD) #include "Esp32LedMatrix.h" +#include Esp32LedMatrix::Esp32LedMatrix() { int8_t colorPins1[3] = {R1_PIN, G1_PIN, B1_PIN}; @@ -19,7 +20,6 @@ Esp32LedMatrix::Esp32LedMatrix() { LAT_PIN, OE_PIN, CLK_PIN}; - HUB75_I2S_CFG mxconfig(PANEL_WIDTH, PANEL_HEIGHT, PANELS_NUMBER, pins); // Without setting clkphase to false, HD panels seem to flicker. mxconfig.clkphase = (panelClkphase == 1); @@ -31,7 +31,6 @@ Esp32LedMatrix::Esp32LedMatrix() { mxconfig.latch_blanking = panelLatchBlanking; mxconfig.min_refresh_rate = panelMinRefreshRate; mxconfig.driver = (HUB75_I2S_CFG::shift_driver)panelDriver; - dma_display = new MatrixPanel_I2S_DMA(mxconfig); dma_display->begin(); } diff --git a/src/displays/Esp32LedMatrix.h b/src/displays/Esp32LedMatrix.h index e8d2b46..7373c3a 100644 --- a/src/displays/Esp32LedMatrix.h +++ b/src/displays/Esp32LedMatrix.h @@ -1,7 +1,7 @@ #ifndef ESP32LEDMATRIX_H #define ESP32LEDMATRIX_H -#ifdef ARDUINO_ESP32_S3_N16R8 +#if defined(ARDUINO_ESP32_S3_N16R8) #define R1_PIN 4 #define G1_PIN 5 #define B1_PIN 6 @@ -16,6 +16,21 @@ #define LAT_PIN 40 #define OE_PIN 2 #define CLK_PIN 41 +#elif defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) +#define R1_PIN 42 +#define G1_PIN 41 +#define B1_PIN 40 +#define R2_PIN 38 +#define G2_PIN 39 +#define B2_PIN 37 +#define A_PIN 45 +#define B_PIN 36 +#define C_PIN 48 +#define D_PIN 35 +#define E_PIN 21 +#define LAT_PIN 47 +#define OE_PIN 14 +#define CLK_PIN 2 #else // Pinout derived from ESP32-HUB75-MatrixPanel-I2S-DMA.h #define R1_PIN 25 diff --git a/src/main.cpp b/src/main.cpp index a9b7ec3..486da35 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,7 +37,7 @@ #endif // Specific improvements and #define for the ESP32 S3 series -#if defined(ARDUINO_ESP32_S3_N16R8) || defined(DISPLAY_RM67162_AMOLED) +#if defined(ARDUINO_ESP32_S3_N16R8) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) || defined(DISPLAY_RM67162_AMOLED) #include "S3Specific.h" #endif #ifndef PICO_BUILD @@ -69,7 +69,7 @@ #define BC 2 #ifdef SPEAKER_LIGHTS -#ifdef ARDUINO_ESP32_S3_N16R8 +#if defined(ARDUINO_ESP32_S3_N16R8) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) #define SPEAKER_LIGHTS_LEFT_PIN 9 // Left speaker LED strip #define SPEAKER_LIGHTS_RIGHT_PIN 10 // Right speaker LED strip #elif defined(DMDREADER) @@ -336,11 +336,12 @@ DisplayDriver *GetDisplayDriver() { return display; } void TransportCreate(const uint8_t type = #ifdef DMDREADER - Transport::SPI + Transport::SPI #elif defined(ZEDMD_WIFI_ONLY) - Transport::WIFI_UDP + //Transport::WIFI_UDP + Transport::WIFI_TCP #else - Transport::USB + Transport::USB #endif ) { @@ -362,6 +363,7 @@ void TransportCreate(const uint8_t type = case Transport::WIFI_UDP: case Transport::WIFI_TCP: { transport = new WifiTransport(); + Serial.println("WifiTransport created"); break; } #endif @@ -414,7 +416,8 @@ void LoadTransport() { #ifdef DMDREADER Transport::SPI #elif defined(ZEDMD_WIFI_ONLY) - Transport::WIFI_UDP + //Transport::WIFI_UDP + Transport::WIFI_TCP #else Transport::USB #endif @@ -1179,12 +1182,12 @@ uint8_t HandleData(uint8_t *pData, size_t len) { response[N_INTERMEDIATE_CTR_CHARS + 18] = 0; #endif #if defined(ARDUINO_ESP32_S3_N16R8) || defined(DISPLAY_RM67162_AMOLED) || \ - defined(PICO_BUILD) + defined(PICO_BUILD) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) response[N_INTERMEDIATE_CTR_CHARS + 18] += 0b00000010; #endif response[N_INTERMEDIATE_CTR_CHARS + 19] = shortId & 0xff; response[N_INTERMEDIATE_CTR_CHARS + 20] = (shortId >> 8) & 0xff; -#if defined(ARDUINO_ESP32_S3_N16R8) +#if defined(ARDUINO_ESP32_S3_N16R8) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) response[N_INTERMEDIATE_CTR_CHARS + 21] = 1; // ESP32 S3 #elif defined(DISPLAY_RM67162_AMOLED) response[N_INTERMEDIATE_CTR_CHARS + 21] = 2; // ESP32 S3 with @@ -1807,7 +1810,47 @@ uint8_t HandleData(uint8_t *pData, size_t len) { return 0; } +void PrintFileSystem(fs::FS &fs, const char * dirname, uint8_t depth) { + + File root = fs.open(dirname); + if(!root || !root.isDirectory()) { + Serial.println("Verzeichnis konnte nicht geoeffnet werden"); + return; + } + + File file = root.openNextFile(); + + while(file) { + + for(int i = 0; i < depth; i++) { + Serial.print(" "); + } + + if(file.isDirectory()) { + + Serial.print("[DIR] "); + Serial.println(file.name()); + + PrintFileSystem(fs, file.name(), depth + 1); + + } else { + + Serial.print("[FILE] "); + Serial.print(file.name()); + Serial.print(" ("); + Serial.print(file.size()); + Serial.println(" bytes)"); + } + + file = root.openNextFile(); + } +} + void setup() { + + Serial.begin(115200); + Serial.println("setup started"); + #ifndef PICO_BUILD esp_log_level_set("*", ESP_LOG_NONE); #else @@ -1861,9 +1904,9 @@ void setup() { #endif bool fileSystemOK; - if ((fileSystemOK = LittleFS.begin())) { + if ((fileSystemOK = LittleFS.begin(true))) { LoadSettingsMenu(); - LoadTransport(); + LoadTransport(); #ifdef DMDREADER LoadColor(); @@ -1893,12 +1936,11 @@ void setup() { display = (DisplayDriver *)new PicoLedMatrix(); // For pico LED matrix display #else - display = + display = (DisplayDriver *)new Esp32LedMatrix(); // For ESP32 LED matrix display #endif #endif display->SetBrightness(brightness); - if (!fileSystemOK) { display->DisplayText("Error reading file system!", 0, 0, 255, 0, 0); display->DisplayText("Try to flash the firmware again.", 0, 6, 255, 0, 0); @@ -1963,7 +2005,6 @@ void setup() { } memset(renderBuffer[i], 0, TOTAL_BYTES); } - #ifndef DISPLAY_RM67162_AMOLED if (settingsMenu) { // Turn off settings menu after restart here. @@ -1987,7 +2028,7 @@ void setup() { upButton->interval(100); upButton->setPressedState(LOW); -#if defined(ARDUINO_ESP32_S3_N16R8) || defined(PICO_BUILD) +#if defined(ARDUINO_ESP32_S3_N16R8) || defined(PICO_BUILD) const auto backwardButton = new Bounce2::Button(); backwardButton->attach(BACKWARD_BUTTON_PIN, INPUT_PULLUP); backwardButton->interval(100); @@ -2229,6 +2270,7 @@ void setup() { #endif pinMode(FORWARD_BUTTON_PIN, INPUT_PULLUP); + #ifdef PICO_BUILD // do not leave some pin configured as adc / floating pinMode(BACKWARD_BUTTON_PIN, INPUT_PULLUP); @@ -2240,12 +2282,12 @@ void setup() { DisplayLogo(); DisplayId(); display->Render(); - // Create synchronization primitives for (uint8_t i = 0; i < NUM_BUFFERS; i++) { #ifdef BOARD_HAS_PSRAM buffers[i] = (uint8_t *)heap_caps_malloc( BUFFER_SIZE, MALLOC_CAP_SPIRAM | MALLOC_CAP_32BIT); + #else buffers[i] = (uint8_t *)malloc(BUFFER_SIZE); #endif @@ -2255,7 +2297,6 @@ void setup() { while (1); } } - #ifdef SPEAKER_LIGHTS if (speakerLightsLeftNumLeds > 0) { speakerLightsLeft = @@ -2284,10 +2325,11 @@ void setup() { static_cast(transport)->SetColor((Color)loopbackColor); #endif transport->init(); - #ifdef DMDREADER core_0_initialized = true; #endif + PrintFileSystem(LittleFS, "/", 0); +Serial.println("Setup done"); } void loop() { diff --git a/src/main.h b/src/main.h index b64460f..8e274a3 100644 --- a/src/main.h +++ b/src/main.h @@ -45,7 +45,7 @@ #endif #if defined(ARDUINO_ESP32_S3_N16R8) || defined(DISPLAY_RM67162_AMOLED) || \ - defined(PICO_BUILD) + defined(PICO_BUILD) || defined(DISPLAY_RM67162_AMOLED) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) // USB CDC #define SERIAL_BAUD 115200 #define USB_PACKAGE_SIZE 512 @@ -71,6 +71,9 @@ #elif defined(DISPLAY_RM67162_AMOLED) #define UP_BUTTON_PIN 0 #define FORWARD_BUTTON_PIN 21 +#elif defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) +#define UP_BUTTON_PIN 6 +#define FORWARD_BUTTON_PIN 7 #else #define UP_BUTTON_PIN 21 #define FORWARD_BUTTON_PIN 33 diff --git a/src/transports/usb_transport.cpp b/src/transports/usb_transport.cpp index 573168c..2af3fb9 100644 --- a/src/transports/usb_transport.cpp +++ b/src/transports/usb_transport.cpp @@ -45,7 +45,7 @@ void UsbTransport::Task_ReadSerial(void* pvParameters) { tud_cdc_set_rx_buffer_size(usbPackageSize + 128); #else Serial.setRxBufferSize(usbPackageSize + 128); - Serial.setTxBufferSize(64); + Serial.setRxBufferSize(64); #endif #if (defined(ARDUINO_USB_MODE) && ARDUINO_USB_MODE == 1) // S3 USB CDC. The actual baud rate doesn't matter. diff --git a/src/transports/wifi_transport.cpp b/src/transports/wifi_transport.cpp index 916472b..f5ced4f 100644 --- a/src/transports/wifi_transport.cpp +++ b/src/transports/wifi_transport.cpp @@ -113,10 +113,11 @@ bool WifiTransport::init() { GetDisplayDriver()->DisplayText("zedmd-wifi.local", 0, TOTAL_HEIGHT - 5, 0, 0, 0, true); - + Serial.print("Start webserver "); startServer(); if (m_type == WIFI_UDP) { + Serial.println("as udp"); udp = new AsyncUDP(); udp->onPacket(HandleUdpPacket); if (!udp->listen(ip, port)) { @@ -126,6 +127,7 @@ bool WifiTransport::init() { } } else { tcp = new AsyncServer(port); + Serial.println("as tcp"); tcp->setNoDelay(true); tcp->onClient(&NewTcpClient, tcp); tcp->begin(); @@ -253,6 +255,8 @@ void WifiTransport::startServer() { // Serve index.html server->on("/", HTTP_GET, [](AsyncWebServerRequest* request) { + + Serial.println("get index.html"); request->send(LittleFS, "/index.html", String(), false); }); From b349295fe1e8c35fa43120bb036cdc322a49a1bc Mon Sep 17 00:00:00 2001 From: Hans Eberle Date: Thu, 12 Mar 2026 22:42:20 +0100 Subject: [PATCH 2/2] Changes due to review feedback --- platformio.ini | 12 +---- src/main.cpp | 76 +++++++------------------------ src/main.h | 3 +- src/transports/usb_transport.cpp | 2 +- src/transports/wifi_transport.cpp | 4 -- 5 files changed, 21 insertions(+), 76 deletions(-) diff --git a/platformio.ini b/platformio.ini index 06c553f..1199de7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -326,14 +326,6 @@ extends = esp32 board = adafruit_matrixportal_esp32s3 board_build.partitions = partitions_6MB.csv board_build.filesystem = littlefs - -;debug_tool = esp-builtin -;debug_init_break = tbreak setup -;build_type = debug -monitor_port = COM8 -upload_port = COM9 -monitor_speed = 115200 - lib_deps = ${esp32.lib_deps} https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA#3.0.13 https://github.com/adafruit/Adafruit_NeoPixel#1.12.4 @@ -342,8 +334,6 @@ build_flags = ${esp32.build_flags} -DBOARD_HAS_PSRAM=1 -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 - ;-DZEDMD_NO_NETWORKING=1 -DDISPLAY_LED_MATRIX=1 -DARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3=1 - -DPIXEL_COLOR_DEPTH_BITS=8 - -DZEDMD_WIFI_ONLY=1 \ No newline at end of file + -DPIXEL_COLOR_DEPTH_BITS=8 \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 486da35..bbd2886 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,7 +37,9 @@ #endif // Specific improvements and #define for the ESP32 S3 series -#if defined(ARDUINO_ESP32_S3_N16R8) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) || defined(DISPLAY_RM67162_AMOLED) +#if defined(ARDUINO_ESP32_S3_N16R8) || \ + defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) || \ + defined(DISPLAY_RM67162_AMOLED) #include "S3Specific.h" #endif #ifndef PICO_BUILD @@ -69,7 +71,8 @@ #define BC 2 #ifdef SPEAKER_LIGHTS -#if defined(ARDUINO_ESP32_S3_N16R8) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) +#if defined(ARDUINO_ESP32_S3_N16R8) || \ + defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) #define SPEAKER_LIGHTS_LEFT_PIN 9 // Left speaker LED strip #define SPEAKER_LIGHTS_RIGHT_PIN 10 // Right speaker LED strip #elif defined(DMDREADER) @@ -261,8 +264,8 @@ void DoRestart(int sec) { if (rebootToBootloader) rp2040.rebootToBootloader(); #endif - // Note: ESP.restart() or esp_restart() will keep the state of global and - // static variables. And not all sub-systems get resetted. + // Note: ESP.restart() or esp_restart() will keep the state of global and + // static variables. And not all sub-systems get resetted. #if (defined(ARDUINO_USB_MODE) && ARDUINO_USB_MODE == 1) #ifdef PICO_BUILD rp2040.reboot(); @@ -336,12 +339,11 @@ DisplayDriver *GetDisplayDriver() { return display; } void TransportCreate(const uint8_t type = #ifdef DMDREADER - Transport::SPI + Transport::SPI #elif defined(ZEDMD_WIFI_ONLY) - //Transport::WIFI_UDP - Transport::WIFI_TCP + Transport::WIFI_UDP #else - Transport::USB + Transport::USB #endif ) { @@ -363,7 +365,6 @@ void TransportCreate(const uint8_t type = case Transport::WIFI_UDP: case Transport::WIFI_TCP: { transport = new WifiTransport(); - Serial.println("WifiTransport created"); break; } #endif @@ -416,8 +417,7 @@ void LoadTransport() { #ifdef DMDREADER Transport::SPI #elif defined(ZEDMD_WIFI_ONLY) - //Transport::WIFI_UDP - Transport::WIFI_TCP + Transport::WIFI_UDP #else Transport::USB #endif @@ -1187,7 +1187,8 @@ uint8_t HandleData(uint8_t *pData, size_t len) { #endif response[N_INTERMEDIATE_CTR_CHARS + 19] = shortId & 0xff; response[N_INTERMEDIATE_CTR_CHARS + 20] = (shortId >> 8) & 0xff; -#if defined(ARDUINO_ESP32_S3_N16R8) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) +#if defined(ARDUINO_ESP32_S3_N16R8) || \ + defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) response[N_INTERMEDIATE_CTR_CHARS + 21] = 1; // ESP32 S3 #elif defined(DISPLAY_RM67162_AMOLED) response[N_INTERMEDIATE_CTR_CHARS + 21] = 2; // ESP32 S3 with @@ -1201,7 +1202,6 @@ uint8_t HandleData(uint8_t *pData, size_t len) { #else response[N_INTERMEDIATE_CTR_CHARS + 21] = 0; // ESP32 #endif - response[63 - N_ACK_CHARS] = 'R'; Serial.write(response, 64 - N_ACK_CHARS); // This flush is required for USB CDC on Windows. @@ -1810,47 +1810,7 @@ uint8_t HandleData(uint8_t *pData, size_t len) { return 0; } -void PrintFileSystem(fs::FS &fs, const char * dirname, uint8_t depth) { - - File root = fs.open(dirname); - if(!root || !root.isDirectory()) { - Serial.println("Verzeichnis konnte nicht geoeffnet werden"); - return; - } - - File file = root.openNextFile(); - - while(file) { - - for(int i = 0; i < depth; i++) { - Serial.print(" "); - } - - if(file.isDirectory()) { - - Serial.print("[DIR] "); - Serial.println(file.name()); - - PrintFileSystem(fs, file.name(), depth + 1); - - } else { - - Serial.print("[FILE] "); - Serial.print(file.name()); - Serial.print(" ("); - Serial.print(file.size()); - Serial.println(" bytes)"); - } - - file = root.openNextFile(); - } -} - void setup() { - - Serial.begin(115200); - Serial.println("setup started"); - #ifndef PICO_BUILD esp_log_level_set("*", ESP_LOG_NONE); #else @@ -1906,7 +1866,7 @@ void setup() { bool fileSystemOK; if ((fileSystemOK = LittleFS.begin(true))) { LoadSettingsMenu(); - LoadTransport(); + LoadTransport(); #ifdef DMDREADER LoadColor(); @@ -1936,7 +1896,7 @@ void setup() { display = (DisplayDriver *)new PicoLedMatrix(); // For pico LED matrix display #else - display = + display = (DisplayDriver *)new Esp32LedMatrix(); // For ESP32 LED matrix display #endif #endif @@ -2028,7 +1988,7 @@ void setup() { upButton->interval(100); upButton->setPressedState(LOW); -#if defined(ARDUINO_ESP32_S3_N16R8) || defined(PICO_BUILD) +#if defined(ARDUINO_ESP32_S3_N16R8) || defined(PICO_BUILD) const auto backwardButton = new Bounce2::Button(); backwardButton->attach(BACKWARD_BUTTON_PIN, INPUT_PULLUP); backwardButton->interval(100); @@ -2287,7 +2247,7 @@ void setup() { #ifdef BOARD_HAS_PSRAM buffers[i] = (uint8_t *)heap_caps_malloc( BUFFER_SIZE, MALLOC_CAP_SPIRAM | MALLOC_CAP_32BIT); - + #else buffers[i] = (uint8_t *)malloc(BUFFER_SIZE); #endif @@ -2328,8 +2288,6 @@ void setup() { #ifdef DMDREADER core_0_initialized = true; #endif - PrintFileSystem(LittleFS, "/", 0); -Serial.println("Setup done"); } void loop() { diff --git a/src/main.h b/src/main.h index 8e274a3..e30edfb 100644 --- a/src/main.h +++ b/src/main.h @@ -45,7 +45,8 @@ #endif #if defined(ARDUINO_ESP32_S3_N16R8) || defined(DISPLAY_RM67162_AMOLED) || \ - defined(PICO_BUILD) || defined(DISPLAY_RM67162_AMOLED) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) + defined(PICO_BUILD) || defined(DISPLAY_RM67162_AMOLED) || \ + defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) // USB CDC #define SERIAL_BAUD 115200 #define USB_PACKAGE_SIZE 512 diff --git a/src/transports/usb_transport.cpp b/src/transports/usb_transport.cpp index 2af3fb9..573168c 100644 --- a/src/transports/usb_transport.cpp +++ b/src/transports/usb_transport.cpp @@ -45,7 +45,7 @@ void UsbTransport::Task_ReadSerial(void* pvParameters) { tud_cdc_set_rx_buffer_size(usbPackageSize + 128); #else Serial.setRxBufferSize(usbPackageSize + 128); - Serial.setRxBufferSize(64); + Serial.setTxBufferSize(64); #endif #if (defined(ARDUINO_USB_MODE) && ARDUINO_USB_MODE == 1) // S3 USB CDC. The actual baud rate doesn't matter. diff --git a/src/transports/wifi_transport.cpp b/src/transports/wifi_transport.cpp index f5ced4f..391cfa7 100644 --- a/src/transports/wifi_transport.cpp +++ b/src/transports/wifi_transport.cpp @@ -113,11 +113,9 @@ bool WifiTransport::init() { GetDisplayDriver()->DisplayText("zedmd-wifi.local", 0, TOTAL_HEIGHT - 5, 0, 0, 0, true); - Serial.print("Start webserver "); startServer(); if (m_type == WIFI_UDP) { - Serial.println("as udp"); udp = new AsyncUDP(); udp->onPacket(HandleUdpPacket); if (!udp->listen(ip, port)) { @@ -127,7 +125,6 @@ bool WifiTransport::init() { } } else { tcp = new AsyncServer(port); - Serial.println("as tcp"); tcp->setNoDelay(true); tcp->onClient(&NewTcpClient, tcp); tcp->begin(); @@ -256,7 +253,6 @@ void WifiTransport::startServer() { // Serve index.html server->on("/", HTTP_GET, [](AsyncWebServerRequest* request) { - Serial.println("get index.html"); request->send(LittleFS, "/index.html", String(), false); });