IoT Open Basic

Basic course for IoT Open developers and integrators.


Chapter 8

“It would be really nice with some cosy relevant quote here!”
― IoT Open Developer

Lynx-bash-scripts

The lynx-bash-scripts is a collection of simple scripts that was created over time when working with the platform. They are a very easy way to quick exploring the API if IoT Open.

Get the scripts

There is a link to the scrips on this page under the Resources -> Software section. If you use the IoT Open Virtual appliance you can type bash setup-lynx-scripts.sh in the home directory of the iot user.

Installing

Se above about how to get the scripts. Once they are installed you need to create a .config file in the same directory as the scripts. It should look like this.

USERNAME=<email address>
PASS=<password>

BROKER=lynx.iotopen.se
BASE=https://lynx.iotopen.se

TOKEN=`cat .token`

Getting started

Login to the backend.

iot@iot-open:~/lynx-bash-scripts$ ./login.sh 
Loggin in
Login successful

After that you can try all the scripts out. E.g. get a list of you installations.

./get_installations.sh

Try the other ones out as well. Since they are simple bash-scripts you can always look at them and see what they does.

Example. Get the functions of an installation with ./get_functions.sh <installation_id>. You can list all the scripts with ls.

Exercise

Try some of the scripts out.