Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lua scripts sometimes do not start or re-start #25455

Open
tridge opened this issue Nov 3, 2023 · 5 comments
Open

lua scripts sometimes do not start or re-start #25455

tridge opened this issue Nov 3, 2023 · 5 comments
Labels

Comments

@tridge
Copy link
Contributor

tridge commented Nov 3, 2023

in current master we have a bug where lua scripts sometimes don't start. There is only one board I've seen where this happened a lot, the tlog for that case is here:
http://uav.tridgell.net/tmp/scripts_not_starting.tlog
that setup is a CubeOrange running this lua script:
#25428
the same script on 4.4.x didn't show the problem (but as the bug is intermittent this doesn't necessarily mean it is not in 4.4.x)
some key information from debugging so far:

  • copying identical parameters and script to a different CubeOrange did not reproduce the issue despite hundreds of attempts
  • we do at least get to the point of calling lua_scripts::reschedule_script when the bug happens, but the script does not run
@InnovativeUAVs
Copy link

In case there's interest in more info on this bug, I can confirm seeing a similar problem. I have several CubeOrange and CubeOrange+. At first I thought the problem was on me, but I have seen it several times now and have reproduced it in SITL. It seems to happen when I delete all the scripts, and then add new scripts, then restart the AP (but I could be wrong). I am doing this frequently as I'm testing for various failure modes in LUA scrips and their impact (or not) on the AP code/function. If there's interest, I'll formalize my test procedures and update my findings here.

@rmackay9
Copy link
Contributor

@InnovativeUAVs,

Thanks for that. If you've got a set of steps that can reproduce the problem that would be a great help towards getting to the bottom of the issue.

@IamPete1
Copy link
Member

IamPete1 commented Mar 7, 2024

@InnovativeUAVs Any update? Steps to reproduce would be very useful.

@InnovativeUAVs
Copy link

I have some additional scripts to add soon, and I will try again to reproduce. I spent some considerable time trying to reproduce before, and could not. But, I can confirm there is some condition wherein this is repeatable, and it seems to be related to first configuration / early setup work. Once my FCs are configured, I can't reproduce the error. I will continue to try and will update here if of note. Thanks for the help.

@IamPete1
Copy link
Member

IamPete1 commented Mar 8, 2024

Thanks for the update. The only thing I can add is that scripts will not run when you first set scripting enable. You will need a full flight controller restart, just a scripting restart is not enough. We could update the messages to make that more clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants