-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInstalling.txt
392 lines (269 loc) · 14.4 KB
/
Installing.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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
-----------------------------------------------------------------------
This file contains :
Required actions to get communication with Toon setup.
Optional actions if you want vnc on Toon 1 or Toon 2
Optional actions if you want sftp on Toon, if not installed already
-----------------------------------------------------------------------
Required actions to get communication with Toon setup.
1) Enable ssh without passwords.
2) Copy reporting script to Toon.
All devices as already configured in ToonMonitor.conf will work.
Details are below.........
--- 1) Enable ssh without passwords.
You will enable passwordless ssh for root account to Toon.
A) On Domoticz host be root
sudo -i
B) generate keys
- ls ~/.ssh/id_rsapub
- when there is an id_rsapub file there, skip to step C because it would generate a new one.
( if already done before it will exit by default which is good )
ssh-keygen
( 4 x enter so no typing just enter, enter,...)
C) Copy public key to Toon
( change ToonIPAddress to your Toon IP address )
ssh-copy-id -i ~/.ssh/id_rsa.pub root@ToonIPAddress
like
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
( accept key offer and enter password which is most probably toon )
D) Test
( when it fails you may need to "Restore password" in menu on Toon and retry and maybe even try option F below )
ssh root@ToonIPAddress hostname
ssh root@ToonIPAddress
exit
ssh root@ToonIPAddress hostname
E) Leave root
exit
F) When the test failed even after "Restore password" on Toon.....
The ssh-copy-id of step C just needs to add the contents of the text file ~/.ssh/id_rsa.pub
into the file ~/.ssh/authorized_keys in the folder of root on your Toon.
So I started an ssh session to my toon and made sure there was this .ssh folder
- ssh root@toon
( enter password toon )
- ls .ssh
- when the folder is not there : mkdir .ssh
- cd .ssh
now in a different terminal window on Pi :
- cat ~/.ssh/id_rsa.pub
select all lines of the output with your mouse, right click and select copy
( might be 5 line looking like : ssh-rsa AAAAB3NzaC1yc2E.....Ibe3na88USFc= [email protected] )
now in the toon terminal where you are in the .ssh folder add the paste buffer to authorized keys :
- echo "<right mouse click and paste>" >> authorized_keys
like : echo "ssh-rsa AAAAB3NzaC1yc2E.....Ibe3na88USFc= [email protected]" >> authorized_keys
I did the test in D again and it worked :-)
However....
I had this issue on laptop running Ubuntu 22.04.1 LTS.
I still needed to enter a password. So in my ~/.ssh folder I created a file named config
and put in the next two lines and save the file :
HostKeyAlgorithms ssh-rsa
PubkeyAcceptedKeyTypes ssh-rsa
And later, on my laptop, I had this issue with github and added something more :
HostKeyAlgorithms ssh-rsa,ssh-ed25519
PubkeyAcceptedKeyTypes ssh-rsa,ssh-ed25519
Note on the actions above :
You can use this to any host you want to enable passwordless ssh/rsync/sftp/... to.
--- 2) Copy reporting script to Toon.
Okay, now you have passwordless access and are ready to put the reporting script in place and use it.
A) Copy file to Toon ( change ToonIPAddress to your Toon IP address ) :
sudo rcp /home/pi/domoticz/plugins/ToonMonitor/toon-performance.sh root@ToonIPAddress:toon-performance.sh
B) make script executable :
sudo ssh root@ToonIPAddress chmod +x toon-performance.sh
C) test
sudo ssh root@ToonIPAddress ./toon-performance.sh
Now things are ready for Domoticz.
Note :
The command you used for testing is also used by the plugin to get the data.
The command used to restart Toon :
ssh root@ToonIPAddress /sbin/init 6
The command used to restart the gui :
ssh root@ToonIPAddress /usr/bin/killall qt-gui
-----------------------------------------------------------------------
Optional actions if you want vnc on Toon 1 or Toon 2
Remember vnc on Toon 2 is view only but still handy for screenshots.
Note that Toon 1 is not a 8 CPU 8GB machine so everything takes a while....
On a Toon 1 be patient in the process below
The below does not only contain instructions but also some screen output I had
Commands to be entered are behind a # and are not always the same for Toon 1 and Toon 2
All you need to do is copy what is after the # signs and paste them on Toon
So you may read everything or skip to the #-es only ;-)
------------ VNC Server installation
Use putty or another ssh tool to logon to Toon
Check if x11vnc is installed :
# which x11vnc
When it is there you may want to reset the password.
See the section Reset vnc password at the end of this instruction.
When there is nothing returned you can install x11vnc so continue
---- Update repositories
To be able to install x11vnc we need to update first.
To be able to install or update we need to open a vpn.
Open the vpn
( safe according to https://www.domoticaforum.eu/viewtopic.php?t=12919 )
# sh update-rooted.sh -o
( and give the right answers to continue executing the script like : yes, yes )
Only start VPN and then quit
Now starting the VPN tunnel and waiting for it to be alive and configured...
Now starting the VPN tunnel and waiting for it to be alive and configured...
Tunnel is alive and configured.
>> configured opkg feeds:
src/gz base http://feed.hae.int/feeds/qb2/uni/5.33.9
src/gz oe-2.6.36-R10-h28-cmpxchg64 http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/2.6.36-R10-h28-cmpxchg64
src/gz oe-2.6.36-base-r17-splash2 http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/2.6.36-base-r17-splash2
src/gz oe-all http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/all
src/gz oe-armv5e http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/armv5e
src/gz oe-quby2 http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/quby2
VPN is started, OPKG sources should now be available for you. Good luck!
If you are done with manual package downloading, just reboot and the VPN should be closed again.
NOTE the last line above that after installation we need to reboot to close the VPN.
Now the VPN is open we can update.
# opkg update
Downloading http://feed.hae.int/feeds/qb2/uni/5.33.9/Packages.gz.
Inflating http://feed.hae.int/feeds/qb2/uni/5.33.9/Packages.gz.
Updated list of available packages in /var/lib/opkg/base.
Downloading http://feed.hae.int/feeds/qb2/uni/5.33.9/Packages.sig.
Signature check passed.
Downloading http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/2.6.36-R10-h28-cmpxchg64/Packages.gz.
Inflating http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/2.6.36-R10-h28-cmpxchg64/Packages.gz.
Updated list of available packages in /var/lib/opkg/oe-2.6.36-R10-h28-cmpxchg64.
Downloading http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/2.6.36-R10-h28-cmpxchg64/Packages.sig.
Signature check passed.
Downloading http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/2.6.36-base-r17-splash2/Packages.gz.
Inflating http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/2.6.36-base-r17-splash2/Packages.gz.
Updated list of available packages in /var/lib/opkg/oe-2.6.36-base-r17-splash2.
Downloading http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/2.6.36-base-r17-splash2/Packages.sig.
Signature check passed.
Downloading http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/all/Packages.gz.
Inflating http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/all/Packages.gz.
Updated list of available packages in /var/lib/opkg/oe-all.
Downloading http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/all/Packages.sig.
Signature check passed.
Downloading http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/armv5e/Packages.gz.
Inflating http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/armv5e/Packages.gz.
Updated list of available packages in /var/lib/opkg/oe-armv5e.
Downloading http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/armv5e/Packages.sig.
Signature check passed.
Downloading http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/quby2/Packages.gz.
Inflating http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/quby2/Packages.gz.
Updated list of available packages in /var/lib/opkg/oe-quby2.
Downloading http://feed.hae.int/feeds/qb2/oe/angelica-1.6.0-master-psplash-curl/quby2/Packages.sig.
Signature check passed.
---- Find out which version we need to install
The x11vnc version depends on the ssl version.
So check openssl version :
# openssl version
OpenSSL 1.0.2p 14 Aug 2018
Newer fw versions with openssl 1.0.2h and later will need r3, older ones use r0.
---- Method 1 ( if it does not work use Method 2 )
Depending on your fw version download the file you need for r0 or r3 :
# opkg install http://files.domoticaforum.eu/uploads/Toon/ipk/qb2/x11vnc_0.9.13-r0_qb2.ipk
or
# opkg install http://files.domoticaforum.eu/uploads/Toon/ipk/qb2/x11vnc_0.9.13-r3_qb2.ipk
Skip Method 2 and go to 'Check installation'
---- Method 2 if Method 1 does not work.
Download your installer package :
Start web browser for http://files.domoticaforum.eu/index.php?cam=
Scroll down to the bottom of the page and select : Toon > ipkg > qb2
Depending on your fw version download the file you need for r0 or r3 :
x11vnc_0.9.13-r0_qb2.ipk OR x11vnc_0.9.13-r3_qb2.ipk
Create the folder /root/downloads on Toon
On Toon :
# mkdir download
On your host :
# sudo rcp your-file root@ToonIPAddress:/root/downloads/your-file
On Toon :
# cd downloads
# opkg install x11vnc_0.9.13-r3_qb2.ipk
Installing x11vnc (0.9.13-r3) to root...
Multiple replacers for glibc, using first one (libc6).
Multiple replacers for zlib, using first one (libz1).
Multiple replacers for jpeg, using first one (libjpeg8).
Multiple replacers for jpeg, using first one (libjpeg8).
Configuring x11vnc.
---- Check installation
# which x11vnc
/usr/bin/x11vnc
Setup x11vnc and DO NOT FORGET the password you enter here.
(Forgot password ? : delete /root/.vnc/passwd and do the next again )
For Toon 1 : # x11vnc
For Toon 2 : # x11vnc -storepasswd
Enter VNC password:
Verify password:
Write password to /root/.vnc/passwd? [y]/n
Password written to: /root/.vnc/passwd
:
lost and lots of text
:
The SSL VNC desktop is: eneco-001-338271:0
PORT=5900
SSLPORT=5900
---- Configure firewall
You need to put the next line :
-A HCB-INPUT -p tcp -m tcp --dport 5900 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
in the file /etc/default/iptables.conf
You may use a tool like FileZilla to edit or use the instructions on joe below
# joe /etc/default/iptables.conf
press arrow down until you are on the beginning of the line below the --dport 22
press enter and enter the line with --dport 5900 like below :
-A HCB-INPUT -p tcp -m tcp --dport 22 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A HCB-INPUT -p tcp -m tcp --dport 5900 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A HCB-INPUT -p tcp -m tcp --dport 10080 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
to save the file press Ctrl-KX
File /etc/default/iptables.conf saved.
---- Activate firewall rules
You can activate the firewall rules by restarting the firewall like :
# /etc/init.d/iptables restart
or since we also need to close the VPN just reboot :
# init 6
After reboot there was an Eneco message on my Toon which I think was caused by opening the vpn.
---- start x11vnc
ssh to toon and start x11vnc :
For Toon 1 : # x11vnc
For Toon 2 a long one : # x11vnc -forever -shared -rawfb map:/dev/fb0@1024x600x32 -usepw -pipeinput UINPUT:touch,touch_always=1,abs,pressure=128,direct_abs=/dev/input/event0,direct_btn=/dev/input/event0,direct_rel=/devinput/event0,direct_key=/dev/input/event0,nouinput
The SSL VNC desktop is: eneco-001-338271:0
PORT=5900
SSLPORT=5900
Since vnc was configured before no questions are asked
---- stop x11vnc
For Toon 1 : # ps | grep x11vnc
For Toon 2 : # ps -ef | grep x11vnc
For Toon 1 : # killall x11vnc-bin
For Toon 2 : # killall x11vnc
For Toon 1 : # ps | grep x11vnc
For Toon 2 : # ps -ef | grep x11vnc
---- VNC Client Linux
Install the TigerVNC which is available for your distribution. I use Lubuntu with xfce and it was in my Discover tool.
I copied /root/.vnc/passwd from Toon to my home folder on my linux laptop where I installed tigervncviewer.
Now I can use the next command to start tigervnc and it will access toon without me having to enter the vnc password.
/usr/bin/xtigervncviewer -passwd /home/jack/passwd toon-ip-address
I use the same VNC password on all my Toons so I have only 1 passwd file in my home folder which works for all of them.
---- VNC Client Windows
On Windows install tigervnc
Download windows version from https://tigervnc.en.lo4d.com/windows
use TigerVNC to connect.
---- VNC Client Android
install bVNC app
use bVNC app to connect
----------------------------------------------------------------------
Optional actions if you want sftp on Toon 2
---- Method 1 ( if it does not work use Method 2 )
ssh to your Toon and
# opkg install http://files.domoticaforum.eu/index.php?cam=/Toon/ipk/cortexa9hf-vfp-neon/openssh-sftp-server_6.7p1-r0_cortexa9hf-vfp-neon.ipk
Skip Method 2 and go to 'Check installation'
---- Method 2 if Method 1 does not work.
Download your installer package :
Start web browser for :
http://files.domoticaforum.eu/index.php?cam=/Toon/ipk/cortexa9hf-vfp-neon
Download openssh-sftp-server_6.7p1-r0_cortexa9hf-vfp-neon.ipk
Create the folder /root/downloads on Toon
On Toon :
# mkdir download
On your host :
# sudo openssh-sftp-server_6.7p1-r0_cortexa9hf-vfp-neon.ipk root@ToonIPAddress:/root/downloads/openssh-sftp-server_6.7p1-r0_cortexa9hf-vfp-neon.ipk
On Toon :
# cd downloads
# opkg install openssh-sftp-server_6.7p1-r0_cortexa9hf-vfp-neon.ipk
---- Check installation
# ls -l /usr/lib/openssh/sftp-server
---- Use sftp
There is no need to create a seperate entry in /etc/inittab or in the /etc/rc* directories
dropbear was installed during rooting and dropbear will start an sftp server when needed
Just use FileZilla or any other sftp client to access your Toon.
----------------------------------------------------------------------