Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs update] Manual installation steps minor edits #509

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 9 additions & 58 deletions docs/manual_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ sudo apt install python3-apt -y


### Install dependencies
Copy this entire box and run it as one command (will take a while to complete):
Copy this entire box and run it as one command (~15 minutes on a Pi Zero 1.3):
```bash
sudo apt update && sudo apt install -y wiringpi python3-pip \
python3-numpy python-pil libjpeg-dev zlib1g-dev libopenjp2-7 \
Expand Down Expand Up @@ -148,31 +148,6 @@ rm bcm2835-1.60.tar.gz
sudo rm -rf bcm2835-1.60
```

### Set up `virtualenv`
```bash
python -m pip install virtualenvwrapper
```

Edit your bash profile with the command `nano ~/.profile` and add the following to the end:
```bash
export WORKON_HOME=$HOME/.envs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source $HOME/.local/bin/virtualenvwrapper.sh
```
Then `CTRL-X` and `y` to exit and save changes.

Now create the virtualenv for SeedSigner:
```bash
source ~/.profile
mkvirtualenv seedsigner-env
```

For convenience you can configure your `.profile` to auto-activate the SeedSigner virtualenv when you ssh in. Once again `nano ~/.profile` and add at the end:
```bash
workon seedsigner-env
```


### Download the SeedSigner code:
```bash
git clone https://github.com/SeedSigner/seedsigner
Expand All @@ -196,9 +171,11 @@ sudo swapon /swapfile

### Install Python `pip` dependencies:
```bash
# Takes 1hr 45min on a Pi Zero 1.3
pip install -r requirements.txt
pip install -r requirements-raspi.txt
# Takes 1hr 15min on a Pi Zero 1.3
python3 -m pip install -r requirements.txt

# Only takes ~100 seconds
python3 -m pip install -r requirements-raspi.txt
```

#### `pyzbar`
Expand All @@ -209,28 +186,6 @@ The fork is required because the main `pyzbar` repo has been abandoned. This [gi
* [PR 82](https://github.com/NaturalHistoryMuseum/pyzbar/pull/82): enable `zbar`'s new binary mode. Note that this PR has a trivial bug that was fixed in our fork.


### Finish configuring the virtualenv
Set the SeedSigner `src/` directory as the project directory for the virtualenv (this is where the virtualenv will take you when you activate it):
```bash
cd src
setvirtualenvproject
```

Test it out:
```bash
# exit the virtualenv
deactivate

# change dirs to somewhere else
cd ~

# activate the virtualenv
workon seedsigner-env

# you should now be back in the SeedSigner src/ directory
pwd
```

### Optional: increase spidev buffer size
This allows `ST7789.py` to update the LCD without performing multiple write operations because the default buffer size is 4096 bytes. The default can be changed via the `/boot/cmdline.txt` file. You will need to add `spidev.bufsiz=131072` to the end of this single lined file command.

Expand All @@ -254,7 +209,7 @@ Description=Seedsigner
[Service]
User=pi
WorkingDirectory=/home/pi/seedsigner/src/
ExecStart=/home/pi/.envs/seedsigner-env/bin/python3 main.py > /dev/null 2>&1
ExecStart=/usr/bin/python3 main.py > /dev/null 2>&1
Restart=always

[Install]
Expand Down Expand Up @@ -303,13 +258,9 @@ sudo rm /var/swap

## Manually start the SeedSigner code
```bash
# activate the virtualenv if you haven't already
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 lines above here:
sudo rm /var/swap becomes sudo rm /var/swap /swapfile

workon seedsigner-env

# You should now be in the SeedSigner src/ directory. List its contents:
ls
cd ~/seedsigner/src

# You should see the main.py file. Run it:
# You'll find the main.py file in that directory. Run it:
python main.py

# To kill the process, use CTRL-C
Expand Down