Lua Scripting Help


I am trying to get Lua scripts to run on my Pixhawk, however I can’t seem to find the SRC_ENABLE parameter mentioned in these docs:

Any ideas? I have tried making a scripts folder in the APM folder and putting some simple lua scripts taken from here:

My hope is to get some WS2813 LEDs working on my quadcopter. I am on ArduCopter V4.0.3.

If you have a Pixhawk, or any other Flight Controller, with 1Mb flash, Lua scripting and some other functions are disabled. Not seeing the SCR_ENABLE parameter is your 1st clue. Which Pixhawk is it?

Ah I see thank you. I’ve got the Pixhawk 2.4.8, which I thought did not have the 1MB limitation?

Do you know of any way around this so I can control a WS2813 LED strip with my Pixhawk? I was hoping to set up some strip lighting on the arms for direction / status indication.

It probably doesn’t. What version of firmware is installed? This screen. This is a Pixhawk 2.4.8 with fmuv3. No limitations on features.

Heres what I’ve got. Looks like its fmuv2 not 3? I’m not entirely sure what that refers to.

I only installed the firmware about a month ago so should be up to date.

As you can see, there doesn’t seem to be any SCR parameter options.

Right, that’s why. You need fmuv3. The best way to do this is with QGroundControl. Are you familiar with that?

Was just looking into that! Should I select the PX4 Pro flight stack or ArduPilot flight stack, assuming this is the right place?

Don’t do that! Make these choices:

Are you prepared to start from default parameters (scratch) if required?

1 Like

Aha perfect! Thank you so much.

I would be happy to do that yes, although after upgrading and checking it is fmuv3 it seems none of my parameters have been reset. I can now see the SCR_ENABLE parameter, and I think that the Lua scripts I have uploaded are running!

Good to hear Jake! Sometimes when playing around with the bootloader stuff happens :grinning:

1 Like

I was about to try something similar when I found this thread. But it looks like I can forget about controlling WS2812 LEDs with a Kakute F7 AIO 1.5 since it apparently has only 1MB flash and thus supports no Lua scripting at all?

That would be a shame since I just got it to replace the originally planned Matek F722-SE which can’t run AP at all. Would the LEDs at least light up in white when connected to the LED pin?

That’s right, no dice. Before buying a Flight Controller look for 2 things in the Hwdef file.

One leads to the other…

Thanks, can you tell off hand what’s the cheapest (reliable) option that would run it? I would assume there is no F7 FC with more memory than the Kakute.

Cheapest would probably be Pixhawk 2.4.8 at ~$50. A knock-off PixRacer would be another option.

How common are quality issues with those cheap ones? I’m planning to build a 10" copter, so failure is not an option. :wink:

If you are asking that question then these are not for you. Buy one from here:

That’s beyond my budget for now but I’ll keep it in mind for next time, thanks. Actually it’s instantly visible (even to me) that those are high quality, and the ones on BG with the skewed connectors are not. I’d rather stick with a quality FC and leave the Lua experiments for later. Recently, I always ended up buying components twice when I had gone for the cheap option…