forked from DexterInd/GoPiGo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·137 lines (121 loc) · 4.41 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·137 lines (121 loc) · 4.41 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#! /bin/bash
echo " _____ _ ";
echo " | __ \ | | ";
echo " | | | | _____ _| |_ ___ _ __ ";
echo " | | | |/ _ \ \/ / __/ _ \ '__| ";
echo " | |__| | __/> <| || __/ | ";
echo " |_____/ \___/_/\_\\__\___|_| _ _ ";
echo " |_ _| | | | | (_) ";
echo " | | _ __ __| |_ _ ___| |_ _ __ _ ___ ___ ";
echo " | | | '_ \ / _\` | | | / __| __| '__| |/ _ \/ __|";
echo " _| |_| | | | (_| | |_| \__ \ |_| | | | __/\__ \ ";
echo " |_____|_| |_|\__,_|\__,_|___/\__|_| |_|\___||___/ ";
echo " ";
echo " ";
echo " "
printf "Welcome to GoPiGo Installer.\nPlease ensure internet connectivity before running this script.\n
NOTE: Raspberry Pi wil reboot after completion."
printf "Special thanks to Joe Sanford at Tufts University. This script was derived from his work. Thank you Joe!"
printf " "
echo "Must be running as Root user"
echo " "
echo "Press ENTER to begin..."
# read
echo " "
echo "Check for internet connectivity..."
echo "=================================="
wget -q --tries=2 --timeout=20 http://google.com
if [ $? -eq 0 ];then
echo "Connected"
else
echo "Unable to Connect, try again !!!"
exit 0
fi
echo " "
echo "Installing Dependencies"
echo "======================="
sudo apt-get install python-pip git libi2c-dev python-serial python-rpi.gpio i2c-tools python-smbus arduino minicom libnss-mdns python-dev
sudo pip install -U RPi.GPIO
echo "Dependencies installed"
#Copy Software Servo
cp -R ../Firmware/SoftwareServo/ /usr/share/arduino/libraries/
chmod +x gpg
cp gpg /usr/bin
cd ../Software/Python
python setup.py install
cd ../../Setup
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build
echo "wiringPi Installed"
echo " "
echo "Removing blacklist from /etc/modprobe.d/raspi-blacklist.conf . . ."
echo "=================================================================="
if grep -q "#blacklist i2c-bcm2708" /etc/modprobe.d/raspi-blacklist.conf; then
echo "I2C already removed from blacklist"
else
sudo sed -i -e 's/blacklist i2c-bcm2708/#blacklist i2c-bcm2708/g' /etc/modprobe.d/raspi-blacklist.conf
echo "I2C removed from blacklist"
fi
if grep -q "#blacklist spi-bcm2708" /etc/modprobe.d/raspi-blacklist.conf; then
echo "SPI already removed from blacklist"
else
sudo sed -i -e 's/blacklist spi-bcm2708/#blacklist spi-bcm2708/g' /etc/modprobe.d/raspi-blacklist.conf
echo "SPI removed from blacklist"
fi
#Adding in /etc/modules
echo " "
echo "Adding I2C-dev and SPI-dev in /etc/modules . . ."
echo "================================================"
if grep -q "i2c-dev" /etc/modules; then
echo "I2C-dev already there"
else
echo i2c-dev >> /etc/modules
echo "I2C-dev added"
fi
if grep -q "i2c-bcm2708" /etc/modules; then
echo "i2c-bcm2708 already there"
else
echo i2c-bcm2708 >> /etc/modules
echo "i2c-bcm2708 added"
fi
if grep -q "spi-dev" /etc/modules; then
echo "spi-dev already there"
else
echo spi-dev >> /etc/modules
echo "spi-dev added"
fi
echo " "
echo "Making I2C changes in /boot/config.txt . . ."
echo "================================================"
echo dtparam=i2c1=on >> /boot/config.txt
echo dtparam=i2c_arm=on >> /boot/config.txt
#Adding ARDUINO setup files
echo " "
echo "Making changes to Arduino . . ."
echo "==============================="
cd /tmp
wget http://project-downloads.drogon.net/gertboard/avrdude_5.10-4_armhf.deb
sudo dpkg -i avrdude_5.10-4_armhf.deb
sudo chmod 4755 /usr/bin/avrdude
cd /tmp
wget http://project-downloads.drogon.net/gertboard/setup.sh
chmod +x setup.sh
sudo ./setup.sh
#Enabling serial port in Arduino IDE
crontab -l > file; echo '@reboot ln -sf /dev/ttyAMA0 /dev/ttyS0' >> file; crontab file
rm file
sudo rm -r /tmp/di_update
echo " "
echo "Please restart the Raspberry Pi for the changes to take effect"
echo " "
echo "Please restart to implement changes!"
echo " _____ ______ _____ _______ _____ _______ "
echo " | __ \| ____|/ ____|__ __|/\ | __ \__ __|"
echo " | |__) | |__ | (___ | | / \ | |__) | | | "
echo " | _ /| __| \___ \ | | / /\ \ | _ / | | "
echo " | | \ \| |____ ____) | | |/ ____ \| | \ \ | | "
echo " |_| \_\______|_____/ |_/_/ \_\_| \_\ |_| "
echo " "
echo "Please restart to implement changes!"
echo "To Restart type sudo reboot"