upiwin/docs/os-instructions.md

65 lines
2.6 KiB
Markdown
Raw Permalink Normal View History

# Preparing the Operating System for UPIWIN
The Raspberry Pi OS needs to be configured with the appropriate device tree support, software, and libraries to compile
and run UPIWIN successfully. This document describes the process.
## Preparing the Operating System
1. Download an image of Raspberry Pi OS from
[the Raspberry Pi Foundation](https://downloads.raspberrypi.org/raspios_armhf/images/). The most-recent version of
Raspberry Pi OS that is known to work with the PiTFT is
[the December 4, 2020 image](https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2020-12-04/).
2. Unzip the `.zip` file for your image and write th included `.img` file to a fresh MicroSD card using one of the
methods described on [this page](https://www.raspberrypi.org/documentation/computers/getting-started.html).
3. Connect your UPIWIN-compatible Raspberry Pi (RPi 3B+ with PiTFT) to power, HDMI display, keyboard, and network
(if necessary). Insert the freshly-written MicroSD card into the Pi.
4. Turn on the Pi, boot into Raspberry Pi OS, and set it up. Make sure to get updates installed.
## Installing the PiTFT Drivers
1. In a terminal window, enter the command `sudo -i` to get a root command prompt.
2. Enter the following commands:
pip3 install --upgrade adafruit-python-shell click
git clone https://github.com/adafruit/Raspberry-Pi-Installer-Scripts.git
cd Raspberry-Pi-Installer-Scripts
python3 adafruit-pitft.py --display=28c --rotation=90
3. Answer "N" to the questions about the console appearing on the PiTFT display and mirroring HDMI to the PiTFT
display.
4. Reboot the Pi when prompted.
## Installing Libraries for UPIWIN
1. Use `sudo -i` to get a root command prompt.
2. Execute the command to install packaged libraries and utilities:
apt install python3-dev libfreetype6-dev libpng-dev libzip-dev ttf-mscorefonts-installer zip
3. Execute the commands to install the BCM2835 library:
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.68.tar.gz
tar xzvf bcm2835-1.68.tar.gz
cd bcm2835-1.68
./configure
make
make check
make install
4. Copy the Arial font to where the code expects to see it:
mkdir /usr/local/share/fonts/truetype
cp /usr/share/fonts/truetype/msttcorefonts/arial.ttf /usr/local/share/fonts/truetype
## Building the Source
After cloning the repository for UPIWIN, enter the following commands:
cd upiwin
make
2021-08-29 16:42:21 -06:00
The resulting executable and demo scripts will be placed into the `output` directory.
To execute, change to the `output` directory and enter the command `sudo ./upiwin` followed by the name of the script
to be run. For example, `sudo ./upiwin demo1.py`.