I have write a test code in lua to send data96 on telem1 port(serial 1) i have tested the data on serial monitor i am receiving the data now the issue i am facing is that in mission planner mavlink inspector the data96 is not showing i think my code is creating a custom packet not a standard mavlink data96 packet thats why its not showning in the mavlink inspector i have also checked the below link
ardupilot/libraries/AP_Scripting/docs/docs.lua at master · ArduPilot/ardupilot · GitHub
there is only one function to send the mavlink message which is mavlink:send_chan
Below is my test code @Eosbandi @rmackay9
I am open for any help
Thanks
-- Channel 1 corresponds to SERIAL1 (MAVLink)
local MAV_CHAN = 1
-- MAVLink message ID for a custom 96-byte message (pick one not used)
local DATA96_MSGID = 172
-- Create 96-byte data string
local data96 = {}
for i = 1, 96 do
data96[i] = i
end
-- Convert to binary string
local function arrayToString(arr)
local s = ""
for i = 1, #arr do
s = s .. string.char(arr[i])
end
return s
end
local data96_str = arrayToString(data96)
-- Send every second
local last_tx = millis():tofloat() * 0.001
function sendData96()
local now = millis():tofloat() * 0.001
if now - last_tx >= 1 then
-- Send via mavlink API
local success = mavlink:send_chan(MAV_CHAN, DATA96_MSGID, data96_str)
if success then
gcs:send_text(3, "DATA96 sent successfully, 96 bytes")
else
gcs:send_text(3, "Failed to send DATA96")
end
last_tx = now
end
return sendData96, 100
end
return sendData96, 100
I am open for any help
Thanks Below are the Screen Shoots

