Configure Raspberry Pi - SnackChain/SnackPi GitHub Wiki
Install Raspberry Pi OS lite:
Note: You will need a monitor with HDMI and an usb keyboard for this set up.
- We want to install the lightest version of Raspberry Pi OS, that's why use Raspberry Pi OS lite.
- Download most recent version of Raspberry Pi OS lite in your pc: Raspberry Pi OS
- Install it in your memory following the next guide: Raspberry Pi OS installation guide
Setup initial requirements
- Connect the keyboard, the monitor and turn on the raspberry
- Default user for raspberry is:
username: pi
password: raspberry
Setup WiFi
- Follow official guide. The easiest way is by following 'Using raspi-config' section: WiFi setup guide
Enable SSH
- Enable ssh following the next guide, this will allow you to connect to your raspberry with your pc and remove the keyboard and monitor (Enable SSH): SSH setup
Connecting through SSH (optional)
- At this point, you can connect the raspberry through ssh from your computer, but for that, you need to know raspberry IP address
- In Raspberry type:
hostname -I
- You will see the raspberry IP, now in your computer type:
ssh pi@ip_address
For example:
- You will be requested to enter raspberry password, default password:
raspberry
- Now you don't need to use the keyboard and the monitor attached to the raspberry
Enable i2c in the Raspberry
- Type:
sudo raspi-config
- Select Interfacing options
- Select I2C
- Select Yes
- Reebot raspberry
Install Python 3 in the Raspberry
- Verify if you have python 3 installed:
python3 --version
- If you don't install it run:
sudo apt-get update
sudo apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev tar wget vim
wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
sudo tar zxf Python-3.9.0.tgz
cd Python-3.9.0
sudo ./configure --enable-optimizations
sudo make -j 4
sudo make altinstall
- Verify python 3:
python3 --version
Install Git in the Raspberry:
- Install it:
sudo apt update
sudo apt install git
- Verify it:
git --version
Install pip3 in the Raspberry:
- Install pip:
sudo apt install python3-pip
Clone SnackPi repo in the Raspberry:
- Create a new folder:
mkdir snacks
- Clone the repo in snacks directory:
cd snacks
git clone [email protected]:SnackChain/SnackPi.git
Run main file
python3 main.py
Install dependencies in the Raspberry:
- You will see that some dependencies are missing, install them with pip3 like this:
pip3 install requests
Setup Zeroconf/Bonjour:
sudo apt-get update
sudo apt-get install libnss-mdns
Change default hostname:
Change name in
sudo nano /etc/hostname
Change name in last line of:
sudo nano /etc/hosts