-
Notifications
You must be signed in to change notification settings - Fork 4
/
get_pi_requirements.sh
executable file
·82 lines (73 loc) · 3.26 KB
/
get_pi_requirements.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
#get latest raspbian os packages
testfile=~/station/restartmarker
if test -f "$testfile";
then
printf "\033[0;35m####### Welcome Back we will proceed with the tasks #######\n\n"
rm restartmarker
else
printf "\033[0;35m####### Getting latest raspbian os packages#######\n\n"
sudo apt update
sudo apt upgrade -y
printf "\033[0;35mWhen packages where updated, it´s a good decision to make a restart at this point, and run the script again.\033[0m\n"
printf "\033[0;35mRestart now y/n ?[n]\033[0m\n"
read -t 10 -n 1 Result
if [ "$Result" == y ]
then
printf "##### Restart now ####\n"
printf "##### BYE! ####\n"
touch restartmarker
sudo shutdown -r now System will perform reqboot
else
printf "\033[0;35m###### Restart skipped ######\033[0m\n"
fi
fi
printf "\033[0;35m####### Install general python packages#######\033[0m\n"
# General
pip3 install pyyaml
pip3 install schedule
pip3 install --upgrade numpy
printf "\033[0;35m####### Install Senors #######\033[0m\n"
# Sensors
sudo pip3 install adafruit-circuitpython-dht
sudo apt-get install libgpiod2
# Microphone
sudo pip3 install --upgrade adafruit-python-shell
wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2smic.py
printf '%s\n' y n | sudo python3 i2smic.py
yes | sudo apt-get install libatlas-base-dev libportaudio2 libasound-dev gfortran libopenblas-dev cmake
yes | python3 -m pip install --user sounddevice
python3 -m pip install --user scipy
pip3 install SoundFile
printf "\033[0;35m####### Set Autostart #######\033[0m\n"
# autostart
yes | sudo apt-get install xterm
mkdir -p ~/.config/autostart
cp ~/station/lxterm-autostart.desktop ~/.config/autostart
# activate the HDMI output, even if no monitor is detected
sudo sed -i '3ahdmi_force_hotplug=1' /boot/config.txt
sudo sed -i '4ahdmi_mode=16' /boot/config.txt
printf "\033[0;35m####### config interfaces -> enable camera and i2c #######\033[0m\n"
# config interfaces -> enable camera and i2c
sudo raspi-config nonint do_camera 0
sudo raspi-config nonint do_legacy 0
sudo raspi-config nonint do_vnc 0
sudo raspi-config nonint do_i2c 0
printf "\033[0;35m\n####### Finished #######\n"
printf "\033[0;35m ) \n"
printf "\033[0;35m \ ) \n"
printf "\033[0;35m () \ )\n"
printf "\033[0;35m () ) \\n"
printf "\033[0;35m .-\"\"\"-. \\ \(\)\n"
printf "\033[0;35m ____ \/ __ \`\\ __ \(\)\n"
printf "\033[0;35m .'\` __'. | o/__\o | / /|\n"
printf "\033[0;35m / o /__\o;\ \\// /_ // /\n"
printf "\033[0;35m ._ _| \\// |\`-.__.-'|\ \`; /\n"
printf "\033[0;35m/ \ .' \-.____.'| || |/ \/\n"
printf "\033[0;35m\`._ '-/ | || '.___./\n"
printf "\033[0;35m. '-.\_.-' __.'-._||_.-' _ /\n"
printf "\033[0;35m.\`""===(||).___.(||)(||)----'(||)===...__\n"
printf "\033[0;35m \`\"jgs\"\`\"\"=====\"\"\"\"========\"\"\"====...__ \`\"\"==._\n"
printf "\033[0;35m \`\"=. \`\"=.\n"
printf "\033[0;35m \`\"=.\n"
printf "\033[0;35m Art by Joan Stark (https://www.asciiart.eu/animals/birds-land)\n"