https://github.com/patrikcze/meshtatic_data
Meshtastic Data Transfer - Trying some stupid thing, like transferring files over LORA network.
https://github.com/patrikcze/meshtatic_data
data meshtastic meshtastic-python
Last synced: 5 months ago
JSON representation
Meshtastic Data Transfer - Trying some stupid thing, like transferring files over LORA network.
- Host: GitHub
- URL: https://github.com/patrikcze/meshtatic_data
- Owner: patrikcze
- Created: 2026-01-24T10:36:56.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-01-24T12:42:05.000Z (6 months ago)
- Last Synced: 2026-01-25T00:33:30.641Z (6 months ago)
- Topics: data, meshtastic, meshtastic-python
- Language: Python
- Homepage:
- Size: 1.32 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# Meshtatic Data Transfer
A Python project scaffolding for "Meshtatic Data Transfer". Follows a src/ layout, per-project venv, pinned deps, and one-command workflow.
## Quick start
1. Create venv: `python3 -m venv .venv`
2. Activate: `source .venv/bin/activate`
3. Install dev tools: `python -m pip install -r requirements-dev.txt`
4. Run checks: `make test`
## Usage
- Help:
- `make run`
### Quick start: send a file over Meshtastic (serial)
1) Install the runtime library (once):
- `make install-meshtastic`
2) Identify your serial port (macOS example):
- `ls /dev/cu.* | grep -i modem`
3) Send a file (defaults: broadcast, active channel on the device):
- `make run-send TRANSPORT=meshtastic PORT=/dev/cu.usbmodemXXXX INPUT=path/to/file.bin MAX_CHUNK=180`
- By default, the sender embeds the file name, size, and CRC in a small metadata header; the listener uses it to restore the filename. Use `--raw` to disable metadata, or `--name` to override.
#### Addressed send and reliable delivery
- Send to a specific node (quote the `!` in zsh to avoid history expansion):
- macOS/Linux (zsh/bash):
- `. .venv/bin/activate && PYTHONPATH=src python -m meshtatic_data_transfer send --transport meshtastic --port /dev/cu.usbmodemXXXX --input ./file.bin --max-chunk 180 --dest '!abcdef12' --reliable`
- Windows PowerShell:
- `python -m meshtatic_data_transfer send --transport meshtastic --port COM7 --input .\file.bin --max-chunk 180 --dest '!abcdef12' --reliable`
- Alternative escaping: `--dest \!abcdef12`
### Receiver options on the other node
- One-shot receive to stdout (exits after first complete message or timeout):
- `make run-recv TRANSPORT=meshtastic PORT=/dev/cu.usbmodemXXXX TIMEOUT=15 > out.bin`
- Verify roundtrip: `cmp -l path/to/file.bin out.bin` (no output means identical)
- Continuous listener (saves each message to files):
- `make run-listen TRANSPORT=meshtastic PORT=/dev/cu.usbmodemXXXX OUT_DIR=received MAX_MESSAGES=0`
- Output example: `saved 2048 bytes -> received/7f353d62_1769248713.bin`
### Fake transport (local, no radios)
- Note: the fake transport is in-process for tests/dev. To demo a roundtrip without radios in a single command, use:
- `make run-fake-roundtrip INPUT=path/to/file.bin`
- If you run sender/receiver as separate processes with TRANSPORT=fake, they won’t see each other (by design).
### Notes
- Visibility: binary payloads use Meshtastic PRIVATE_APP. They do not appear in the chat UI. Use the app’s debug view or the `listen` command to observe arrivals.
- Listener behavior: `listen` reassembles messages, deduplicates by message_id, restores filenames from metadata, and avoids overwriting by appending a timestamp if necessary.
- Encryption: payloads inherit the device’s channel encryption (default channel uses the well-known key; private channels use your private key).
- Size: payloads larger than the radio MTU are automatically chunked (e.g., 2 KiB works with `MAX_CHUNK=180`).
- Troubleshooting: if serial send fails, confirm the correct `PORT` and that the venv has `meshtastic` installed.