How to extract packet captured with lua plugin for mavlink protocol in python?
I have used this to generate lua plugin for wireshark to capture mavlink packets. I have captured mavlink packets but shows error and has been discussed on GitHub.
https://github.com/mavlink/mavlink/is...
Now my question is how to extract information from packets which have been exported from wireshark. I have tried this code but it does not show any output.
import pyshark
capture = pyshark.FileCapture('mavlink/mission.pcapng', display_filter='TCP')
capture.set_debug()
for packet in capture:
src_ip = packet.ip.src
dst_ip = packet.ip.dst
src_port = packet.udp.srcport
dst_port = packet.udp.dstport
mavlink_payload = packet.mavlink.payload
print(f'Source IP: {src_ip}, Destination IP: {dst_ip}, '
f'Source Port: {src_port}, Destination Port: {dst_port}, '
f'Mavlink Payload: {mavlink_payload}')
capture. Close()
Well, at the very least, shouldn't your
display_filter
be set to'UDP'
, not'TCP'
?I have used MissionPlanner to connect to drone and TCP port 5760 was used. So, I have used udp and it does show some output but the mavlink protocol information need to extracted?