It’s been a week since launch and in that time I’ve been working on improvements, bug fixes, and overall polishing of the firmware. One of the first things I wanted to do was make G-code uploads faster. During the campaign, the upload speed was measured at ~800 KiB/s on Wi-Fi and ~600 KiB/s on Ethernet. After the initial round of improvements, the upload speed is now at 1.1 MiB/s for Wi-Fi and 900 KiB/s for Ethernet.
|Wi-Fi||800 KiB/s||1.1 MiB/s|
|Ethernet||600 KiB/s||900 KiB/s|
These faster upload speeds were brought about by two improvements:
Tuning parameters. The SDK documentation for the ESP32-S3 mentions several parameters that can be adjusted in order to improve networking throughput. The most important ones are increasing the size or number of buffers and placing code related to networking in RAM, rather than in flash.
Maximizing read data. The networking task is a loop that involves reading data from the network interface, parsing the received data, and handling the parsed request. The initial code only read data from the interface in small increments. The improved code reads as much available data into buffers as possible before proceeding to the next part of the loop.
Nonetheless, there is still room to further improve upload speeds by implementing the following:
Use lower-level lwIP API. The current firmware uses the socket API, one of the APIs supported by lwiP. It is portable and easy to use, but presumably has lower throughput than the other lower-level API.
Run the SD card on high speed mode. ESP32-S3 supports running the SD card on the default speed mode (20 MHz) or on high-speed mode (40 MHz) in hardware. However, the current SDK release does not support high speed mode. Once support for high speed mode rolls out, even faster write speeds to the SD card should be attainable.