Skip to content

Commit

Permalink
Merge pull request #509 from kdmukai/patch-6
Browse files Browse the repository at this point in the history
[Docs update] Manual installation steps minor edits
  • Loading branch information
newtonick authored Feb 13, 2024
2 parents 558e6c3 + 3559b4d commit 5667cee
Showing 1 changed file with 9 additions and 58 deletions.
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
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

0 comments on commit 5667cee

Please sign in to comment.