UAT 207 Communication and Data Network Systems
Worksheet 3 Capturing and analysing MAVLink
Objective
Read MAVLink messages with a script, compute packet loss from sequence numbers and detect bad frames in a byte stream
Equipment and materials
- ArduPilot SITL and MAVProxy
- Python with pymavlink
- Wireshark
- Telemetry radio on a serial port (if available)
Safety
- Simulation and bench work only; no flying
Steps
- Start SITL and MAVProxy; record endpoints, ports and system IDs
- Write a pymavlink script that reads ATTITUDE and logs sequence and time to CSV
- Use Example 1 to compute packet loss per sender
- Capture loopback packets with Wireshark; compare the rate with the script
- If a radio is available, record raw serial bytes and count bad frames with Example 2
Record of results
| Component | Endpoint or IP address | Port | System ID / component ID |
|---|---|---|---|
| Sender (sysid/compid) | Received | Lost | Loss rate (%) | Wireshark packet rate (per s) | Script read rate (per s) |
|---|---|---|---|---|---|
Questions
What packet loss did you compute in SITL? If it is unusually high, check whether you merged several senders or forgot the wrap after 255.
Did the Wireshark packet rate differ from the rate the script read? If packets arrive often but the position value never changes, what does that tell you?
When a frame fails its CRC, what does the receiver do next, and why is that better than passing the frame's values to the application?
The companion computer at 192.168.10.70 cannot get heartbeats to the GCS at 192.168.10.10/26 although the radio works. What do you check before blaming the radio?
Check before you hand in
What to hand in
- Connection diagram
- Script and CSV file
- Packet-loss table against Wireshark
- Bad-frame count with explanation