-
Notifications
You must be signed in to change notification settings - Fork 3
Install pypilot
WORK IN PROGRESS JUL-2023
In this step, you will install pypilot. I'll describe three options:
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 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.
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.
Pypilot Workbook
- Introduction
- What is pypilot
- The software component
- The hardware component
- The User Interface component
- Pypilot functions
- Data connections
-
The steps
- OLD
- Step 1: Install Openplotter Headless
- Step 2: Install pypilot
- Step 3: The openplotter user interface
- Step 4: The browser interface
- Step 5: The HAT interface
- Step 6: The Arduino controller
- Step 7: OpenCPN Pypilot Plugin
- Step 8: Looking under the hood
- Step 9: Wiring up the Nano
- Step 10: Installing Tinypilot
- Step 11: Tinypilot under the hood
- Step 12: Using openplotter tools remotely
- Step 13: SignalK connections
- Step 14: The Pypilot Motor Controller
- Step 15: Understanding motor.ino
- Parameters
- Gains
- NEW
- Step 1: Installing pypilot
- Step 2: Web interface
- Step 3: OpenCPN pypilot plugin
- Step 4: Installing the arduino
- Step 5: Wiring the arduino
- Step 6: Setting up data connections
- Step 7: SignalK connections
- Step 8: HAT interface
- Step 9: Debian under the hood
- Step 10: Tinypilot under the hood
- Step 11: Openplotter details
- Updating pypilot: debian
- Updating pypilot: tinypilot
- Feedback
- Todo
- Finally
- Autopilot Route Plugin
- Watchdog
- Workbook Release Notes