Skip to content

Install pypilot

marcobergman edited this page Nov 16, 2023 · 8 revisions

WORK IN PROGRESS JUL-2023

In this step, you will install pypilot. I'll describe three options:

Raspberry install

This installation is for if you are technically interested in what pypilot is and how it works. You need a clean raspberry with a fresh raspbian operating system on it. In my case, I used a raspberry 3 model b+, and I installed Raspberry Pi OS, the bullseye version. Just follow the Getting Started section on the raspberry site.

Once running, use the Raspberry Pi Configuration tool (under Raspberry -> Preferences; in an ssh session type sudo raspi-config) to enable I2C, SPI and Serial Port interfaces and disable Serial Console. For myself, I also enable SSH and VNC at this point. Don't forget to reboot.

Then, read the readme on https://github.com/pypilot/pypilot. Once you click this link, you are on sacred grounds: this is the place in the whole world where you will find the authoritative source code of pypilot. So you'd better read this readme religiously.

After that, you know what to do:

git clone https://github.com/pypilot/pypilot
cd pypilot
sudo python3 setup.py install

This will run for a while, and it should end like this:

Installing pypilot script to /usr/local/bin
Installing pypilot_web script to /usr/local/bin
Installing pypilot_hat script to /usr/local/bin
pi@raspberrypi:~/pypilot $

I selected these lines so you see these 3 executable scripts are created for you: pypilot, pypilot_web and pypilot_hat.

You can run these 3 scripts at the prompt. Obviously not at the same prompt, but if you run them in 3 different terminals, you can see exactly what happens. For the purpose of this workbook, I'd recommend you do so. This output is not there to bully or scare you - no - it's there to educate you.

The pypilot_web script gives you a browser based interface at port 8000. So if you navigate to http://your_pi:8000, you'll see something like this; it is a simple autopilot interface.

The pypilot_hat script gives you a browser based interface at http://your_pi:33333; this is a hardware configuration tool. Just short a GPIO pin to ground and see what happens in the interface.

The pypilot script is the actual autopilot and should ba running at all times. You interact with it using an using a user interface and pypilot_web, that we just saw, is one of them.

Now If you really want these 3 services to start automatically at boot time, follow these instructions:

sudo cp scripts//debian/etc/systemd/system/* /etc/systemd/system/
sudo systemctl enable pypilot
sudo systemctl enable pypilot_web
sudo systemctl enable pypilot_hat
sudo systemctl start pypilot
sudo systemctl start pypilot_web
sudo systemctl start pypilot_hat

Tinypilot install

Tinypilot running on a pizero is by far the most energy-efficient and stable solution, and preferable for operational purposes. There are two images available:

  • The official Tinypilot image that installs on a Pi Zero
  • An alternative image that installs on a Pi4/Pi zero 2, a.k.a. "stelian's image"

The official Tinypilot installs from an image onto a pizero and is based on Tinycore 9. So you download the image, copy it to an SD card, and stick the SD card into a pizero. The image that you download is compressed, and the commands to decompress it are best executed from a another linux machine, for instance another raspberry.

You can find the image and instructions on https://pypilot.org, Download *).

For the current image, these are the commands to execute to download and copy it:

wget https://pypilot.org/download.php?Down=images/tinypilot_2021_11_16.img.xz -O tinypilot_2021_11_16.img.xz
xzcat tinypilot_2021_11_16.img.xz | sudo dd of=/dev/sda bs=4M

By default, tinypilot starts an access point named 'pypilot'. You are supposed to either leave it at that, or to attach a device to this access point and use the web interface at http://192.168.14.1/wifi to change the IP configuration.

Tinypilot runs its services automatically at startup. If you want to ssh into it, user username tc and password pypilot.

The alternative tinypilot image is based on Tinycore 13 and can be installed on newer hardware, like Raspberry Pi 4 and PiZero 2. The image was created during the height of Covid, when the PiZero was globally out of stock, as a spin-off for a commercial pypilot product. Although the alternative image is available on the pypilot.org download site, it has not been embraced by the development team and might therefor fail basic tests. The download section of pypilot.org carries an old version of this alternative image; the latest version is at https://popies.net/pypilot/tinypilot13-20230326.img.xz. See this thread for the image's provenance.

Openplotter install

If you have openplotter, you can install PyPilot as an app. This takes care of all dependencies and leaves you with a fully integrated pypilot environment, complete with custom made interface screens. Instructions for this are available at https://openplotter.readthedocs.io/en/3.x.x/pypilot/pypilot_app.html


*) There's a beta image available as well https://forum.openmarine.net/showthread.php?tid=4952&pid=27577#pid27577; this is also a Tinycore 9 image, but it has PyPilot 0.42 on it.


Step 3: The openplotter user interface >>>

Clone this wiki locally