4 releases
0.2.0 | Mar 5, 2025 |
---|---|
0.1.2 | Feb 12, 2025 |
0.1.1 | Feb 9, 2025 |
0.1.0 | Feb 9, 2025 |
#153 in Command line utilities
365 downloads per month
76KB
2K
SLoC
MAVSHARK 🦈
A lightweight CLI tool for recording and replaying to MAVLink messages.
Installation
1. Install via Cargo
cargo install --path .
Or
cargo install mavshark
Usage
Basic Commands
mavshark
Clarifications
Why a heartbeat
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.
Why output to binary or .txt
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.
Which connection types
Rust mavlink is used, which allows for the following connection types:
tcpin:: to create a TCP server, listening for incoming connections tcpout:: to create a TCP client udpin:: to create a UDP server, listening for incoming packets udpout:: to create a UDP client udpbcast:: to create a UDP broadcast serial:: to create a serial connection file: to extract file data
License
MIT License. See LICENSE for details.
Dependencies
~13–24MB
~356K SLoC