Location of APM/scripts on Navio2/RPi?

Hello,

I’m interested in exploring/implementing some of the LUA scripting capabilities in Ardupilot. AP documentation suggests that the scripts be placed in /APM/scripts, and to create it if it doesn’t exist.

I have created that directory on my RPi, but Mission Planner messages indicate “Lua: No scripts to run”. I’m curious whether this directory is supposed to exist elsewhere (as a subdirectory somewhere?). It is unclear to me what Ardupilot sees as its root directory.

Thanks in advance,

Mike

Hello,

It could be the directory where arducopter executable is stored:

/opt/ardupilot/navio2/arducopter-x.x/bin (edit x.x)

Marc

Thanks for the suggestion, Marc.

I believe I’ve now tried… (none of them previously existed)

/opt/ardupilot/scripts
/opt/ardupilot/APM/scripts
/opt/ardupilot/navio2/APM/scripts
/opt/ardupilot/navio2/arduplane-4.0/scrirpts
/opt/ardupilot/navio2/arduplane-4.0/APM/scripts
/opt/ardupilot/navio2/arduplane-4.0/bin/APM/scripts
/APM/scripts
/home/pi/APM/scripts

There are probably a few others I’ve tried, but MP continues to show “No lua scripts to run”.

Best,

Mike

Hi @Moorhead,

Did you try to create this folder using MAVFTP in Mission Planner?

I’m glad you asked that! I have recently updated Mission Planner, and MAVFTP doesn’t seem to exist as other people have shown/described it. I was curious whether it had been removed from the program.

I had never used it in a previous edition, so I couldn’t tell you whether I have ever even seen it before.

Hi Michael,

Did I get correctly you use Mission planner v1.3.7? MAVFtp should work fine with this version.

Do you connect to the Navio2 via SSH? Could you try to connect via USB?

MAVFtp showed up the other day following an update. Still not sure why it wasn’t there before, but…?

Thanks!

Hi Michael,

It’s hard to say but, according to the Mission Planner’s GitHub, the MAVFtp feature has been implemented recently. So it could be just a version issue.

Glad to hear that you sorted it out!

what is the location of APM ?

Hi @edd9615,

As Marc said above, it should be in the Ardupilot root directory. For example, /opt/ardupilot/navio2/arducopter-4.0/bin/

scripts folder:

It is the result of directory exploration.

In Mission planner, Config Menu, MAVFtp item

Expand First line and navigate to /var/lib/ardupilot
You will find two directories, logs and terrain,

Right click in the window and choose “new folder” to create scripts folder…
I already create the scripts folder before capturing screen…

Hi all. I have created the scripts folder in both of the above suggested locations:
/opt/ardupilot/navio2/arducopter-3.6/bin/scripts/
and
/var/lib/ardupilot/scripts/
Neither seems to have worked. I am still getting the message “Lua: No scripts to run” in mission planner.

Has anyone else managed to use lua scripts on Navio2?

I am running Copter-4.0.3 on Navio2 by running the latest Emlid image and replacing the arducopter binary.

I have turned on lua scripting by setting SCR_ENABLE to 1.

The script I am trying to run is called simple_loop.lua:
function update()

 gcs:send_text(0, "hello, world")

 return update, 1000

end

return update()

Same result on my Navio2 testbed…

Darn. My next thoughts are to make a shell script that copies the lua script into every folder :slight_smile: Not sure that will help though, I’m guessing lua scripting is just not set up properly for Navio2

Hi @tristan.minifie,

Sorry, I wasn’t attentive enough.

/opt/ardupilot/navio2/arducopter-3.6/bin/scripts/

So, could you clarify whether you use Copter-3.6 or Copter-4.0?

Lua scripting support was released with Copter-4.0.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.