Lua prearm auth scripts

Hi,
I’m after some additional intel on how to proceed on an implementation I’m planning relating to the preArm authorisation capabilities exposed in LUA.

I understand that having acquired the AuthID token, you essentially return “true” or “false” to allow or deny arming.

LUA scripts run periodically (not sure how fast I need to set that either - but its a minor point) and as such my script (which will be looking at an AUX line to decide on the result) may return “false” during flight. If the external hardware changes the state of the AUX line. I was wondering if that might be a bad thing!!

Another way of phrasing the question is, “does the result of the preArm authorisation only have any effect whilst disarmed”??

Sorry if this is covered somewhere, but I’ve not found it yet during my searches.

I guess the same worry relates to the example batt_temp
What happens if the battery temp > max during flight?

Does it also mean the C and capacity are sized wrongly in the first place?

That is not my question, I’m talking about the logic of the pre arm authorisation - I don’t care about the example (of battery temperature), except that IF the situation of that script occurred during flight, the AP would disarm?

What is your definition of pre-Arm authorization?

there is a list of checks on the flight stack that will be checked before the flight stack start to spin the motors in flight mode.

Then you mentioned it during a flight, so you may have to rethink what you want.

1 Like

Jai, I don’t think you understand my question or understand the lua aux capability of denying prearm. So thank you for trying to help, but it isn’t getting me closer to the answers I’m looking for.

Let me rephrase the question for others to comment/help.

If a lua script calls arming:set_aux_auth_failed(….) whilst flying, does the autopilot disarm?

Im hoping it doesn’t, but I need a “it is designed this way” answer rather than just conjecture or guesses/assumptions, as I intend to base some other logic on the design intent.

No, it will not disarm.

1 Like

Thanks. 5 words is a great answer always.

What is a good update rate for the script?