-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathinstall.txt
214 lines (139 loc) · 5.61 KB
/
install.txt
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
/////////////////////////
// Config raspberry pi //
/////////////////////////
//download Raspbian “wheezy” from http://www.raspberrypi.org/downloads
use raspi-config to
- expand_rootfs -> expand root partition
- change_pass -> change password for "pi" user
- change_timezone
- configure_keyboards
- boot-behavior -> don't start desktop on boot
//use a keyboard and monitor on your raspberry or connect from your PC with a SSH Client (http://www.putty.org/)
//you should change the default password of the pi user
$passwd
//you can also add a new user and enable this user with sudo privileges
$sudo adduser username
$sudo nano /etc/group
//Install apache,git and screen (http://raspi.tv/2012/using-screen-with-raspberry-pi-to-avoid-leaving-ssh-sessions-open)
$sudo apt-get update
$sudo apt-get install apache2
$sudo apt-get install git
$sudo apt-get install screen (screen bash ; ctrl a,d - run app in additional terminal)
//////////////////////////////////////////////////////////
// connect the raspberry pi to a wLAN //
//////////////////////////////////////////////////////////
// A wifi connection is not needed to run ecpiww. //
// If you want to run the raspberry connected via LAN //
// or with monitor and keyboard you can skip this step. //
//////////////////////////////////////////////////////////
// if you have connected a monitor and keyboard to your raspberry
// - start the GUI with startx
// - use wpa_gui to setup the WLAN access (http://learn.adafruit.com/adafruits-raspberry-pi-lesson-3-network-setup/setting-up-wifi-with-raspbian)
// or use the following info to configure it via LAN with SSH
//list all USB Devices
$lsusb
//list WLans
$iwlist wlan0 scan
//create a config file: mywpa.config
$ sudo nano /etc/mywpa.config
Now enter the following, save the file and exit back to the $ prompt (<Ctrl> O, <Ctrl< X)
network={
ssid="MyWLAN"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="MyKey"
}
//change your interface file to
$ sudo nano /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/mywpa.config
iface default inet dhcp
//shutdown your raspberry and disconnect your LAN cable
$sudo shutdown -h now
//check your WLAN Router for the new IP Adress and connect with putty
/////////////////////////////
// compile and run ecpiww //
/////////////////////////////
//get ecpiww source
$mkdir projects
$cd projects
$git clone https://github.com/ffcrg/ecpiww.git
$cd ecpiww
//copy websource to var/www
$chmod u+x cpwww.sh
$./cpwww.sh
//run make file
$cd linux/bin
$make -f mkfile
/////////////////////////////////////////////////////////////////////
// run App as root ; App writes per default a csv file to /var/www //
////////////////////////////////////////////////////////////////////
$screen bash
$sudo ./ecpiww (this starts the app with the defaults: T2 Mode, USB Port 0 and logging to CSV)
The App shows you the different options:
Usage
s : Use S2 Mode
t : Use T2 Mode
a : Add Meter
r : Remove Meter
l : List Meters
u : Update - Check for data
q : Quit
You can add your EnergyCams as Meter by pressing <a>:
Adding Meter #1
Enter Meter Ident (12345678): -> You have to enter the 8 digits of the MBUS ID
Enter Meter Type (2 = Electricity ; 3 = Gas ; 7 = Water) : -> <2> for an Electricity Meter
Enter Key (0 = Zero ; 1 = Default ; 2 = Enter the 16 Bytes) : -> You can select/configure the encryption
Press <Ctrl a> <d> brings you back to the terminal.
//you can view the created csv Files with
sudo nano /var/www/ecpiww/data/ecpiwwM1.csv
sudo nano /var/www/ecpiww/data/ecpiwwM2.csv
sudo nano /var/www/ecpiww/data/ecpiwwM3.csv
//reconnect to ecpi
$screen -r
//close ssh session ; ecpiww continues to run
$exit
//open website from your PC
//type the IP Adress of your raspberry into the adress bar of the browser
//////////////////////////////////////
// run App with commandline options //
//////////////////////////////////////
$./ecpiww -f /home/user/ecdata -p 0 -m S -l XML
-f <dir> : save dat file or XML file to <dir>/<wMBUS Ident>.dat <dir>/<wMBUS Ident>.xml ; these files can be parsed to feed the data to other apps
-p 0 : Portnumber 0 -> /dev/ttyUSB0 is used to search for the USB Stick
-m S : S2 Mode -> use S2 Mode - default is T2
-l VZ : log to (VZ)Volkszähler, (XML) XMLFile, (CSV) CSV File, (DAT) Datfile
////////////////////////////////
// -l VZ : log to Volkszähler //
////////////////////////////////
// to install volkszähler
//see http://wiki.volkszaehler.org/software/middleware/installation
////////////////////////////
// connect to volkszähler //
////////////////////////////
//see: http://wiki.volkszaehler.org/software/clients/vzclient
//Install vzclient
$wget https://raw.github.com/volkszaehler/volkszaehler.org/master/misc/tools/vzclient
$sudo cp vzclient /usr/local/bin/vzclient
$sudo chmod 555 /usr/local/bin/vzclient
$chmod u+x ecpiww/linux/bin/add2zv.sh
//config /etc/vzclient.conf ; you have to enter the IP adress of your volkszähler PC
$sudo nano /etc/vzclient.conf
[default]
url:http://192.168.0.110/middleware.php
//create new channel in the UI
- Add Channel
Typ: Stromzaehler
Auflösung: 1000
Preis: 0.00028
- press info button in the UI
copy UUID-String
enter UUID-String into ecpiww/linux/bin/add2zv.sh with the corresponding meterindex
vzclient -u <UUID> add data value=$1