Skip to content

Latest commit

 

History

History
102 lines (61 loc) · 2.52 KB

board_readme.md

File metadata and controls

102 lines (61 loc) · 2.52 KB

Raspberry Pi 5 Setup Guide 🚀

This guide demonstrates the following: creating a virtual environment, cloning a repository, installing its dependencies, and debugging hardware on the RPI 5.

Navigation Table ❤️🔥⚡

Prerequisites 📋

Ensure your OS is up to date. Many fixes came in January 2024:


sudo apt-get update
sudo apt-get upgrade

Installation Steps 🛠

1. Install Git and Python 🐍

Now, install Git and Python3, along with the venv module to manage virtual environments.

sudo apt-get install -y git python3 python3-venv

2. Set Up Virtual Environment 🌐

Create a directory for your project and navigate into it:

mkdir my_project
cd my_project

Create a virtual environment named my_env_name:

python3 -m venv my_env_name

Activate the virtual environment:

source my_env_name/bin/activate

This step will ensure compatibility and preserve your devices Python env.

3. Clone the Repository 📦

git clone https://github.com/LilaShiba/flask_server_ubi.git

Navigate into the cloned repository:

cd flask_server_ubi

4. Install Dependencies 📚

Located in requirements.txt:

pip install -r requirements.txt

Enable I2C communication

Open the pi terminal and run

sudo raspi-config 

This will open the option menu. You will want to select Interface Options, and then enable I2C.

Running the Application 🚀

To run the Hardware:

python app/utils/main.py

Debugging

The I2C pins can be a bit tricky. First, we will install some tools to help peak inside the RPI. Then we will look at the states of the GPIO. Lastly, we will scan the I2C bus for any devices on said port.

Update i2c-tools


 sudo apt update
 sudo apt install -y i2c-tools

Check the GPIO pins If the sda and scl pins are reading high, your sensors are not detected and may be damaged.

gpio readall

Find devices on I2C bus. This command will give you the address for all I2C devices

i2cdetect -y 1