PingRX spamming mavlink?

When I plug a PingRX into my Pixhawk 2.1, weird things start to happen. When I connect to it via Mavproxy, I see this:

STABILIZE> Mode(0x00000004)> APM: ADSB: Found transceiver on channel 3 STABILIZE> Mode(0x00000004)> STABILIZE> Mode STABILIZE Mode(0x00000004)> STABILIZE> Mode(0x00000004)> STABILIZE> Mode(0x00000004)> Mode Mode(0x00000004) STABILIZE> Mode(0x00000004)> STABILIZE> Mode STABILIZE Mode(0x00000004)> STABILIZE> Mode(0x00000004)> STABILIZE> Mode(0x00000004)> Mode Mode(0x00000004) STABILIZE> Mode(0x00000004)> STABILIZE> Mode(0x00000004)> STABILIZE> Mode STABILIZE Mode(0x00000004)> STABILIZE> Mode(0x00000004)> STABILIZE> Mode(0x00000004)> Mode Mode(0x00000004) STABILIZE> Mode(0x00000004)>
image

Most commands issued via Mavproxy timeout or otherwise fail, for example I cannot change flight modes or set parameters. When I unplug the Ping, the spam goes away and everything works normally. Mission Planner’s Mavlink message inspector sees the ADSB messages coming in (as well as other status messages), so the Ping is working and connected correctly. I’m just not sure why it’s spamming this.

Settings:
ADSB_EMIT_TYPE 14.000000
ADSB_ENABLE 1.000000
ADSB_ICAO_ID 0.000000
ADSB_LEN_WIDTH 1.000000
ADSB_LIST_MAX 25.000000
ADSB_LIST_RADIUS 2000.000000
ADSB_OFFSET_LAT 4.000000
ADSB_OFFSET_LON 1.000000
ADSB_RF_CAPABLE 0.000000
ADSB_SQUAWK 0.000000
SERIAL4_PROTOCOL 1
SERIAL4_BAUD 57
SR3_ADSB 5

I’ve tried other Telem ports, two different Pixhawk 2.1’s, and two different Pings. Tried AC 3.5.7 and 3.6.5. Same results in every case.

Do you have ping connected to serial 3 (GPS Port) ?
If yes, try reducing the SR3_ADSB parameter.

Yeah, I’ve tried using lower stream rates on various serial ports. No change; the spam still appeared at the same rate. Verified that the stream rate was 1 Hz with mavlink inspector.

After some more testing, it seems Mission Planner is working fine, so the problem might actually be specific to Mavproxy. Might need to move this topic, it doesn’t seem specific to any version of arducopter. Can a moderator move this to the Mavproxy section?

Is it possible you could test
https://github.com/ArduPilot/pymavlink/pull/270 as a potential fix?

Yeah, I’ll give that a try and let you know. Thanks.

Finally got a chance to test it. The spam stopped and mavproxy is responsive again. Thanks.

Edit for posterity: I also had to update my mavproxy to 1.8.4. Version 1.8.3 wasn’t playing nice with the most recent pymavlink.

Nevermind, the spam is gone, but Mavproxy still behaves abnormally and the drone changes flight mode by itself. For example, I used Mavproxy to change to Loiter and it worked, but a few seconds later, custom_mode was showing Stabilize (although Mavproxy still shows LOITER) and further attempts to change mode resulted in an error:

LOITER> mode
LOITER> ('Available modes: ', ['STABILIZE', 'LAND', 'OF_LOITER', 'RTL', 'DRIFT', 'FLIP', 'AUTOTUNE', 'BRAKE', 'GUIDED_NOGPS', 'AVOID_ADSB', 'POSITION', 'SPORT', 'FLOWHOLD', 'POSHOLD', 'AUTO', 'GUIDED', 'FOLLOW', 'ACRO', 'SMART_RTL', 'ALT_HOLD', 'LOITER', 'CIRCLE', 'THROW'])
Got MAVLink msg: COMMAND_ACK {command : 183, result : 0}
LOITER> loiter
LOITER> Got MAVLink msg: COMMAND_ACK {command : 11, result : 0}
LOITER> mode loiter
LOITER> Got MAVLink msg: COMMAND_ACK {command : 11, result : 0}


LOITER> loiter
LOITER> ERROR in command: argument of type 'NoneType' is not iterable
Unknown command 'loiter'
mode
LOITER> No mode mapping available

The problem is intermittent; sometimes I can change mode, sometimes I get this error. Not sure what else might be broken. As soon as I unplug the PingRX, the problem disappears.

Just found that this may be caused by a process on my companion computer misinterpreting the ADS-B heartbeats as flight controller heartbeats.

Nope, wrong.

With latest Mavproxy and pymavlink (with your patch to pymavutil), the spam is gone, but Mavproxy still doesn’t know what flight modes there are. There doesn’t seem to be any other problems outside of Mavproxy, so the remaining issue might be specifically a Mavproxy problem.