Can I send custom telemetry to TX via Lua?

Is it possible to send a telemetry value from Lua running on the flight controller, over CRSF/ELRS, in such a way that I can show it on the screen of my remote TX16s?

There are a 25 values my drone currently sends - heading, altitude, battery, signal quality etc. I want to either hijack one of them or (ideally) create a custom one that is sent via a Lua script

1 Like
  1. You can send text messages if that’s acceptable using gcs:send_text
  2. You can use MAVLink mode end expand ELRS TX MAVLink parser to send custom CRSF frames based on the value you are interested in to be parsed by your script.
  3. Yaapu Telemetry Script uses bespoke protocol implemented over S.Port that is tunnelled through custom CRSF frames (except status_text which got special treatment to improve bandwidth) so modifying it will be rather hard.

You can use gcs:send_named_float and then it will be available in mission planner as one of the quick view items named MAV_yournamedfloat.

here is an example of a script I used to report watts, current consumed by the right side of the craft, current consumed by the left side of the craft.

    if millis() - previous_print_time_ms > 1000 then
        previous_print_time_ms = millis()
        gcs:send_named_float("watts", previous_watts)

        gcs:send_named_float("left_amps", max_left_amps)
    
        gcs:send_named_float("right_amps", max_right_amps)

        -- only track the max amps over the last second
        max_right_amps = 0
        max_left_amps = 0
    end
1 Like