This repository has been archived by the owner on May 19, 2024. It is now read-only.
forked from iot-chalmers/iot-testbed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_pkgs.sh.old
executable file
·57 lines (45 loc) · 2.2 KB
/
install_pkgs.sh.old
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
#!/bin/bash
########## To sync: rsync -avz -e "ssh -p17122" ./iot-testbed [email protected]:/home/testbed ######
########## Server side ###########
##### 1. configure the /etc/hosts file to have the raspi IPs and hostnames, for example:
# 192.168.87.228 raspi03
# 192.168.87.229 raspi04
# 192.168.87.230 raspi05
####install packages on server
sudo apt update --fix-missing
sudo apt install -y python-2.7 iptables-persistent dhcpdump rsync default-jre default-jdk pssh putty-tools clusterssh libffi screen at ntp tree
sudo apt install -y gcc-4.9-arm-linux-gnueabihf-base
sudo apt-get install -y g++-arm-linux-gnueabihf
sudo apt-get install -y build-essential
pip install --upgrade pip
pip install parallel-ssh
pip install pytz --user
####download MAC addresses vendor database
sudo wget http://standards.ieee.org/regauth/oui/oui.txt -O /usr/local/etc/oui.txt
####ping PIs
for ip in raspi{03..05}; do ping -c 1 -t 1 $ip && echo "${ip} is up"; done
####add user to dialout group
sudo usermod -aG dialout testbed
####create install folder for testbed SW
sudo mkdir -p /usr/testbed
sudo chown testbed:testbed /usr/testbed
########## RasPIs ##########
####1. please make a user called user, and give it sudo access without password over ssh
####2. these commands would install teh pkgs on the PIs
#parallel-ssh --hosts ~/testbed/sshhosts.txt --user user --inline "sudo apt update && sudo apt -y --force-yes install picocom ssh python2.7 screen at ntpdate ntp"
#parallel-ssh --hosts ~/testbed/sshhosts.txt --user user --inline "sudo usermod -aG dialout user"
parallel-ssh --hosts ~/testbed/sshhosts.txt --user user --inline "ntptime"
####install testbed SW to the server /usr and to PIs
sh /home/testbed/iot-testbed/install.sh
####test if it works
python /usr/testbed/scripts/testbed.py status
#####Update the files: ~/testbed/sshhosts.txt and server/scripts/all-hosts with the PIs hostnames
#### if this makes a problem, then disable apt autoupdate
# systemctl stop apt-daily.service
# systemctl disable apt-daily.service
# systemctl kill --kill-who=all apt-daily.service
# wait until `apt-get updated` has been killed
# while ! (systemctl list-units --all apt-daily.service | fgrep -q dead)
# do
# sleep 1;
# done