Skip to main content

mavsniff

Licence Badge Coverage Badge

Capture and replay MAVLink packets from your drone or GCS. Works on Linux and Windows.

You can read from a serial line (/dev/ttyXXX or COMx) or even from network (TCP and UDP). Mavsniff stores packets in pcapng format so you can analyse them with Wireshark.

Instalation

$ pip install mavsniff

Mavsniff is distributed via PYPI and an entrypoint mavsniff should be available in your $PATH after installation.

Usage

$ mavsniff capture --device udp://localhost:5467 --file recording --mavlink-dialect path-to-custom/my-dialect.xml
$ mavsniff replay -f recording -d /dev/ttyS0 -m my-dialect --baud=57600 # for serial line, specify baud if different from 115200
$ mavsniff ports # show available serial ports
$ mavsniff wsplugin # install Wireshark MAVlink disector plugin for reading Mavlink packets

Devices

  • -d /dev/ttyS0 - standard serial port on UNIX systems
  • -d COMx - from COM1 to COM8 - standard serial ports on Windows systems
  • -d udp://<host>:<port> or tcp://<host>:<port> - receive or send packets over network (TCP or UDP)
  • currently, there is no option how to send MAVLink packets over the network.

Dialects

Default dialect is arduinomega and version is 2.0. You can specify your custom dialect in form of mavlink's XML definition via --mavlink-dialect/-m flag. Mavsniff will copy your XML into internal pymavlink folder and compile it on the first run. All subsequent runs won't update nor recompile your dialect. Once your custom dialect was imported and compiled, you can reference by its name (XML filename without extension).

Using with network

mavsniff uses compatible format of UDP packets with QGroundControl. That means if you capture packets emitted (mirrored) by QGroundControl with Wireshark then you will be able to replay those to any serial device. Those packets have minimal ethernet header 02 00 00 00 and uses 20 bytes long IP header and only 8 bytes for a UDP header. Any other packets will not be replayable by mavsniff.

Developement

Start developing by cloning the repo and installing tha application locally

$ git clone git@github.com:katomaso/mavsniff.git && cd mavsniff
$ python -m venv .venv && source $VENV
$ pip install poetry
$ poetry install -E dev
$ poetry run pytest

Metadata

Release files for mavsniff 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mavsniff 1.0.0
File Size Uploaded
mavsniff-1.0.0.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mavsniff 1.0.0
File Interpreter ABI Platform
mavsniff-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.0 kB

Release files / mavsniff-1.0.0.tar.gz

Download URL mavsniff-1.0.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4ba9817ae43af0ce25097c70858aefb119505729782b46f609c4b3fc95e1b724
BLAKE2b-256 checksum
How to use checksums
3a3f1bccb5e950149e4c5673516aecefaa14193102dd5c41ca5aafe6f9ef8560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.2

Release files / mavsniff-1.0.0-py3-none-any.whl

Download URL mavsniff-1.0.0-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92ce3c5cb415ffe9bab7fcc8e1eba91ab26dd8a7bad6bd41dba18a29da24c862
BLAKE2b-256 checksum
How to use checksums
e9c53cd155ee4b7903a196d3329176f116d28105c2b03e5055e6f2cb87eeaf23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page