A Quick/Painless ArduPilot Build Environment via Linode VPS

If you aren’t interested in enabling WSL on Windows or are having trouble setting up a build environment on another OS, Linode might be a low cost solution to get up and running rather quickly. There is a monthly fee involved, so it may not be for everyone. I am in no way affiliated with the company - I just found it to be a simple way of getting a development environment up and running with little fuss.

Sign up for a Linode account

Look for Linode videos on YouTube for promotional codes to potentially get several months free.
Once signed up, click “Create” and select the following options:

  • Linode
  • Ubuntu 20.04 LTS (well supported)
  • Region (local to you)
  • Shared 4GB 2 Core (minimum)
  • Enter root password
  • All other defaults should work fine

Once the new virtual instance boots, take note of the IP address for follow-on steps.

Connect and update the VPS instance

(via command line: bash, zsh, PowerShell, etc)

ssh root@xxx.xxx.xxx.xxx
(enter password)
apt update && apt upgrade -y

Optionally, change the hostname:

echo ardupilot-dev > /etc/hostname

Add a new user with sudo privileges

(I’m using “yuri” as the example username - pick whatever you like)

adduser yuri
(enter a password for this user)
(no need to enter any other info - just press enter until back to shell prompt
usermod -aG sudo yuri
exit

Reboot the VPS

(from Linode webpage)
When the reboot completes, log in as the new user.

ssh yuri@xxx.xxx.xxx.xxx
(enter password)

Lock root account access

This is a reasonable security measure. Enter user password if prompted.

sudo passwd -l root

Clone ardupilot and set up the environment

cd ~
git clone https://github.com/ArduPilot/ardupilot.git
cd ardupilot
git submodule update --init --recursive
./Tools/environment_install/install-prereqs-ubuntu.sh
(recommend answering y to all prompts)
exit

Reconnect to refresh user/shell settings

ssh yuri@xxx.xxx.xxx.xxx
(enter password)

Build the master branch to test the new environment

This isn’t a blazing fast instance, but it should build in a few minutes, nonetheless. Mine took 7 minutes (further builds will be much faster if you don’t ./waf clean). You can always pay for dedicated CPU time and/or more CPU cores if you so desire.

 cd ~/ardupilot/
 ./waf configure --board CubeOrange
 ./waf copter

Finally…

Copy your brand new, bleeding edge firmware to the local machine

sftp yuri@xxx.xxx.xxx.xxx
(enter password)
get ardupilot/build/CubeOrange/bin/arducopter.apj
exit

You should now have a copy of your latest build in the directory from which you issued the sftp command. Use your GCS of choice to upload it to an autopilot (usually via a “custom firmware” option).

If you use VS Code, you can install the “Remote - SSH” extension and create a connection to the Linode VPS to work on the cloned repository as if it were local to your client machine.

7 Likes

Yuri this is a nice option. Thanks for posting this

1 Like