Optimizing Optical File Transfer with Desimon

Better Stackgo watch the original →

Desimon uses fountain coding to transfer files via QR code streams, but requires manual tuning of frame density and refresh rates to overcome hardware-specific bottlenecks like LCD ghosting and camera frame rate mismatches.

The Breakthrough

Desimon enables air-gapped file transfers by encoding data into a continuous stream of QR codes, utilizing fountain coding to ensure that the receiver can reconstruct the file from any subset of captured frames rather than requiring a specific sequence.

What Actually Worked

  • Fountain Coding: The system generates an effectively infinite stream of encoded frames where each frame is a mathematical blend of the original file, allowing the receiver to ignore corrupted or missed frames.
  • Hardware-Specific Tuning: To achieve reliable throughput, users must balance three variables: frame rate, QR code density (bytes per frame), and camera resolution.
  • Optimizing for Monitors: When transferring from a laptop screen at arm's length, the author improved throughput by reducing the payload to 1,465 bytes per frame (a lower QR version) and capping the transmit rate to 24 FPS to avoid blending frames due to camera/screen refresh mismatches.
  • Monitoring Throughput: The receiver code provides separate metrics for capture FPS and decode FPS, allowing users to diagnose whether failures stem from camera resolution limits or frame rate synchronization issues.

Before / After

  • Default Settings (Laptop to Phone): 3 kilobytes per second throughput, with only 1 to 2% of frames successfully decoded.
  • Optimized Settings (Phone to Phone): 128 kilobytes per second peak throughput, achieved by using high-contrast OLED screens at close range to match the receiver's resolution and frame rate capabilities.

Context

Optical file transfer bypasses network stacks and physical ports by using a screen as a transmitter and a camera as a receiver. The primary challenge is the synchronization of two independent hardware systems: the sender's display refresh rate and the receiver's camera exposure window. When these are misaligned, the camera captures blurred or blended frames that cannot be decoded. The project demonstrates that while fountain coding makes the transmission robust against packet loss, the physical constraints of the hardware require manual configuration adjustments to maintain usable speeds.

  • #tutorial
  • #dev-tooling
  • #ai

summary by google/gemini-3.1-flash-lite. probably wrong about something. check the source.