Closed 1chick closed 2 years ago
'{ "header": { "system_id": 255, "component_id": 0, "sequence": 0 }, "message": { "type": "NAMED_VALUE_FLOAT", "time_boot_ms": 0, "value": 2.0, "name": [ "l", "e", "a", "k", "\u0000", "\u0000", "\u0000", "\u0000", "\u0000", "\u0000" ] } }'
Hi @1chick,
I would recommend to check the helper
endpoint for message example:
curl http://blueos.local:6040/helper/mavlink\?name\=NAMED_VALUE_FLOAT
{
"header": {
"system_id": 255,
"component_id": 0,
"sequence": 0
},
"message": {
"type": "NAMED_VALUE_FLOAT",
"time_boot_ms": 0,
"value": 0.0,
"name": [
"\u0000",
"\u0000",
"\u0000",
"\u0000",
"\u0000",
"\u0000",
"\u0000",
"\u0000",
"\u0000",
"\u0000"
]
}
}%
Thanks @patrickelectric bro! the NAMED_VALUE_FLOAT message directly can not be sent to GCS by mavlink2rest, have to edit the code logic in ardusub's firmware function GCS_MAVLINK_Sub::handleMessage. is it right?
hi bro @patrickelectric when post data,it response slowly,sometime need 40s. how to Optimize?
pi@raspberrypi:~/companion $ curl --request POST http://0.0.0.0:8088/mavlink -H "Content-Type: application/json" --data '{ "header": { "system_id": 255, "component_id": 0, "sequence": 0 }, "message": { "type":"NAMED_VALUE_FLOAT", "time_boot_ms":0, "name":"leak", "value":0.0 } }' Failed to parse message, not a valid MAVLinkMessage.