Monitor Gateway

Introduction

This introduction shows how to use a script to monitor the gateway. The video link for this instruction is: https://youtu.be/8PieIwfSF_g

https://wiki.dragino.com/images/thumb/d/dc/Monitor_gateway.png/600px-Monitor_gateway.png

Steps

  • Create account in ThingsSpeak and creat channel.
  • Download script from dragino site and move it to properly directory

root@dragino-1baf44:~# wget http://www.dragino.com/downloads/downloads/LoRa_Gateway/LPS8/Firmware/customized_script/monitor_gateway.sh
Downloading 'http://www.dragino.com/downloads/downloads/LoRa_Gateway/LPS8/Firmware/customized_script/monitor_gateway.sh'
Connecting to 162.241.22.11:80
Writing to 'monitor_gateway.sh'
monitor_gateway.sh   100% |*******************************|  1860   0:00:00 ETA
Download completed (1860 bytes)
root@dragino-1baf44:~# chmod +x monitor_gateway.sh;mv monitor_gateway.sh /usr/bin/
root@dragino-1baf44:~#
root@dragino-1baf44:~#

  • change the script monitor_gateway.sh with properly users setting:

USER='xxxxx'             # user name in your thinkspeak --> Profile
PASS='xxxxx'     #MQTT_API_KEY in your thinkspeak --> Profile

CHAN_ID='xxxx'    #Channel ID   of the channel for this gateway
CHAN_KEY='xxxxx'   #Channel Write API  of the channel for this gateway

  • run /usr/bin/monitor_gateway.sh to test if upload is good.
  • 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

  # For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed

#*/10 * * * *  checklog

* 23 * * *  /etc/init.d/auto_update start
*/20 * * * *  /usr/bin/monitor_gateway.sh      

  • Reboot device.

Monitor Public IP

The monitor_gateway.sh has been updated to upload the public ip of the device as well.

User can find the public ip in field7, the chart is not able to show the complete public ip, user can check that in the export.

https://wiki.dragino.com/images/thumb/8/8f/Monitor_gateway_1.png/600px-Monitor_gateway_1.png

Find Public IP

Remote Access

Remote Access via Remote.it.

Remote.it for remote access is available in the latest Dragino firmware for gateway. For security concern, the remote.it only available base on end user demand.

Important Notice:

  • Remote.it access will give full control of your device to remote support.
  • The Remote.it allow Dragino Support to remote access to the device, If user want to access himself, it need to sign up for an remote.it account.

For how to use remoteit, please see : Remoteit user instruction for Dragino Gateway.

RSSH Introduction

Reverse SSH for remote access is available in the latest Dragino firmware for gateway. For security concern, the RSSH only available base on end user demand.

Important Notice:

RSSH access will give full control of your device to remote support. Please remove sensitivity info before perform this
This RSSH allow Dragino Support to remote access to the device, If user want to access himself, he need to set up the RSSH server himself.

Below gateway support reverse SSH access:

  • Firmware Version > lgw--build-v5.4.1618196981-20210412-1111 Firmware Download
  • LG01N, OLG01N (Note: LG01-P LG01-S doesn't support)
  • LG02, OLG02
  • LG308, DLOS8
  • LPS8
  • LIG16
  • MS14 series if installed with the same firmware.

End User Guide to use SSH access

Go to this the Reverse SSH page as below:

https://wiki.dragino.com/images/thumb/5/55/RSSH_Menu2.png/500px-RSSH_Menu2.png

Get the RSSH configure page

https://wiki.dragino.com/images/thumb/7/78/RSSH_Menu3.png/500px-RSSH_Menu3.png

Connection OK.

  • Login ID: Input sshuser
  • Host Address: Input support.dragino.com
  • Host Port : Please email to support @ dragino.com to get a valid host port.
  • Connect at Startup : Choose to enable connect once the device is powered.
  • Network Keys; Click the Generate keys to generate the keys and download / mail it to Dragino support so Dragino can prepare the remote access to

After doing above, please download and mail the public keys to Dragino support and wait for our mail for the valid host port. Input the valid host port got from our support and click connect so we can remote access to your gateway.

Set Up RSSH Server

Step 1:Download the SSH service code

1).git clone https://github.com/dragino/rssh-server.git rssh-server

https://wiki.dragino.com/images/thumb/d/d0/Git_clone.png/500px-Git_clone.png

git clone rssh-server

2).cd rssh-server; sudo make ---> to Generate the execute file:rssh_serv

https://wiki.dragino.com/images/thumb/e/e3/Generate_the_execute_file.png/500px-Generate_the_execute_file.png

Generate the execute file

Debug :

 if you git fail.     -->    sudo: git: command not found. 
 please install git.  -->    yum install git -y  or  apt-get install git -y. 
 if you make error 127,it lack of gcc. 
 please install gcc.    -->yum install gcc.

https://wiki.dragino.com/images/d/d7/Lack_of_gcc.png

lack of gcc

 if you make a fatal error : sqlite3.h,it lack of sqlite3. 
 please insatell sqlite3.

https://wiki.dragino.com/images/thumb/9/93/Lack_of_sqlite3.png/500px-Lack_of_sqlite3.png

lack of sqlite3

How to install Sqlit3

 Step1:Download the SQLit3 installation package
           sudo wget 
 Step2:tar the SQLit3 installation package
           sudo tar -zxvf sqlite-autoconf-3350300.tar.gz
 Step3:Generate the makefile
           cd sqlite-autoconf-3350300/;./configure
 Step4:Compile makefile
           sudo make
 Step5:Install makefile
           sudo make install
 Check:
           cd /usr/local/bin;ls -al                             -->    Check to see if there is a file for sqlite3
           cd sqlite-autoconf-3350300/;./sqlite3 test.db        -->    Test whether the sqlite3 was installed successfully
 debug:
          If you get the imformation that is SQLite header and source version mismatch, when you execute./sqlite3 test.db.
          Please execute the command /sbin/ldconfig.
          After that execute the command ./sqlite3 test.db again.

 

Tags:
    
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0