Skip to content

Commit 50aa890

Browse files
author
Mr. ChatGPT
committed
doc: RPi Install Update
This commit significantly enhances the setup instructions specifically for Raspberry Pi users in the README.md file. The updates aim to provide clearer, more detailed, and step-by-step guidance for setting up the project on Raspberry Pi environments, especially addressing issues related to dependencies and configurations. Key Changes: 1. **Added Pre-requisites Section**: Introduced a new section detailing the pre-requisites for setting up the project on Raspberry Pi. This includes using Raspberry Pi OS Bullseye for better compatibility and the necessary library installations for `opencv-python`. 2. **Updated Repository Prioritization**: Instructions have been provided to modify `pyproject.toml` to prioritize the piwheels repository over PyPI for more reliable and faster package installations specific to the Raspberry Pi. 3. **Cleaner Documentation Structure**: Organized the Raspberry Pi section into a more readable and step-by-step format, making it easier for users to follow and apply the instructions. This update to the README.md ensures that users attempting to set up the project on Raspberry Pi have all the necessary information at their disposal, reducing setup issues and enhancing the overall user experience on such devices.
1 parent c29bf75 commit 50aa890

File tree

1 file changed

+73
-8
lines changed

1 file changed

+73
-8
lines changed

README.md

+73-8
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,82 @@ The ability to develop, test and debug the launcher and facial recognition funct
3939
```
4040

4141
1. Raspberry Pi:
42-
Most likely you will run into `KeyRing` errors when installing over ssh on raspberry pi.
4342

44-
To get around it:
43+
1. Pre-requisites:
44+
For faster and reliable install, use [Raspberry Pi OS Bullseye](https://downloads.raspberrypi.com/raspios_oldstable_armhf/images/raspios_oldstable_armhf-2023-12-06/2023-12-05-raspios-bullseye-armhf.img.xz).
45+
Binary wheels packages are available for `opencv-python` only for Bullseye currently. See [pi wheels/opencv-python wheel](https://www.piwheels.org/project/opencv-python/)
46+
Install the pre-requisites:
4547

46-
```shell
47-
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
48-
poetry install
49-
```
48+
```shell
49+
sudo apt install -y libatlas-base-dev libhdf5-dev libopenblas-dev
50+
```
5051

51-
should work. See [GitHub issue](https://github.com/python-poetry/poetry/issues/1917) for further details.
52+
1. Fix pyproject.toml manually:
53+
54+
Change the primary poetry packages source from `PyPI` to `piwheels`:
55+
56+
From:
57+
58+
```toml
59+
[[tool.poetry.source]]
60+
name = "piwheels.org"
61+
url = "https://www.piwheels.org/simple"
62+
priority = "supplemental"
63+
64+
[[tool.poetry.source]]
65+
name = "PyPI"
66+
priority = "primary"
67+
```
68+
69+
To:
70+
71+
```toml
72+
[[tool.poetry.source]]
73+
name = "piwheels.org"
74+
url = "https://www.piwheels.org/simple"
75+
priority = "primary"
76+
77+
[[tool.poetry.source]]
78+
name = "PyPI"
79+
priority = "supplemental"
80+
```
81+
82+
Delete the `poetry.lock` file
83+
84+
```shell
85+
rm poetry.lock
86+
```
87+
88+
1. Most likely you will run into `KeyRing` errors when installing over ssh on raspberry pi.
89+
90+
To get around it:
91+
92+
```shell
93+
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
94+
poetry install
95+
```
96+
97+
should work. See [GitHub issue](https://github.com/python-poetry/poetry/issues/1917) for further details.
98+
99+
1. Install the pre-requisites: `sudo apt install -y libatlas-base-dev libhdf5-dev libopenblas-dev`
100+
101+
1. Enable legacy camera support: Using `sudo raspi-config` enable `Legacy Camera Support`. This mode is going to be
102+
deprecated. See [use legacy](https://github.com/opencv/opencv/issues/22820). This mode is used in the code as it offers
103+
the most portability across operating systems.
104+
105+
**Note**: If you have Raspberry Pi Camera Module v3 or later this won't work. To avoid this, we have to use `picamera2`
106+
which uses `libcamera`. See [picamera2 examples](https://github.com/raspberrypi/picamera2/blob/main/examples/opencv_face_detect_3.py).
107+
108+
1. VNC or Desktop Display mode:
109+
110+
To see the program working you need to login to the Raspberry PI Desktop. These are the steps that I had to take
111+
to make it work.
112+
113+
1. Install `sudo apt install xrdp`
114+
1. Add a new user, `sudo adduser pygpt` and RDP using as the new user. `RDP` session should not show a black screen now.
115+
(I have seen this problem before where the files needed for X window session are not created by default. When you do add a new user
116+
after installing `xrdp` then the files get created and everything works like magic. ).
117+
See [OMG - it saved me so much time](https://www.reddit.com/r/raspberry_pi/comments/qw1cdw/raspberry_pi_4_xrdp_windows_10_remote_desktop/).
52118
53119
1. Windows:
54120
Most likely you will run into `No backend available` errors.
@@ -92,7 +158,6 @@ To use `main.py`:
92158

93159
This script will utilize the camera to detect and track faces, and control the T-Shirt launcher based on the tracked positions.
94160

95-
96161
### Headless Mode Operation
97162

98163
#### Overview

0 commit comments

Comments
 (0)