I’ve tried mav1, mav2, and none. I rebooted each time. I did that on serial 2 (I think it was the one set for telem2) and serial 5. No luck on either of the settings.
Edit: I decided to go back to the shop tonight and try it one more time to make sure. Serial5_protocol was set to -1 and Serial2_protocol was set to 2 (I also tried 1). Both times, same error message.
Earlier when I dug into the code of Pymavlink and Dronekit, I could see where the heartbeat is being processed and I followed it all the way up to the dictionary that is loading. This is what is being called that throws the error:
def _is_mode_available(self, custommode_code, basemode_code=0):
try:
if self._autopilot_type == mavutil.mavlink.MAV_AUTOPILOT_PX4:
mode = mavutil.interpret_px4_mode(basemode_code, custommode_code)
return mode in self._mode_mapping
return custommode_code in self._mode_mapping_bynumber
except:
return False
And when you look at _mode_mapping_bynumber:
def mode_mapping_bynumber(mav_type):
'''return dictionary mapping mode numbers to name, or None if unknown'''
return AP_MAV_TYPE_MODE_MAP[mav_type] if mav_type in AP_MAV_TYPE_MODE_MAP else None
Which then needs:
AP_MAV_TYPE_MODE_MAP_DEFAULT = {
# copter
mavlink.MAV_TYPE_HELICOPTER: mode_mapping_acm,
mavlink.MAV_TYPE_TRICOPTER: mode_mapping_acm,
mavlink.MAV_TYPE_QUADROTOR: mode_mapping_acm,
mavlink.MAV_TYPE_HEXAROTOR: mode_mapping_acm,
mavlink.MAV_TYPE_OCTOROTOR: mode_mapping_acm,
mavlink.MAV_TYPE_DECAROTOR: mode_mapping_acm,
mavlink.MAV_TYPE_DODECAROTOR: mode_mapping_acm,
mavlink.MAV_TYPE_COAXIAL: mode_mapping_acm,
# plane
mavlink.MAV_TYPE_FIXED_WING: mode_mapping_apm,
# rover
mavlink.MAV_TYPE_GROUND_ROVER: mode_mapping_rover,
# boat
mavlink.MAV_TYPE_SURFACE_BOAT: mode_mapping_rover, # for the time being
# tracker
mavlink.MAV_TYPE_ANTENNA_TRACKER: mode_mapping_tracker,
# sub
mavlink.MAV_TYPE_SUBMARINE: mode_mapping_sub,
# blimp
mavlink.MAV_TYPE_AIRSHIP: mode_mapping_blimp,
}
And this is what I think is failing, because it is passing 0 from the error message, I believe it is returning HELICOPTER and not a quadcopter. Now, the the frame class is set to 1 (quad) and the board type is set to 3 (Cube).
So in short, all I am thinking is that the firmware is sending either the wrong data in the mav message or something isn’t mapped correctly. Either way, I have another pixhawk 2.4.8 board that does not have this issue running 4.1.1. So either there is a config issue or something is malformed. The end result though, is we have not been able to connect via HereLink or Sik radio via Python completely.