Skip to content

WebSocket: ask for 4000-byte file upload blocks - #20

Merged
robdobsn merged 1 commit into
mainfrom
feature/ws-upload-block-4000
Oct 24, 2026
Merged

robdobsn merged 1 commit into
mainfrom
feature/ws-upload-block-4000

Conversation

@robdobsn

Copy link
Copy Markdown
Owner

Summary

  • RaftChannelWebSocket asks for 4000-byte file upload blocks instead of 500.
  • The device's reply to ufStart still decides the size:
  • BLE, WebSerial and the simulated channel are unchanged.

Why 4000

200 KB uploads over WebSocket to an ESP32-S3 with PSRAM (Axiom plant growth board), measured with RaftCLI against the same firmware:

Storage 800-byte blocks 4000 16000
SD card 29 KB/s 52 KB/s 57 KB/s
LittleFS 12 KB/s 14 KB/s 12 KB/s

The device writes each block in its main loop, so bigger blocks mean longer pauses there. 16000 is only a little faster than 4000. RaftCLI asks for 4000 too.

Test plan

  • tsc --noEmit and jest: 237 tests pass
  • An upload from a web app over WebSocket (not run: the figures above are from RaftCLI, which uses the same firmware protocol)

🤖 Generated with Claude Code

The WebSocket channel asked for 500-byte blocks. The device's reply to ufStart
decides the size: older firmware allows 800 on WebSocket, and firmware with
PSRAM from 2026-10 (RaftWebServer PR #6) up to 16000. Bigger blocks are faster
where storage is fast: 200 KB uploads to an SD card on an ESP32-S3 took 29 KB/s
with 800-byte blocks and 52 KB/s with 4000. The device writes each block in its
main loop, so 4000 keeps each write short (16000 was only a little faster).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robdobsn
robdobsn merged commit 4da290a into main Oct 24, 2026
1 check passed
@robdobsn
robdobsn deleted the feature/ws-upload-block-4000 branch October 24, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant