Phi Mainboard 5LC

An open source ESP32 3D printer controller with built-in Wi-Fi and Ethernet

Dec 01, 2021

Improving G-code upload speed

by Renz Christian Bagaporo

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.

BeforeAfter
Wi-Fi800 KiB/s1.1 MiB/s
Ethernet600 KiB/s900 KiB/s

These faster upload speeds were brought about by two improvements:

  1. 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.

  2. 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:

  1. 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.

  2. 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.


Sign up to receive future updates for Phi Mainboard 5LC.

Phi Mainboard 5LC is part of Microchip Get Launched!


Subscribe to the Crowd Supply newsletter, highlighting the latest creators and projects