This is my understanding and I can be wrong. but hope it could help.
This is a mission planner topic and not CubeOrange.
You mean by ECU data i guess is your motor control unit or ESC and you are using DroneCAN protocol. To access data for dronecan using LUA scripting; check this example.
To display such data on the message tab, i believe it already exist as you should see esc_status (rpm, voltage, etc). Also, you have UAV CAN page in mission planner that you can access all can nodes and their status.
Anything related to message tab that does not exist, it means you need to edit the mission planner code and not LUA scripting or ArduPilot firmware.
Yes, Lua scripting can be used to read raw CAN frames in ArduPilot, but the CAN interface needs to be configured for the scripting CAN driver rather than only the normal DroneCAN driver.
There is an ArduPilot example called CAN_read.lua that shows the basic structure using CAN:get_device() / CAN:get_device2() and read_frame() to receive CAN frames.
The important distinction is:
If the ECU is using DroneCAN/UAVCAN, then Mission Planner may already expose some decoded telemetry depending on the message type.
If the ECU is using a proprietary/raw CAN protocol, then Lua can read the raw frame IDs and bytes, but you will still need to decode the ECU payload format yourself.
To display decoded values in Mission Planner’s Messages tab, the simplest method is usually gcs:send_text().
For proper telemetry fields, logs, or dedicated Mission Planner displays, you would need deeper integration through ArduPilot/MAVLink or Mission Planner changes.
So the practical workflow would be:
Configure one CAN interface for scripting.
Use Lua to read the raw CAN frames.
Filter by the ECU CAN ID.
Decode the payload bytes according to the ECU protocol.
Send useful decoded values to Mission Planner using gcs:send_text() or integrate them more formally if needed.
I would first confirm whether the ECU is truly raw CAN or DroneCAN, because the implementation path is different.