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.
  1. Download most recent version of Raspberry Pi OS lite in your pc: Raspberry Pi OS
  2. Install it in your memory following the next guide: Raspberry Pi OS installation guide

Setup initial requirements

  1. Connect the keyboard, the monitor and turn on the raspberry
  2. 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
  1. In Raspberry type:

hostname -I

  1. You will see the raspberry IP, now in your computer type:

ssh pi@ip_address

For example:

ssh [email protected]

  1. You will be requested to enter raspberry password, default password:

raspberry

  1. Now you don't need to use the keyboard and the monitor attached to the raspberry

Enable i2c in the Raspberry

  1. Type:

sudo raspi-config

  1. Select Interfacing options

Interfacing options

  1. Select I2C

I2C

  1. Select Yes

Yes

  1. Reebot raspberry

Install Python 3 in the Raspberry

  1. Verify if you have python 3 installed:

python3 --version

  1. 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

  1. Verify python 3:

python3 --version

Install Git in the Raspberry:

  1. Install it:

sudo apt update

sudo apt install git

  1. Verify it:

git --version

Install pip3 in the Raspberry:

  1. Install pip:

sudo apt install python3-pip

Clone SnackPi repo in the Raspberry:

  1. Create a new folder:

mkdir snacks

  1. 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:

  1. 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