I’m trying to get mavproxy.py on a raspberry pi to connect to a flight controller via udp using a MAVlink ESP32 wifi module. It’s not working. Mavlink connects but just reports “link 1 down” over and over.
In my case the MAVLink wifi module is connected to the FC via UART 2 and it’s definitely working. If I connect to the wifi from my laptop, QGC or Mission Planner can connect to the FC - it works fine. I can also use mavproxy from my laptop (and it’s a Mac!!!) via the wifi and again - works fine no problem.
But if I connect my Raspberry Pi running the latest bullseye to the wifi - it connects and gets an IP address, I just get link down.
Oh - its ArduPlane 4.2.2 and the latest MAVProxy.py (using apt-get install).
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.4.2 netmask 255.255.255.0 broadcast 192.168.4.255
inet6 fe80::26f:33e0:c664:5f9d prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:06:f4:b9 txqueuelen 1000 (Ethernet)
RX packets 350 bytes 129352 (126.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 35 bytes 5142 (5.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
This is what happens when I run mavproxy using the above IP address:
**pi@binarypi**:**~ $** mavproxy.py --master=udp:192.168.4.2:14550
Connect udp:192.168.4.2:14550 source_system=255
Log Directory:
Telemetry log: mav.tlog
Waiting for heartbeat from 192.168.4.2:14550
MAV> link 1 down
Here is a diagram that shows what I’m trying to do:
More information.
If I run 2 windows and start one listening at the broadcast address 192.168.4.255, then wait for it to start running, then start another one listening at 192.168.4.2, the second one will connect and keep working even thought the first one will go down as before. huh?
mavproxy --master=udp:192.168.4.255:14550
mavproxy --master=udp:192.168.4.2:14550
So if I put two masters on the command line, both links will come up, sometimes the first will fail, but the 2nd one will keep working. It seems like a bit of a hack, and probably a bit of unnecessary overhead, but it does work - so I’m going with it for now.
mavproxy.py --master=udp:192.168.4.255:14550 --master=udp:192.168.4.2:14550 --out=udp:100.126.58.78:14550
What am I doing wrong?