-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrpiSetupScript
More file actions
131 lines (95 loc) · 2.53 KB
/
rpiSetupScript
File metadata and controls
131 lines (95 loc) · 2.53 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
######### PI CONFIGURATION
sudo nano /etc/default/keyboard # XKBLAYOUT=„us”
# set up wifi connection
#inet configuration
sudo vi /etc/network/interfaces
# add:
# auto wlan0
# allow-hotplug wlan0
# iface wlan0 inet static
# address 192.168.1.41
# netmask 255.255.255.0
# gateway 192.168.1.1
# wpa-passphrase xxx
# wpa-ssid xx
########## remote VNC configuration
sudo apt-get install tightvncserver
sudo vncserver :1
sudo chown pi:pi .Xauthority
#?
mkdir libs
cd libs/
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build
######### BT configuration
sudo apt-get install bc
sudo apt-get install bluez bluez-hcidump
#test: hcidump --raw
#test: hcitool lescan --duplicates &
######### GIT CLONE ##################
cd ~
mkdir dev
cd dev
git clone https://github.com/ewojtach/RPiScripts.git
cd RPiScripts
chmod +x readTempAndMotionDetector.sh
chmod +x rebootNodeRedScript.sh
chmod +x scanCronScript.sh
# set script to be started on boot
############# wemo configuration
cd ~
mkdir wemo
cd wemo/
mkdir ouimeaux
cd ouimeaux
git clone https://github.com/iancmcc/ouimeaux.git
cd ouimeaux
cat setup.cfg
# config date to sync from ext server
#install wemo lib
sudo apt-get install python-setuptools python-dev
sudo python setup.py install
#test: wemo list
######### boot configuration
# node red
# start node red from menu: Programming-> NodeRED
#upgrade node and nodered
/usr/bin/update-nodejs-and-nodered
sudo systemctl enable nodered.service
# cron and wemo nodes installation
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install npm
sudo npm install -g npm@2.x
hash -r
cd ~/.node-red
npm install node-red-contrib-cron
npm install node-red-node-wemo
npm install node-red-contrib-firebase-storage
# reboot node red
# import node red flows from file:
# add BLE script to configuration
? sudo nano /etc/rc.local
# motion configuration
# install motion
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install motion
sudo chown motion:video /var/lib/motion
sudo vi /etc/motion/motion.conf
# change stream_localhost to on
# add Authentication
#add scan and reboot to cron Tab
sudo apt-get install gnome-schedule
crontab -e
# add:
# * * * * * /home/pi/dev/RPiScripts/scanCronScript.sh
# @reboot /home/pi/dev/RPiScripts/scanCronScript.sh
# 0 1 * * * /home/pi/dev/RPiScripts/rebootNodeRedScript.sh
sudo touch /var/log/scanner.txt
sudo chmod 777 /var/log/scanner.txt
# configure server side (e.g. bluemix) account
# configure NodeRED flows
# import basic flows from file: raspberryNodeRedFlows.json
# to add camera support - configure e-mail