Problem with APM mission planner & Mavlink protocol

Hi all,

I repost here the same question I've posted to the ArduPlane user's group.

I'm trying to connect my STM32 based autopilot with the APM mission planner 1.2.22 Mav 1.0, with a pair of 3D Robotics 433 MHz radios, without success.

The APM recognizes the heartbeat messages sent by the autopilot but doesn't complete the connection.

After some tweaking I traced the problem back to the REQUEST PARAM LIST message sent by APM planner: contrary to the Mavlink protocol specifications, the STX character is 0x00 instead of 0xFE (for mavlink version 1.0 or 0x55 for mavilink version 0.9).

MAVLink packet

Byte IndexContentValueExplanation
       0Packet start sign    v1.0: 0xFE (v0.9: 0x55)

Indicates the start of a new packet.

All remaining fields of the message are correct: Length = 2, Sequence, System identifier = 20, Component identifier = 200, Message identifier = 22, Payload, CRC.
I checked again the specifications of Mavlink protocol, but there's no mention of a STX character = 0x00.

I thus modified the firmware of my autopilot to make it send the list of parameters without waiting for the REQUEST PARAM LIST message.
Nonetheless the APM does not recognize the parameters sent by the autopilot and times out.

By the way, with the same firmware I'm able to connect the autopilot with AqGCS running on an Android 4.0 tablet.

Did anybody have the same problem ? Someone knows what I'm missing ?

Thank you in advance and regards

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Ruslan,

    I'm on a team using the same code as you mentioned (mavlink_serial.cpp) and we are also only receiving #0 and #253.  Did you ever manage to get other data than this? Your help would be much appreciated.   

    • Setup MissionPlanner. You need to set the sliders to the value of 10Hz. Accurate information will write later.

      • Thank you for the reply.

        However, I'm still slightly confused.  We'd like to use the example code given to communicate directly between a computer running linux and the APM.  When connected via a computer the serial #0 and #253 are written to a terminal but that is it.

        When you suggest setup mission planner do you mean set the 10Hz output value of the APM via MissionPlanner, or were you communicating from the APM to MissionPlanner to a computer?  Thanks again for your help!

        • I've got it!

          For example:

          switch (message.msgid)
          {

            case MAVLINK_MSG_ID_HEARTBEAT:

            case MAVLINK_MSG_ID_SCALED_IMU:
            {
            mavlink_scaled_imu_t s_imu;
            mavlink_msg_scaled_imu_decode(&message, &s_imu);
            printf("Got message SCALED_IMU\n");
            printf("\t xacc: %d\n", s_imu.xacc);
            printf("\t yacc: %d\n", s_imu.yacc);
            printf("\t zacc: %d\n", s_imu.zacc);
            printf("\t xgyro: %d\n", s_imu.xgyro);
            printf("\t ygyro: %d\n", s_imu.ygyro);
            printf("\t zgyro: %d\n", s_imu.zgyro);
            printf("\t xmag: %d\n", s_imu.xmag);
            printf("\t ymag: %d\n", s_imu.ymag);
            printf("\t zmag: %d\n", s_imu.zmag);
            printf("\n");
            }

          }

          Without "case MAVLINK_MSG_ID_HEARTBEAT:" you have not any data.

          When you suggest setup mission planner do you mean set the 10Hz output value of the APM via MissionPlanner, or were you communicating from the APM to MissionPlanner to a computer?  Thanks again for your help!

          I meant, you need to set up in MissionPlanner once.

  • Hello. I connect APM 2.5 with ODROID-X. I use UART0 in APM. And I start program mavlink_serial.cpp.

    #./mavlink_serial -d /dev/ttySAC3 -b 115200 -v
    Trying to connect to /dev/ttySAC3.. success.
    Trying to configure /dev/ttySAC3.. success.

    Connected to /dev/ttySAC3 with 115200 baud, 8 data bits, no parity, 1 stop bit (8N1)

    READY, waiting for serial data.
    Received message from serial with ID #0 (sys:1|comp:1):
    Received message from serial with ID #0 (sys:1|comp:1):
    Received message from serial with ID #253 (sys:1|comp:1):
    Received message from serial with ID #253 (sys:1|comp:1):
    Received message from serial with ID #0 (sys:1|comp:1):
    Received message from serial with ID #0 (sys:1|comp:1):
    Received message from serial with ID #0 (sys:1|comp:1):
    Received message from serial with ID #0 (sys:1|comp:1):
    ^C

    Why can not I get the data HIGHRES_IMU(ID #105)?

    Why I get only ID #0 and #253?

    How can I get data from gyro, accel, etc?

    And how control copter from odroid with mavlink?

    Code in my mavlink_serial.cpp:

    int sysid = 1; 

    int compid = 1;

    int serial_compid = 0;

    3692647843?profile=original

  • Developer

    the mission planner has a hardcoded 0xfe as the packet start. and does conform to the mavlink specs. so am not sure how you are seeing what your seeing

This reply was deleted.

Activity