Lua scripting problem - get not working at all

Hey, I’m trying to do some simple stuff with scripting like reading the flight mode i’m in. My code errors every time I try to get anything. For example:

local switch= rc:get_pwm(7) - - Gets RC pwm, i.e. the mode

local mode = vehicle:get_mode()

local RC_PWM = rc:get_pwm(2)

These few lines worked perfectly a month ago but now seem to error. I’ve tried to isolate the problem but keep getting an error message when doing any kind of get function or call. I find this super strange as it worked previously.

I’ve tried running example codes from the github and they error in a similar way… Anyone who has experienced a similar issue?

I also tried going back to plane 4.0.5 from .7 but the error remains. I don’t know what this could be.

Scripting is quite limited on the stable release, all the cool stuff is in 4.1.dev. Will need the error your seeing to help with your issue.

1 Like

Ah okay. I’ll try to switch to dev to see what I can do. I do believe that when it last worked we were on a dev build. Just assumed by switching to the latest stable one afterwards it would work.

It was the FW version, it needed to be on dev. Thanks Peter!