Introduction

The LORIX One gateway is pre-installed with few cloud client applications. 

There is actually the following one:

Each of these scripts have a init script which can be used to start, stop of get actual status of the application.

However, since only one of them can be used at a time, the LORIX One gateway proposes a nice script to manage and choose the application you want to use by default. It allows as well to start automatically the selected application at boot time.

Configuration and usage

Status

The clouds-manager script can be used to retrieve the actual status of the selected cloud client. To get this status, you can simply use the script as follow:

$ sudo /etc/init.d/clouds-manager.sh status
CODE

The result on a stopped application cloud (with LORIOT selected):

$ sudo /etc/init.d/clouds-manager.sh status
Cloud loriot status:
/opt/lorix/clouds/loriot/loriot-gw is stopped
CODE

And on a running instance:

$ sudo /etc/init.d/clouds-manager.sh status
Cloud loriot status:
/opt/lorix/clouds/loriot/loriot-gw (pid 969) is running...
CODE

Start/stop

The clouds-manager scripts allows to start or stop the selected cloud client. To start, stop or restart, you can simple use the script as follow:

$ sudo /etc/init.d/clouds-manager.sh start 
Password: [enter your password here]
Cloud loriot already running, abort.
$ sudo /etc/init.d/clouds-manager.sh restart
Stopping cloud loriot... stopped /opt/lorix/clouds/loriot/loriot-gw (pid 969)
done.
Starting cloud loriot... done.
$ sudo /etc/init.d/clouds-manager.sh stop 
Stopping cloud loriot... stopped /opt/lorix/clouds/loriot/loriot-gw (pid 1043)
done.
CODE

Configuration

The main goal of this cloud manager script is really to select which one of the available client you would like to use and to allow the possibility of automatic start at boot time.

By default, the LORIX One is configured to use the LORIOT client application and to start it at boot time.

Before modifying the parameters, you must stop the actual running cloud if any using the stop command:

$ sudo /etc/init.d/clouds-manager.sh stop
Stopping cloud loriot... stopped /opt/lorix/clouds/loriot/loriot-gw (pid 1104)
done.
CODE

You can modify these parameters by using the script as follow:

$ sudo /etc/init.d/clouds-manager.sh configure
==========================================
| LORIX One clouds manager configuration |
==========================================
Actual configuration:
 autostart=false
 cloud=loriot
Do you want to enable autostart at boot time?
[Yes|No]
 > yes
Which cloud app. do you want to use ?
[loriot|packet-forwarder|ttn]
 > loriot
New configuration:
 autostart=true
 cloud=loriot
CODE

After modified the parameters as you wish, you can then start the chosen cloud client simply using the start argument with the clouds manager script.

Debugging client cloud applications

The clouds manager script is really useful to standard and production usage once the parameters are fine. It really simplify the way to manage various clouds however, because the maximum is hidden, it's not really convenient for debugging step. 

The following pages give more details to test the LoRa RF interface using available tools and configure and test each cloud application before passing in production configure.

Clouds pages:

Log output for packet-forwarders

It's sometimes useful to retrieve log output of the packet-forwarder after an issue. For each of the client cloud above, it's possible to activate this log system by modifying their respective init script.

Before you begin

Be sure you have correctly stopped any running packet forwarder running the clouds-manager.sh as described above. Once all are stopped, select the right forwarder also using this script with configure argument.

Enable log redirection

Modify the init script

Each of these forwarders have  their own startup script (itself called by the clouds-manager.sh script) and are located:

  • LORIOT
    /etc/init.d/loriot-gw
  • Semtech packet-forwarder
    /etc/init.d/packet-forwarder-gw
  • TTN (The Things Network) packet-forwarder
    /etc/init.d/ttn-gw


Once the correct init script selected, you can uncomment the following line :

#LOGFILE=$LOGDIR/.log
CODE

It will redirect the log output of the corresponding cloud client to a log file at the next startup.

Enable log rotation

Please take note that the resultant log file will grow quickly since all the log information are redirected to it. It's then highly recommended to enable log rotating on this file if logging is enabled otherwise the gateway could quickly be unusable due to memory overflow.