Servers by jDrones

APSync cmavnode UDP heartbeat and other packets not accepted by client PC when MAVProxy UDP packets are accepted: why?


(Peter Burke) #1

For APSync with cmavnode on Raspberry Pi 3 (stock setup, firmware date 10/5/2017):

I have a Win8 PC with mission planner (v. 1.3.59) connected to the local wifi hotspot (called ardupilot) that is created by the Pi 3.

When I try to connect with Mission Planner, it says there are no heartbeats and fails to connect (timeout after 30 seconds of no heartbeats).

Using Wireshark on my PC to analyze all the traffic, I see that UDP packets (including MAVLink packets that DO contain the heartbeat i.e. message id #0) are getting sent from the Raspberry Pi 3 (IP 10.0.1.128) to my pc (IP 10.0.1.73). However, for some reason I am also getting ICMP error packets saying “Destination unreachable” see below for summary):

Source: 10.0.1.128 Dest: 10.0.1.73 ICMP Destination unreachable (Host unreachable)
Source:10.0.1.73 Dest:10.0.1.128 ICMP Destination unreachable (Port unreachable)

Without rebooting, if I manually kill the cmavnode and instead manually run MAVProxy on the Pi 3 with this command:

sudo -s mavproxy.py --master=/dev/ttyAMA0 --out=udpbcast:10.0.1.255:14550

then I am able to connect to Mission Planner.

Why are the UDP packets from cmavnode not accepted by my Win8 computer (according to Wireshark packet analyzer), which presumably prevents Mission Planner from connecting? Whereas, the UDP packets from MAVProxy ARE accepted by my Win8 computer, which allows me to connect through MAVProxy?


MAVProxy alternative on Raspberry Pi Zero W
APSync + rPiZero + Internet?
(Peter Burke) #2

Update:
I made a mistake. The UDP packets get an IMCP packet if there is no program on the client computer running to receive the packets. Once Mission Planner is started, it goes away and the packets all are received.

BUT:
Wireshark IS useful. I found:
On Raspberry Pi 3 running APSync: It only works to connect IF the baud in APSync is set to 57600 for the UART. (I am using an Omnibus F4 Pro V2 using Chibios, not sure if that matters). The connection does not seem to “care” what the baud rate is set at in Mission Planner, or in the Serial 2 parameter in Ardupilot on the board.

IF the baud is something different (lower OR higher) in APSync’s cmavnode.conf file, then the UDP packets are still transmitted, but the contents are junk. For example, the vehicle ID field is all over the place.

For the Raspberry Pi Zero W, same story. However, for that, once connected to Mission Planner, only a few parameters update. It seems as of the PiZero is taxed to the limit, although using “top” in the terminal of the Raspberry Pi Zero W shows only a few per cent of the CPU is being used and there is plenty of memory available.

Conclusion:
Set baud to 57600, use RPi3 (not zero), and APSync works for Mission Planner connection…
It would be nice to get this lesson into the wiki/documentation.