-
Notifications
You must be signed in to change notification settings - Fork 0
Setting Up The Raspberry Pi
This is the dreaded bit of the project where you have unfortunately need to get a spare mouse, keyboard and monitor out to hook into your Raspberry Pi - unless you do the smart thing and SSH into it.
First things first, get your Raspberry Pi hooked up and turned on. You will want to download this repository and specifically drag the "src/client" folder to your desktop, which is the only code the Raspberry Pi needs on it.
- Firstly, connect the Raspberry Pi to your WIFI
- Go to your Raspberry Pi preferences and enable the I2C interface
- Whilst in the preferences, disable screen blanking
Open a terminal and run git clone https://github.com/jackdevonshire/Button-Box/
- Open the file browser and navigate to your username, and then the Button-Box directory.
- Run the client/main.py code to determine if you need to import anything . If any modules are missing, open a terminal and type
python3 pip install MISSING_MODULE_NAMEor search the error in google for advice. I don't think anything needs installing, but I may be wrong.
This is probably the second most complex part of the project. I've followed hundreds of online tutorials to make code launch on bootup, and absolutely nothing worked until I found this tutorial. Follow that if you get lost during this step!
- Open a terminal and make sure you can run your python script, the command should look like
python3 home/USERNAME/Button-Box/src/client/main.py - Now in a terminal, type
sudo nano /lib/systemd/system/buttonbox.service - Copy and adjust the following code into the text editor:
[Unit]
Description=Button Box Service
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/python /home/USERNAME/Button-Box/src/client/main.py
Restart=on-abort
[Install]
WantedBy=multi-user.target
- Now press CTRL+X then Y then ENTER
Some Basic Commands for services:
- Start Service
sudo systemctl start buttonbox - Stop Service
sudo systemctl stop buttonbox - Restart Service
sudo systemctl restart buttonbox - Disable Service
sudo systemctl disable buttonbox
Now try to run the src/client/main.py Python program in the Thonny Program Editor to check for any last minute issues. You will probably get an error to do with the hostname not being setup, but we will fix that later. At the very least, we expect the screen to at-least quickly flask with the text "Setting Up" or something along those lines. Any text on the screen means we're on the right track.
Restart the Raspberry Pi with no HDMI connected and again check for text showing on the screen, if something does flash up, we're all good to move on.
Try following along with the next wiki page anyway, it may be because we haven't fully configured the client yet.
Visit my website to see other fun projects like this!
Building
- Requirements
- Preparing The Box
- Wiring The Buttons
- GPIO Wiring
- Raspberry Pi Setup
- Configuring The Button Box
Configuration
Admin Panel Setup (Coming Soon)
Finishing Up