Camera controller/generic component on UART (Telem1) - PX4 does not react to heartbeat message from MAV_COMP_ID_CAMERA

Hello there,

I’m trying to register a custom camera controller (based on an atmega328p) with my flight controller on Telemetry port 1. I’ve got a Pixhawk 2.1 cube with PX4 version 1.7.3.

I can read messages and subscribe to them with COMMAND_LONG and MAV_CMD_SET_MESSAGE_INTERVAL, so sending commands/messages works.

According to the MAVLink camera protocol description, the flight controller should respond to a heartbeat message from a camera component with a MAV_CMD_REQUEST_CAMERA_INFORMATION command.

My understanding is that I should receive commands from PX4 through COMMAND_LONG messages. However I don’t receive any from the flight controller.

I’m sending like this with 1 Hz. I also tried system_id 1.

uint16_t len=0;
mavlink_msg_heartbeat_pack( 2,
                            MAV_COMP_ID_CAMERA,
                            &this->mav_msg_txbuf_pixhawk,
                            MAV_TYPE_GENERIC,
                            MAV_AUTOPILOT_INVALID,
                            MAV_MODE_FLAG_MANUAL_INPUT_ENABLED,
                            0,
                            MAV_STATE_ACTIVE);
len = mavlink_msg_to_send_buffer(this->mav_txbuf, &this->mav_msg_buf_pixhawk);
Serial.write(this->mav_txbuf, len);

Any idea where I’m going wrong? Is it possible to attach component systems to the UARTs?

Thanks a lot and best regards, Floxo

1 Like