| Crates.io | mavshark |
| lib.rs | mavshark |
| version | 0.2.0 |
| created_at | 2025-02-09 15:14:27.710891+00 |
| updated_at | 2025-03-05 11:00:02.457259+00 |
| description | MAVLink recorder and replayer CLI |
| homepage | https://github.com/sanderkohnstamm/mavshark |
| repository | https://github.com/sanderkohnstamm/mavshark |
| max_upload_size | |
| id | 1549026 |
| size | 109,407 |
A lightweight CLI tool for recording and replaying to MAVLink messages.
cargo install --path .
Or
cargo install mavshark
mavshark
Mavrouter will only route traffic with a header.system_id to a connection that is sending messages with that system_id. So sending the same heartbeat as a receiving system_id will allow for sniffing all their incoming messages.
Note that all messages from the drone get sent towards the connection untill mavrouter correctly registers the connection as the drones group when sending heartbeats with the drones id. This takes some seconds.
Also, if SnifferSysId is set in mavrouter and a connection sends a heartbeat with that system_id, that connection will receive all traffic for all system ids. This is the recommended way to listen to messages, as sending a heartbeat to mimic another system id might have unexpected side effects in mavrouter. This can be done as follows:
SnifferSysId=<ID>
under general in the .conf file or
--sniffer <ID>
in the command.
The mavlink connection can also be made on .bin files, all the messages are then read and parsed correctly. This happens almost instantainuously, so would not make sense to attempt to replay this.
For the replay functionality, i have added the regular output functionality that also logs the timings in between. This way, whilst replaying certain sets of commands, timing can be easily managed.
Rust mavlink is used, which allows for the following connection types:
tcpin:
MIT License. See LICENSE for details.