broken-transmitter is a Raspberry Pi to Raspberry Pi file transfer project built around nRF24L01 radios, a fixed 32-byte packet format, and deliberately fragile transmission algorithms.
- Pi A runs the transmitter web app.
- Pi B runs the receiver web app.
- The transmitter selects an algorithm per transfer.
- The receiver auto-detects the matching decoder from the
STARTpacket flags.
This project explores how different transport styles behave when the radio link is intentionally lossy. Best way to observe this behaviour is to transmit BMP image files.
Transfers follow one control-plane flow and then diverge into algorithm-specific data packets:
- TX sends
START. - TX may send up to three
START_HEADERpackets for file header recovery. - TX streams algorithm-specific body packets.
- TX sends
STOP. - RX sends
START_ACKandSTOP_ACKwhen it can.
src/broken_transmitter/core/: runtime models, transmitter pipeline, receiver state machine, and receiver service threadsrc/broken_transmitter/wire/: packet constants, flag helpers, and packet serialization/parsingsrc/broken_transmitter/transport/: RF24 transports and in-memory transports used by testssrc/broken_transmitter/algorithms/: transfer algorithms plus the explicit algorithm manifestsrc/broken_transmitter/web/: TX/RX FastAPI app composition, app state, and serializerssrc/broken_transmitter/templates/: Jinja templates for the TX/RX web pagessrc/broken_transmitter/static/: CSS and browser-side JavaScript
- Raspberry Pi OS with SPI enabled
- 2 x nRF24L01 modules powered correctly at 3.3V
- Python 3.11+
pyrf24installed on the target Pis
Use the deployment script from this repo root:
scripts/deploy.sh \
--tx-host transmitter.local \
--rx-host receiver.local \
--user piBy default, this syncs the repo, optionally bootstraps the Python environment, updates .env.tx / .env.rx, and refreshes the remote run-tx.sh / run-rx.sh launchers. It does not create or restart systemd services unless you opt in.
Example with explicit overrides:
scripts/deploy.sh \
--tx-host 192.168.1.50 \
--rx-host 192.168.1.51 \
--user pi \
--tx-web-port 8080 \
--rx-web-port 8080 \
--ce-pin 22 \
--channel 108 \
--tx-address BTX01 \
--rx-address BRX01After a default deployment:
- TX:
ssh pi@<tx-host> 'cd /home/pi/broken-transmitter && ./run-tx.sh' - RX:
ssh pi@<rx-host> 'cd /home/pi/broken-transmitter && ./run-rx.sh'
The current test suite uses unittest and does not require RF hardware.
Install dev tooling:
uv sync --all-extras --devInstall and run pre-commit:
uv run pre-commit install
uv run pre-commit run --all-filesRun tests:
uv run python -m unittest discover -s tests -v