I want to download the data flash log with MAVLink in JavaScript (Node.js). Connect with UDP socket via MAVProxy and send LOG_REQUEST_LIST # 117 packet, but LOG_ENTRY # 118 is not received. A log list is output to MAVProxy. In MissionPlanner you can download the logs correctly. I don’t know why. I would be happy if you could give me advice.
[Connection]
Node.js(UDP:14550) <–> MAVProxy <–> SITL/Vehicle
Here is my code.
requestDataflashList() {
const reqLogList = new mavlink.messages.log_request_list(this.srcSystem, 0, 0, 65535);
this.sendAll(new Buffer(reqLogList.pack(this.mav)));
console.log("dflog list req started " + Date.now());
if (this.inRequestDFLogList > 0) {
console.log("GetLogEntry Retry " + this.inRequestDFLogList);
setTimeout(this.requestDataflashList.bind(this), 2000);
} else {
console.log("Timeout on read - GetLogEntry");
}
this.inRequestDFLogList -= 1;
}