From 382683efe1abfdf6280fa32a9416bb642f777882 Mon Sep 17 00:00:00 2001 From: Kshitij Date: Sat, 19 Oct 2024 18:03:29 +0530 Subject: [PATCH] moved final-setup to setup.sh since it's the main setup now. --- setup.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 setup.sh diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..efc6d3a --- /dev/null +++ b/setup.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +line="==================================" +PROJECT_DIR=/home/$(whoami)/iot-mini + +############################################### + +# Install dependencies +sudo apt update + +# Checking for python and it's dependencies +if ! dpkg -l | grep -q "python3"; then + echo -e "$line\npython3 not installed, installing...\n$line\n" + sudo apt install -y python3 +else + echo -e "$line\npython3 already installed. Moving one...\n$line\n" +fi +if ! dpkg -l | grep -q "python3-pip"; then + echo -e "$line\npython3-pip not installed, installing...\n$line\n" + sudo apt install -y python3-pip +else + echo -e "$line\npython3-pip already installed. Moving one...\n$line\n" +fi +if ! dpkg -l | grep -q "python3.11-venv"; then + echo -e "$line\npython3.11-venv not installed, installing...\n$line\n" + sudo apt install -y python3.11-venv +else + echo -e "$line\npython3-venv already installed. Moving one...\n$line\n" +fi + +# Install camera stuff +echo -e "$line\nInstalling camera dependencies\n$line" +sudo apt install -y python3-picamera2 python3-picamera python3-opencv python3-numpy # Python camera packages for pi camera +sudo apt install -y libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev # Image I/O packages +sudo apt install -y libgtk2.0-dev libcap-dev # GTK development library & picamera2 dependency +sudo apt install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev # Video I/O packages +sudo apt install -y libatlas-base-dev gfortran # Optimize OpenCV operation + +sudo apt install -y python3-requests # For notifications + +############################################### + +cp main.py $PROJECT_DIR/ +cd $PROJECT_DIR