So in this, I want the LEDs to flash in a certain emergency manner, which will depict that ANY kind of failsafe has occured. But even after searching a lot, On docs, in the API, in many bindings searching for symbols, I can’t find any binding which returns a “true” if ANY kind of failsafe is activated, or at least returns the number of failsafes currently active. Do you know any such binding or method which can help me detect if ANY kind of failsafe has got activated?
I don’t think we expose all possible failsafe states in Lua, but there is a workaround.
Either connect the LEDs as simple external notification LEDs or use the LED:get_rgb() binding to get the current notification LED color and display it as needed.
Ok, i understood it, and then i tried using it in code, and for safety check, i sent the r, g, b values to the gcs messages tab to see whether what colour is being sent for failsafe.
But this error came:
”23-02-2026 16:56:24 : his firmware)
23-02-2026 16:56:24 : ling ‘get_rgb’ on bad self (LED not supported on t
23-02-2026 16:56:24 : Lua: /APM/scripts/WS2812 LED Firmware.lua:176: cal
23-02-2026 16:56:14 : his firmware)
23-02-2026 16:56:14 : ling ‘get_rgb’ on bad self (LED not supported on t
23-02-2026 16:56:14 : Lua: /APM/scripts/WS2812 LED Firmware.lua:176: cal
23-02-2026 16:56:04 : his firmware)
23-02-2026 16:56:04 : ling ‘get_rgb’ on bad self (LED not supported on t
23-02-2026 16:56:04 : Lua: /APM/scripts/WS2812 LED Firmware.lua:176: cal
23-02-2026 16:55:55 : e.lua:17
23-02-2026 16:55:55 : PreArm: Scripting: /APM/scripts/WS2812 LED Firmwar
23-02-2026 16:55:55 : PreArm: RC not found” //Here i made an rc failsafe.
Hehe, actually after that, i changed the code a bit to at least make the LEDs aware of the rc/battery failsafe. But here are those lines which i wrote at the time of the error:
The error you’re getting indicates that the binding exists but is not supported. I didn’t chase the source any farther than that, but it appears you can’t use LED:get_rgb() on that board.