Repository navigation
v2.3.1: RAM needs measured, low-RAM fixes
A RAM re-measurement for the ESP32-C2 entry of the compatibility chart. It found two low-RAM problems, fixed here, and a wrong number in v2.2.0.
How much RAM MicroLink needs
Measured on the ESP32-C3 by holding RAM from boot to mimic a smaller chip, with a test build that forces a control reconnect 60 s in (as when the server closes the connection):
| Free after WiFi connects | Joins | Re-joins after a reconnect |
|---|---|---|
| 226 KB (C3 as is) | Yes | Yes |
| 185 KB | Yes | Yes (lowest free 25 KB) |
| 164 KB | Yes | No: the peer list no longer fits in one block |
| 156 KB | Yes | No |
| 143 KB | Joins, then loses the control connection (v2.2.0 too) | No |
So a board needs about 185 KB free after WiFi to stay on the tailnet over time. The ESP32-C2 has about 95 KB by default and about 169 KB with Espressif's deepest RAM tuning, so it stays "Low RAM". The v2.2.0 note "still joins with only 185 KB free at boot" (about 143 KB after WiFi) was wrong: it joined, but lost the control connection right after.
Fixes
| Problem | Before | After |
|---|---|---|
| Re-registering with little RAM | The RegisterResponse (~600 bytes) was read into 16 KB + 8 KB buffers; with ~143 KB after WiFi every re-registration failed | 6 KB + 4 KB; re-registration passes at that level |
| Long-poll message when RAM is tight | The 22 KB full netmap sent first on each long-poll was taken even with little RAM left | Skipped when it would leave less than 48 KB (keepalives and small updates are always taken). Normal boards still parse it |
| Running out of memory reading a control message | No log, and errno could still hold an old EAGAIN, so the half-read stream was treated as "no data" |
Logged with the frame size and free heap, and the connection is reopened |
| Build warnings | 9 (unused functions and variables) | 0 |
Out of memory for MapResponse now also shows the free heap and the largest free block.
Full history: CHANGELOG.md