Changes for page Monitor Gateway
Last modified by Xiaoling on 2022/07/14 15:37
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -11,59 +11,53 @@ 11 11 12 12 Monitor Gateway 13 13 14 - 15 15 = 2. Steps = 16 16 17 17 * Create account in ThingsSpeak and creat channel. 18 18 * Download script from dragino site and move it to properly directory 19 19 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']] 19 +{{{root@dragino-1baf44:~# wget 20 +Downloading ' 24 24 Connecting to 162.241.22.11:80 25 25 Writing to 'monitor_gateway.sh' 26 -monitor_gateway.sh ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~**|23 +monitor_gateway.sh 100% |*******************************| 1860 0:00:00 ETA 27 27 Download completed (1860 bytes) 28 -root@dragino-1baf44:~ ~# chmod +x monitor_gateway.sh;mv monitor_gateway.sh /usr/bin/29 -root@dragino-1baf44:~ ~#30 -root@dragino-1baf44:~ ~#31 - )))25 +root@dragino-1baf44:~# chmod +x monitor_gateway.sh;mv monitor_gateway.sh /usr/bin/ 26 +root@dragino-1baf44:~# 27 +root@dragino-1baf44:~# 28 +}}} 32 32 33 33 * change the script monitor_gateway.sh with properly users setting: 34 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 -))) 32 +{{{USER='xxxxx' # user name in your thinkspeak --> Profile 33 +PASS='xxxxx' #MQTT_API_KEY in your thinkspeak --> Profile 34 +}}} 40 40 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 -))) 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 +}}} 46 46 47 47 * run **/usr/bin/monitor_gateway.sh** to test if upload is good. 48 48 49 49 * 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 50 50 51 -(% class="box" %) 52 -((( 53 -# For details see man 4 crontabs 44 +{{{ # For details see man 4 crontabs 45 + 54 54 # Example of job definition: 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,sat47 +# .---------------- 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 60 60 # | | | | | 61 61 # * * * * * 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 -))) 66 66 55 +#*/10 * * * * checklog 56 + 57 +* 23 * * * /etc/init.d/auto_update start 58 +*/20 * * * * /usr/bin/monitor_gateway.sh 59 +}}} 60 + 67 67 * Reboot device. 68 68 69 69