Changes for page Monitor Gateway

Last modified by Xiaoling on 2022/07/14 15:37

From version 1.2
edited by Xiaoling
on 2022/05/12 15:13
Change comment: There is no comment for this version
To version 1.3
edited by Xiaoling
on 2022/05/12 15:24
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -11,53 +11,59 @@
11 11  
12 12  Monitor Gateway
13 13  
14 +
14 14  = 2. Steps =
15 15  
16 16  * Create account in ThingsSpeak and creat channel.
17 17  * Download script from dragino site and move it to properly directory
18 18  
19 -{{{root@dragino-1baf44:~# wget
20 -Downloading '
20 +(% class="box" %)
21 +(((
22 +root@dragino-1baf44:~~# wget [[http:~~/~~/www.dragino.com/downloads/downloads/LoRa_Gateway/LPS8/Firmware/customized_script/monitor_gateway.sh>>url:http://www.dragino.com/downloads/downloads/LoRa_Gateway/LPS8/Firmware/customized_script/monitor_gateway.sh]]
23 +Downloading '[[http:~~/~~/www.dragino.com/downloads/downloads/LoRa_Gateway/LPS8/Firmware/customized_script/monitor_gateway.sh'>>url:http://www.dragino.com/downloads/downloads/LoRa_Gateway/LPS8/Firmware/customized_script/monitor_gateway.sh']]
21 21  Connecting to 162.241.22.11:80
22 22  Writing to 'monitor_gateway.sh'
23 -monitor_gateway.sh 100% |*******************************| 1860 0:00:00 ETA
26 +monitor_gateway.sh   100% |~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~**|  1860   0:00:00 ETA
24 24  Download completed (1860 bytes)
25 -root@dragino-1baf44:~# chmod +x monitor_gateway.sh;mv monitor_gateway.sh /usr/bin/
26 -root@dragino-1baf44:~#
27 -root@dragino-1baf44:~#
28 -}}}
28 +root@dragino-1baf44:~~# chmod +x monitor_gateway.sh;mv monitor_gateway.sh /usr/bin/
29 +root@dragino-1baf44:~~#
30 +root@dragino-1baf44:~~#
31 +)))
29 29  
30 30  * change the script monitor_gateway.sh with properly users setting:
31 31  
32 -{{{USER='xxxxx' # user name in your thinkspeak --> Profile
33 -PASS='xxxxx' #MQTT_API_KEY in your thinkspeak --> Profile
34 -}}}
35 +(% class="box" %)
36 +(((
37 +USER='xxxxx'             # user name in your thinkspeak ~-~-> Profile
38 +PASS='xxxxx'     #MQTT_API_KEY in your thinkspeak ~-~-> Profile
39 +)))
35 35  
36 -{{{CHAN_ID='xxxx' #Channel ID of the channel for this gateway
37 -CHAN_KEY='xxxxx' #Channel Write API of the channel for this gateway
38 -}}}
41 +(% class="box" %)
42 +(((
43 +CHAN_ID='xxxx'    #Channel ID   of the channel for this gateway
44 +CHAN_KEY='xxxxx'   #Channel Write API  of the channel for this gateway
45 +)))
39 39  
40 40  * run **/usr/bin/monitor_gateway.sh** to test if upload is good.
41 41  
42 42  * Add monitor_gateway.sh to cron work **/etc/crontabs/root** to make this script runs perdiocally, below is an example to update every 20 minutes
43 43  
44 -{{{ # For details see man 4 crontabs
45 -
51 +(% class="box" %)
52 +(((
53 +# For details see man 4 crontabs
46 46  # Example of job definition:
47 -# .---------------- minute (0 - 59)
48 -# | .------------- hour (0 - 23)
49 -# | | .---------- day of month (1 - 31)
50 -# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
51 -# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
55 +# .~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- minute (0 - 59)
56 +# | .~-~-~-~-~-~-~-~-~-~-~-~-- hour (0 - 23)
57 +# | | .~-~-~-~-~-~-~-~-~-~- day of month (1 - 31)
58 +# | | | .~-~-~-~-~-~-- month (1 - 12) OR jan,feb,mar,apr ...
59 +# | | | | .~-~-~-~- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
52 52  # | | | | |
53 53  # * * * * * user-name command to be executed
62 +#*/10 * * * *  checklog
63 +~* 23 * * *  /etc/init.d/auto_update start
64 +*/20 * * * *  /usr/bin/monitor_gateway.sh
65 +)))
54 54  
55 -#*/10 * * * * checklog
56 -
57 -* 23 * * * /etc/init.d/auto_update start
58 -*/20 * * * * /usr/bin/monitor_gateway.sh
59 -}}}
60 -
61 61  * Reboot device.
62 62  
63 63