Installation instructions updated

This commit is contained in:
Balthasar Reuter
2018-05-15 22:05:54 +02:00
parent ff1a9b90c6
commit be8cfee705

View File

@@ -1,24 +1,63 @@
1. Install Raspbian Desktop (Lite might lack some packages for the GUI)
# Installation instructions
https://www.raspberrypi.org/documentation/installation/installing-images/
These instructions are tailored towards running the photobooth on a Raspberry Pi (tested on 1B+ and 3B+).
However, I use my standard Ubuntu Laptop (16.04) with the built-in webcam and OpenCV for development and as such, the app should work on any other hardware just as well.
Simply skip the Raspberry Pi specific installation parts.
## Install Raspbian and configure it
This is just for my own reference and maybe useful, if you have a similar hardware setup.
Skip this, if you have your hardware already up and running.
### Install Raspbian Desktop
Choose Raspbian Desktop instead of the Lite flavor, which might lack some packages required for the GUI.
Download and installation instructions are available at the [Raspberry Pi website](https://www.raspberrypi.org/documentation/installation/installing-images/)
### Configure and update Raspbian
Boot up the Raspberry Pi for the first time and open a terminal (press Ctrl+Alt+T).
Enter the following to update everything to the latest version:
2. Configure and Update
```bash
sudo rpi-config
sudo rpi-update
sudo apt update
sudo apt dist-upgrade
```
3. Install required packages
Afterwards, open the configuration utility to adapt everything to your needs (e.g., setup WiFi, hostname, etc.)
```bash
sudo apt install gphoto2 libgphoto2-dev python3-dev python3-pip virtualenv
sudo rpi-config
```
### Configure touch screen, printer etc.
Configure any not working hardware, e.g., my touch screen needs some additional steps since some of the latest Raspbian releases.
See the instructions at the end for my hardware setup.
If you plan on using a printer, make sure it is configured as default printer!
## Install dependencies for the photobooth
These dependencies are required to run the application.
You might be able to skip some packages if you plan on not using
### Install required packages
In a terminal, enter the following commands
```bash
sudo apt install python3-dev python3-pip virtualenv
sudo apt install qt5-default pyqt5-dev pyqt5-dev-tools # for PyQt5-GUI
sudo apt install gphoto2 libgphoto2-dev # to use gphoto2
sudo apt install libffi6 libffi-dev # for gphoto2-cffi bindings
```
4. Remove some files to get gphoto2 working
Note: This breaks file manager access etc. for some camera models
### Remove some files to get gphoto2 working
Raspbian ships with a utility called `gvfs` to allow mounting cameras as virtual file systems.
This enables you to access some camera models as if they were USB storage drives, however, it interferes with our use of the camera, as the operating system then claims exclusive access to the camera.
Thus, we have to disable these functionalities.
*Note: This might break file manager access etc. for some camera models.*
To remove these files, enter the following in a terminal:
```bash
sudo rm /usr/share/dbus-1/services/org.gtk.vfs.GPhoto2VolumeMonitor.service
sudo rm /usr/share/gvfs/mounts/gphoto2.mount
@@ -27,40 +66,50 @@ sudo rm /usr/lib/gvfs/gvfs-gphoto2-volume-monitor
sudo rm /usr/lib/gvfs/gvfsd-gphoto2
```
4. Reboot
You should reboot afterwards to make sure these changes are effective.
5. Clone the Photobooth repository
## Install photobooth
These are the steps to install the application.
### Clone the Photobooth repository
Run the following command to obtain the source code:
```bash
git clone -b development https://github.com/reuterbal/photobooth
```
This will create a folder `photobooth` with all necessary files.
6. Initialize virtualenv
### Initialize `virtualenv`
To avoid installing everything on a system level, I recommend to initialize a virtual environment.
For that, enter the folder created in the previous step
```bash
cd photobooth
```
and run the following command
```bash
virtualenv -p python3 --system-site-packages .venv
```
Activate the virtual environment.
You have to do this whenever you open a new terminal or rebooted your hardware
```bash
source .venv/bin/activate
```
7. Install Photobooth
### Install photobooth with dependencies
Run the following command to download and install all dependencies and the photobooth:
```bash
pip install -e .
```
8. Run Photobooth
## Run Photobooth
If not yet done, activate your virtual environment
```bash
python3 photobooth
source .venv/bin/activate
```
and run the photobooth as
```bash
python photobooth
```
pip install pyqt5
pip install opencv-python
pip install Pillow
pip install gpiozero
apt install gphoto2 libgphoto2-dev
pip install gphoto2
-or-
pip install gphoto2-cffi
## Additional setup steps for my hardware setup
@@ -91,9 +140,60 @@ EndSection
The calibration data can be obtained using `xinput-calibrator`.
### Canon Selphy CP-1000 printer
### Canon SELPHY CP1200/CP1300 printer
#### Add buster/testing repository
We need Gutenprint 5.2.13 or newer, unfortunately Raspbian Stretch includes only Gutenprint 5.2.11.
Luckily, the next distro (Buster) includes an up-to-date version and thus we can install that one instead of compiling the drivers ourselves.
For that, we add the buster repositories with a lower priority (to avoid an upgrade of all packages) and select them later manually, when installing the drivers.
Create file `/etc/apt/preferences.d/stretch.pref` with content
```
Package: *
Pin: release n=stretch
Pin-Priority: 900
```
Create file `/etc/apt/preferences.d/buster.pref` with content
```
Package: *
Pin: release n=buster
Pin-Priority: 750
```
Add the following line to `/etc/apt/sources.list`:
```
deb http://mirrordirector.raspbian.org/raspbian/ buster main contrib non-free rpi
```
#### Install Gutenprint printer drivers
With the up-to-date drivers available, we install them with the following command:
```bash
apt install printer-driver-gutenprint
apt update
apt install printer-driver-gutenprint -t buster
```
#### Add user `pi` to group `lpadmin`
To allow the current user to modify printer settings we must add it to the group `lpadmin`:
```bash
sudo usermod -a -G lpadmin pi
```
#### Plug in printer to USB port and add in CUPS
* Plug in the printer.
* Open http://localhost:631 on the Raspberry Pi.
* Select 'Add Printer' in the Tab 'Administration'
* When asked, enter credentials for user `pi`
* The printer should be offered somewhere close to the top of the list in the section 'Local Printers'. Select it and click 'Continue'.
* If you wish, you can specify a name in the next step.
* In the last step, select the appropriate model in the list. For the Canon SELPHY CP1300 the printer for the CP1200 works fine as the CP1300 is the same printer with a larger screen and some smartphone baublery.
* Click "Add Printer". This concludes the installation.
* In the following dialogue, you can modify the default settings.
#### Select default printer
It is important that you set the printer as the default printer.
For that, go to the CUPS administration interface (http://localhost:631), open the list of printers and select your printer.
In the drop-down menu 'Administration' select 'Set as Server Default'.