-
Notifications
You must be signed in to change notification settings - Fork 0
/
connect.sh
executable file
·62 lines (54 loc) · 1.22 KB
/
connect.sh
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
#subscribe for topic for exact device
yc iot mqtt subscribe \
--debug \
--cert cert.pem \
--key key.pem \
--topic '$devices/are18v6krffaq7o1mldk/commands' \
--qos 1
#publish command for device
yc iot mqtt publish \
--debug \
--cert cert_1.pem \
--key key_1.pem \
--topic '$devices/are18v6krffaq7o1mldk/commands' \
--message 'Test next' \
--qos 1
yc iot mqtt publish \
--cert cert.pem \
--key key.pem \
--topic '$devices/are18v6krffaq7o1mldk/events' \
--message 'Test data' \
--qos 1
#sending command to device
mosquitto_pub -d -h mqtt.cloud.yandex.net \
-p 8883 \
--cafile rootCA.crt \
--cert cert_3.pem \
--key key_3.pem \
-t '$devices/arean1frk3n1vjugbnoq/commands' \
-m 'test command' \
-q 1
#sending data to register from device
mosquitto_pub -d -h mqtt.cloud.yandex.net \
-p 8883 \
--cafile rootCA.crt \
--cert cert.pem \
--key key.pem \
-t '$devices/aregq0ha5729atv7cv9n/events' \
-m 'test' \
-q 1
#subscribing for commands from device
mosquitto_sub -d -h mqtt.cloud.yandex.net \
-p 8883 \
--cafile rootCA.crt \
--cert cert.pem \
--key key.pem \
-t '$devices/arean1frk3n1vjugbnoq/commands' \
-q 1
openssl req -x509 \
-newkey rsa:4096 \
-keyout key_conveyer.pem \
-out cert_conveyer.pem \
-nodes \
-days 365 \
-subj '/CN=localhost'