Gateway

Reference Manual

Gateway

Reference Manual


Contents

​1.​ Overview  3

​1.1.​ Supported models  3

​2.​ Configuration files  4

​2.1.​ Service configuration  4

​2.2.​ Subscribe configuration  10

​2.3.​ Scheduler configuration  12

​2.4.​ LTE configuration  14

​3.​ IQRF network topic message payloads  16

​4.​ MQTT control topic message payloads  19

​4.1.​ Gateway info  19

​4.2.​ Ping  22

​4.3.​ 4.3.Reset RF module  23

​4.4.​ Restart unid service  24

​4.5.​ Reboot gateway  25

​4.6.​ File manager  26

​4.7.​ Run scripts  30

​4.8.​ Scheduler pause  31

​4.9.​ Scheduler force resume  32

​4.10.​ Scheduler info  33

​5.​ Application message payloads  34

​6.​ Appendix  35

​6.1.​ Status messages  35

​6.2.​ QoS - Quality of Service  36

​6.3.​ Cron expression  36

​6.4.​ Topics  37

​6.5.​ Location information  38

​6.8.​ MQTT payload string content  39

​6.9.​ Login  39

​6.10.​ LTE RSSI value  40

​6.11.​ Ports  41


​1.​ Overview

This reference manual targets application developers. It provides complete information on how to configure and use the GW-UNI-01 and GW-IND-01 gateway families communication protocol and communication interfaces.

The communication protocol is based on the gateway main service (unid) form version 2.0.0.

​1.1.​ Supported models

The table below shows the list of supported devices devices which implement protocol described in this document. The table contains the Model ID, the product name and the main features.

Model ID

Product name

ETH

4G/LTE

GPS

GW-UNI-01

Universal Gateway

GW-IND-01

Industrial Gateway with Ethernet connection

GW-IND-01-4GO

Industrial with 4G support only

GW-IND-01-4G

Industrial with Ethernet + 4G/LTE connection

GW-IND-01-4GL

Industrial with Ethernet + 4G & GPS support

GW-IND-01-4GLO

Industrial with 4G & GPS support only


​2.​ Configuration files

The configuration files determines the operation of the gateway.

CAUTION!

The device can become inoperable cause the improper configuration!

​2.1.​ Service configuration

Configuration file path: /etc/unid/conf.s0/unid.conf

Name

Type

Default value

Options

Description

service

enable_netbios

Boolean

true

Enable/Disable NetBIOS service

enable_restart

Boolean

true

Enable/Disable service restart

enable_reboot

Boolean

true

Enable/Disable gateway reboot

loglevel

Number

1

0

Error and

Warning

Daemon logging level

1

Information

2

Debug

3

Trace

service > logsource

iqrf

Boolean

true

Enable/Disable log messages

mqtt

Boolean

true

Enable/Disable log messages

control

Boolean

true

Enable/Disable log messages

scheduler

Boolean

true

Enable/Disable log messages

iqrfide_interface

Boolean

true

Enable/Disable log messages

application_interface

Boolean

true

Enable/Disable log messages

mqtt

enable

Boolean

true

Enable/Disable MQTT service

host

String

mqtt.iqhome.org

Hostname or IP address of the MQTT broker

port

Number

1883

MQTT Broker service port

username

String

null

Username

password

String

null

Password

clientid_source

String

auto

auto

Set client ID automatically

Client ID source select

manual

Custom string

clientid

String

serial

custom

Custom string for manual clientid_source

Client ID used by the MQTT service and further can be used to insert this id into topic names

serial

Serial number of the gateway

mid

MID of the attached IQRF modul

hostname

Hostname of the device

keepalive_interval_sec

Number

60

The number of seconds after which the broker should send a PING message

to the client if no other messages have been exchanged in that time

cleansession

Boolean

true

Set to true to instruct the broker to clean all messages and subscriptions on disconnect,

false to instruct it to keep them

version

String

mqtt31

mqtt31

MQTT v3.1

MQTT protocol version

mqtt311

MQTT v3.1.1

will_topic

String

null

The topic on which to publish the will

will_payload

String

null

The will message

will_qos

Number

0

The quality of service for will messages

will_retain

Boolean

false

Set to true to make the will a retained message

subconf_path

String

/etc/unid/conf.s0/subscribe.conf

File path with predefined topics for subscribe

queue_size

Number

1000

1-65535

MQTT publish queue size for network messages

queue_overwrite

Boolean

true

Enable/Disable queue to overwrite the oldest item when the queue is full

mqtt > tls

enable

Boolean

Enable/Disable Transport Layer Security (TLS)

type

String

ca_signed

ca_signed

CA signed server certificates

TLS type

ca_file

CA certificate file

self_signed

Self-signed certificates

capath

String

/etc/ssl/certs

Certificate folder path for CA signed server certificates

cafile

String

/etc/unid/conf.k0/rootCA.pem

CA certificate file path

keyfile

String

/etc/unid/conf.k0/private.pem.key

Self-signed certificate private key file path

certfile

String

/etc/unid/conf.k0/certificate.pem.crt

Self-signed certificate file path

version

String

tlsv1.2

tlsv1

TLS v1.0

TLS version

tlsv1.1

TLS v1.1

tlsv1.2

TLS v1.2

verify_hostname

Boolean

true

Configure verification of the server hostname in the server certificate

This can be useful to disable in initial server testing but must be set to "true" in a real system!

scheduler

enable

Boolean

true

Enable scheduler service

iqrfide_interface

enable

Boolean

true

Enable/Disable IQRF IDE access.

port

Number

55300

IQRF IDE port.

reset_module

Boolean

true

Enable/Disable TR module reset from IDE

reset_gateway

Boolean

true

Enable/Disable gateway reset from IDE

application_interface

enable

Boolean

false

Enable/Disable UDP application Interface

port_listen

Number

55001

User Network Interface service port.

port_send

Number

55000

User Network Interface service port.

enable_remote_access

Boolean

false

Enable access by other devices on the network.

filemanager

enable_download

Boolean

true

Enable/Disable remote access for download (read) files in the service folders.

enable_upload

Boolean

true

Enable/Disable remote access for upload (write) files in the service folders.

enable_create

Boolean

true

Enable/Disable remote access for create files in the service folders.

enable_remove

Boolean

true

Enable/Disable remote access for remove files in the service folders.

script

enable_exec

Boolean

true

Enable/Disable remote execute scripts in the service folder

user

String

dsu

Username of the scipts owner. The scripts are executed with the permissions of this user.

max_exectime_sec

Number

30

Max execute time for each script in seconds.

iqrf

queue_size

Number

100

1-65535

RF network request queue size

queue_overwrite

Boolean

true

Enable/Disable queue to overwrite the oldest item when the queue is full

queue_maxpriority

Number

0

0-255

Number of max priority level.

e.g.: 2 → priority levels: 0,1,2

timeout_coordinator_sec

Number

90

Timeout in seconds for coordinator requests: Bonding, FRC

timeout_node_sec

Number

5

Timeout in seconds for every nodes

frc_extraresult_autorequest

Boolean

false

Enable/Disable auto request for extra result.

If enabled the response forwarded as one concatenated packet.

packet_sniffing

Boolean

true

Enable/disable packet sniffing. If enabled the RF network packets forwarded to the IQRF IDE

for debug purposes if the IQRF is IDE connected to the GW .

localization

enable

Boolean

false

Enable/Disable positioning.

message

show_type

Boolean

false

Add message type to MQTT payloads

response: Response messages

error: Error messages

message > response

dpa_request

Boolean

true

Add dpa_request to response message.

dpa_confirm

Boolean

true

Add dpa_confirm to response message.

timestamp_mqtt_receive

Boolean

true

Add timestamp_mqtt_receive to response message.

timestamp_rfnet_send

Boolean

true

Add timestamp_rfnet_send to response message.

timestamp_rfnet_receive

Boolean

true

Add timestamp_rfnet_receive to response message.

timestamp_mqtt_send

Boolean

true

Add timestamp_mqtt_send to response message.

tcp_proxy

enable

Boolean

false

Enable/Disable TCP forwarding over MQTT

max_socket_num

String

Number of maximum opened sockets

max_payload_size_mib

Integer

Maximum payload size

ports

Integer
Array

22

Array of enabled ports

​2.2.​ Subscribe configuration

Configuration file for automatically subscribe MQTT topics and determine the target of the received request messages and setup default response behaviour for each topic.

Configuration file path: /etc/unid/conf.s0/subscribe.conf

Name

Type

Description

topics

subscribe_topic

String

Subscribed topic name

subscribe_qos

Number

Quality of Service for subscribe

QoS

message_topic

String

Topic name of request message target

subscribe_broadcast

String

Optional broadcast topics for requests.

Required for control target and used for request for unique topics.

publish_broadcast

String

Optional broadcast topic for responses

topics > publish (Array)

publish_topic

String

publish_qos

Number

retain

Boolean

false


Example

{

  "topics": [

    {

      "subscribe_topic": "iqhome/gateway/%c/network/request",

      "subscribe_qos": 1,

      "message_topic": "$GW/iqrf",

      "publish": [

        {

          "publish_topic": "iqhome/gateway/%c/network/response",

          "publish_qos": 1,

          "retain": false

        }

      ]

    },

    {

      "subscribe_topic": "iqhome/gateway/%c/linkit/request",

      "subscribe_qos": 1,

      "message_topic": "$GW/control",

      "publish": [

        {

          "publish_topic": "iqhome/gateway/%c/linkit/response",

          "publish_qos": 1,

          "retain": false

        }

      ],

      "broadcast_request_topic": "iqhome/gateway/broadcast/linkit/request",

      "broadcast_response_topic": "iqhome/gateway/broadcast/linkit/response"

    }

  ]

}


​2.3.​ Scheduler configuration

Scheduler configuration file determine the automatically scheduled request messages as scheduled jobs. The defined scheduled jobs in the same matching cron expression will be sent in the same order as defined in the configuration file.

Configuration file path: /etc/unid/conf.s0/scheduler.conf

Name

Type

Description

scheduler

cron_expression

String
Array

Cron expression when the scheduled job should be run

cron_expression_except

String
Array

Cron expression when the scheduled job should be skipped

scheduler > request

message_topic

String

Valid message topic name

message

Object

Valid Request message object

Example

{

  "scheduler": [

    {

      "cron_expression": "*/15 * * * * *",

      "request": {

        "message_topic": "$GW/iqrf",

        "message": {

          "id": 1,

          "dpa_request": "0000.0D.00.FFFF.F0.00.00",

          "timeout": 0,

          "priority": 0,

          "publish": [

            {

              "publish_topic": "iqhome/sensor/%c/response",

              "publish_qos": 1,

              "retain": false

            }

          ]

        }

      }

    },

    {

      "cron_expression": "*/15 * * * * *",

      "cron_expression_except": ["0 0 0 * * *", "0 0 4 * * *"],

      "request": {

        "message_topic": "$GW/iqrf",

        "message": {

          "id": "string-id",

          "dpa_request": "0000.0D.00.FFFF.F0.00.00",

          "timeout": 0,

          "priority": 0,

          "publish": [

            {

              "publish_topic": "$GW/application"

            },

            {

              "publish_topic": "iqhome/sensor/%c/response",

              "publish_qos": 1,

              "retain": false

            }

          ]

        }

      }

    }

  ]

}


​2.4.​ LTE configuration

Only for GW-IND-01-4G* models.

/etc/unid/conf.s0/lte.conf

Name

Type

Default value

Options

Description

apn

String

internet

Access Point Name (APN)

Depends on the mobile service provider

username

String

Empty string

Username for APN

password

String

Empty string

Password for APN

pin

String

Empty string

incorrect_pin

Set when PIN invalid

PIN code of SIM card
If PIN is disabled in SIM this value will be ignored

roaming

String

disable

auto

Roaming set automatically

Enable/Disable roaming

enable

Enable roaming

disable

Disable roaming

scanmode

String

auto

 auto

Select available network automatically

Service log directory

2g

Only 2G
(not recommended)

3g

Only 3G

4g

Only 4G

ping_host

String

8.8.8.8
(Google Public DNS)

Hostname or IPv4 address of ping host
ping_host used for check internet connection

ping_timeout_sec

Number

5

Internet connection check ping timeout

ping_count

Number

3

Internet connection check ping count after try to reset connection

ping_interval_min

Number

5

Number of minutes between check internet connection

use_gps

Boolean

fase

Enable/Disable use GPS

Only affect on models with localization feature

logfile

String

/var/log/unid/lte.log

Log file for lte service

Example

{

    "apn": "internet",

    "pin": "",

    "roaming": "disable",

    "scanmode": "auto",

    "ping_host": "8.8.8.8",

    "ping_timeout_sec": 5,

    "ping_count": 3,

    "ping_interval_min": 5,

    "use_gps": false,

    "logfile": "/var/log/unid/lte.log"

}


​3.​ IQRF network topic message payloads

Target gateway topic: $GW/iqrf

Request

Name

Type

Default

Options

Description

id

Number,String

Message ID
The same ID will be sent in the response messages

dpa_request

String

timeout

Number

0

Set the default timeout values from unid.conf

Timeout value means the maximum processing time for each node. The full timeout calculated from network parameters (hops and time slot values) and added to the timeout value.

Default values:

  • coordinator (addr: 00000): 90sec
  • node(each) (addr: 0100-F900): 5sec

1-65535

priority

Number

0

0-255

Priority of message queue

publish (Array)

publish_topic

String

topic

Override of the default response topic name.

publish_qos

Number

0,1,2

Override default response publish_qos parameter.

retain

Boolean

false

Override default response retain parameter.

Example

Basic

{

  "dpa_request": "0000.0D.00.FFFF.F0.00.00",

}

Extended

{

  "id": "messageid",

  "dpa_request": "0000.0D.00.FFFF.F0.00.00",

  "timeout": 0,

  "priority": 0,

  "publish":[

    {

      "publish_topic":"$GW/application"

    },

    {

      "publish_topic": "iqhome/sensor/%s/%n/response" ,

      "publish_qos":1,

      "retain":false

    }

  ]

}

Response

Name

Type

Default value

Options

Description

id

Number,
String

Message ID

message_type

String

response

Available only if showType enabled in unid.conf

IQRF DPA request HEX string

status

String

Can be disabled in unid.conf

Status message

dpa_request

Can be disabled in unid.conf

IQRF DPA request

dpa_confirm

String

Can be disabled in unid.conf

IQRF coordinator DPA confirm HEX string

dpa_response

String

IQRF node DPA response HEX string

timestamp_mqtt_receive

Number

Can be disabled in unid.conf

Timestamp at enqueue message into RF network queue, when put into IQRF message queue.

timestamp_rfnet_send

Number

Can be disabled in unid.conf

Timestamp at dequeue message from RF network queue, when send to IQRF network.

timestamp_rfnet_receive

Number

Can be disabled in unid.conf

Timestamp at enqueue message into cloud queue, when received from IQRF network.

timestamp_mqtt_send

Number

Can be disabled in unid.conf

Timestamp at dequeue message from MQTT queue, when publish the message.

Example

{

  "id": 123456,

  "message_type": "response",

  "status": "ok",

  "dpa_response": "010020A11202002903",

  "dpa_request": "01002021FFFF0202",

  "dpa_confirm": "01002021FFFFFF38010801",

  "timestamp_mqtt_receive": 1451642400,

  "timestamp_rfnet_send": 1451649604,

  "timestamp_rfnet_receive": 1451649608,

  "timestamp_mqtt_send": 1451649610

}


​4.​ MQTT control topic message payloads

Target gateway topic: $GW/control

​4.1.​ Gateway info

Request

Name

Type

Value

Description

id

String

Message ID

command

String

system

option

String

info

Response

Name

Type

Value

Description

id

String

Message ID

message_type

String

Available only if showType enabled in unid.conf

command

String

system

option

String

info

status

String

Status message

timestamp_mqtt_send

Integer

Available only if timestamp_mqtt_send enabled in unid.conf

info

serial

String

Message ID

mid

String

MID (Module ID) of RF module

hostname

String

Gateway hostname

model

String

Model name

interface

String

Active network interface connected to internet

mac

String

MAC address of active network interface connected to internet

ipv4

String

IPv4 address of active network interface

ipv6

String

IPv6 address of active network interface

netbios

String

Hostname and NetBIOS name of the gateway

mid

String

MID (Module ID) of RF module

firmware

String

Installed unid service package version

firmware_update

String

Available latest unid service package version.

If it’s greater than firmware version update should be installed.

control_request_topic

String

Name of the gateway’s unique request MQTT topic

control_response_topic

String

Name of the gateway’s unique response MQTT topic

uptime_seconds

Gateway uptime in seconds

current_timestamp

Gateway UNIX Epoch timestamp

timezone_numeric

UTC offset numeric e.g.: "+0100"

timezone_alphabetic

Time zone abbreviations e.g.: "CET"

info > monitoring*

voltage_1v8

Float

Voltage of the gateway 1.8V

voltage_3v3

Float

Voltage of the gateway 3.3V

voltage_5v0

Float

Voltage of the gateway 5.0V

voltage_powerin

Float

Voltage of the gateway power

voltage_acok

Boolean

Power source of the gateway. If false the gateway powered from battery, otherwise from power line.

temperature_board

Float

Temperature of the gateway main board

temperature_core

Float

Temperature of the gateway CPU

info > wwan**

model

String

Model of WWAN interface device

version

String

Version of WWAN interface device

rssi

Integer

LTE RSSI value 

operator

String

Operator name

access_mode

Integer

Access mode value

0,3

2G

2,4,5,6

3G

7

4G

info > location*

Object

Location inforamtion

*   Only at industrial models

**  Only at 4G/LTE models

Example

Request

Response

{

  "id": "jctKZwRx1ZpiJh",

  "command": "system",

  "option": "info"

}

{

  "id": "jctKZwRx1ZpiJh",

  "command": "system",

  "option": "info",

  "info": {

    "serial": "GW-3E70000",

    "model": "GW-IND-01-4G",

    "mid": "811018AF",

    "hostname": "raspberrypi",

    "interface": "eth0",

    "mac": "B8:27:EB:C6:78:30",

    "ipv4": "192.168.6.164",

    "ipv6": "fe80::81b0:b2b4:c4fd:c2ba",

    "firmware": "2.3.4-0",

    "firmware_update": "2.3.4-0",

    "control_request_topic": "iqhome/gateway/GW-3E70000/linkit/request",

    "control_response_topic": "iqhome/gateway/GW-3E70000/linkit/response",

    "uptime_seconds": 6555,

    "current_timestamp": 1520421349,

    "timezone_numeric": "+0000",

    "timezone_alphabetic": "UTC",

    "monitoring": {

      "voltage_3v3": 3.28,

      "voltage_1v8": 1.83,

      "voltage_5v0": 5.05,

      "voltage_powerin": 13.67,

      "powerin_online": true,

      "temperature_board": 33.06,

      "temperature_core": 41.16

    },

    "wwan": {

      "model": "EC20",

      "version": "EC20EQAR02A11E2G",

      "rssi": 19,

      "operator": "T-Mobile H Telekom HU",

      "access_mode": 7

    },

    "location": {

      "timestamp": 0,

      "latitude": 0,

      "longitude": 0,

      "type": "cbsp",

      "valid": true

    }

  },

  "status": "ok",

  "timestamp_mqtt_send": 1520421350

}

​4.2.​ Ping

Request

Name

Type

Value

Description

id

String

Message ID

command

String

system

option

String

ping

Response

Name

Type

Value

Description

id

String

Message ID

message_type

String

Available only if showType enabled in unid.conf

command

String

system

option

String

ping

status

String

Status message

timestamp_mqtt_send

Integer

Available only if timestamp_mqtt_send enabled in unid.conf

Example

Request

Response

{

  "id": 1,

  "command": "system",

  "option": "ping"

}

{

  "id": 1,

  "command": "system",

  "option": "ping",

  "status": "ok"

}

​4.3.​ 4.3.Reset RF module

Request

Name

Type

Value

Description

id

String

Message ID

command

String

system

option

String

reset_rf_module

Response

Name

Type

Value

Description

id

String

Message ID

message_type

String

Available only if showType enabled in unid.conf

command

String

system

option

String

reset_rf_module

status

String

Status message

timestamp_mqtt_send

Integer

Available only if timestamp_mqtt_send enabled in unid.conf

Example

Request

Response

{

  "id": 1,

  "command": "system",

  "option": "reset_rf_module"

}

{

  "id": 1,

  "command": "system",

  "option": "reset_rf_module",

  "status": "ok"

}


​4.4.​ Restart unid service

Request

Name

Type

Value

Description

id

String

Message ID

command

String

system

option

String

restart

Response

Name

Type

Value

Description

id

String

Message ID

message_type

String

Available only if showType enabled in unid.conf

command

String

system

option

String

restart

status

String

Status message

timestamp_mqtt_send

Integer

Available only if timestamp_mqtt_send enabled in unid.conf

Example

Request

Response

{

  "id": 9,

  "command": "system",

  "option": "restart"

}

{

  "id": 9,

  "command": "system",

  "option": "restart",

  "status": "ok"

}


​4.5.​ Reboot gateway

Request

Name

Type

Value

Description

id

String

Message ID

command

String

system

option

String

reboot

Response

Name

Type

Value

Description

id

String

Message ID

message_type

String

Available only if showType enabled in unid.conf

command

String

system

option

String

reboot

status

String

Status message

timestamp_mqtt_send

Integer

Available only if timestamp_mqtt_send enabled in unid.conf

Example

Request

Response

{

  "id": 9,

  "command": "system",

  "option": "reboot"

}

{

  "id": 9,

  "command": "system",

  "option": "reboot",

  "status": "ok"

}


​4.6.​ File manager

Request

Name

Type

Options

Description

info <Object>

id

String

Message ID

command

String

filemanager

option

String

upload

Create/Modify/Remove files

download

Read file contents

list

List files

folders <Array>

name

String

dynamic

/etc/unid/conf.d0

Dynamically modified config files e.g. scheduler.conf

static

/etc/unid/conf.s0

Static config files e.g. unid.conf

log

/var/log/unid

Log files

files <Array, String [ * - all files]>

name

String

log

/var/log/unid

Log files

content

String

log

/var/log/unid

Log files

action

String

modify

Modify file contents

create

Create file with content (only script)

remove

Remove file (only script or log)

Response

Name

Type

Options

Description

info <Object>

id

String

Message ID

command

String

filemanager

option

String

upload

download

status

String

Request status

Status message

folders <Array>

name

String

dynamic

/etc/unid/conf.d0

Dynamically modified config files e.g. scheduler.conf

static

/etc/unid/conf.s0

Static config files e.g. unid.conf

log

/var/log/unid

Log files

status

String

Folder status action
Status message

files <Array, String [ * - all files]>

name

String

log

/var/log/unid

Log files

content

String

log

/var/log/unid

Log files

action

String

modify

Modify file contents

create

Create file with content (only script)

remove

Remove file (only script or log)

status

String

File action status

Status message

Example

Download all available files

Request

Response

{

  "id": 100,

  "command": "filemanager",

  "option": "download",

  "folders": [

    {

      "name": "static",

      "files": "*"

    },

    {

      "name": "dynamic",

      "files": "*"

    },

    {

      "name": "log",

      "files": "*"

    },

    {

      "name": "script",

      "files": "*"

    }

  ]

}

{

  "id": 100,

  "command": "filemanager",

  "option": "download",

  "status": "ok",

  "folders": [

    {

      "name": "static",

      "status": "ok",

      "files": [

        {

          "name": "unid.conf",

          "content": "<content>",

          "status": "ok"

        }

      ]

    },

    {

      "name": "dynamic",

      "status": "ok",

      "files": [

        {

          "name": "scheduler.conf",

          "content": "<content>",

          "status": "ok"

        }

      ]

    },

    {

      "name": "log",

      "status": "ok",

      "files": [

        {

          "name": "unid.log",

          "content": "<content>",

          "status": "ok"

        }

      ]

    },

    {

      "name": "script",

      "status": "ok",

      "files": [

        {

          "name": "sysinfo.sh",

          "content": "<content>",

          "status": "ok"

        }

      ]

    }

  ]

}


Example

Upload/modify files

Request

Response

{

  "id": 7,

  "command": "filemanager",

  "option": "upload",

  "folders": [

    {

      "name": "script",

      "files": [

        {

          "name": "test.sh",

          "action": "create",

          "content": "<content>"

        }

      ]

    }

  ]

}

{

  "id": 7,

  "command": "filemanager",

  "option": "upload",

  "status": "ok",

  "folders": [

    {

      "name": "script",

      "status": "ok",

      "files": [

        {

          "name": "test.sh",

          "action": "create",

          "status": "ok"

        }

      ]

    }

  ]

}


​4.7.​ Run scripts

Request

Name

Type

Value

Description

id

String

Message ID

command

String

script

script

String

Script name in the gateway script folder

Response

Name

Type

Value

Description

id

String

Message ID

message_type

String

Available only if showType enabled in unid.conf

command

String

script

echo

String

ping

Output of script

status

String

Status message

timestamp_mqtt_send

Integer

Available only if timestamp_mqtt_send enabled in unid.conf

Example

Request

Response

{

  "id": 14123,

  "command": "script",

  "script": "test.sh"

}

{

  "id": 14123,

  "command": "script",

  "status": "ok",

  "echo": "<stdout>"

}


​4.8.​ Scheduler pause

Request

Name

Type

Value

Description

id

String

Message ID

command

String

scheduler

option

String

pause

Pause scheduler

timeout

Integer

Timeout value in seconds.

The maximum timeout should be 90 minutes. If the timeout is greater than 5400 (90 min) the scheduler automatically set the timeout to 90 minute.

Response

Name

Type

Value

Description

id

String

Message ID

message_type

String

Available only if showType enabled in unid.conf

command

String

scheduler

option

String

pause

status

String

Status message

timestamp_mqtt_send

Integer

Available only if timestamp_mqtt_send enabled in unid.conf

Example

Request

Response

{

  "id": 8,

  "command": "scheduler",

  "option": "pause",

  "timeout": 300

}

{

  "id": 8,

  "command": "scheduler",

  "option": "pause",

  "status": "ok"

}


​4.9.​ Scheduler force resume

Request

Name

Type

Value

Description

id

String

Message ID

command

String

scheduler

option

String

resume

Pause scheduler

Response

Name

Type

Value

Description

id

String

Message ID

message_type

String

Available only if showType enabled in unid.conf

command

String

scheduler

status

String

Status message

timestamp_mqtt_send

Integer

Available only if timestamp_mqtt_send enabled in unid.conf

Example

Request

Response

{

  "id": 9,

  "command": "scheduler",

  "option": "resume"

}

{

  "id": 9,

  "command": "scheduler",

  "option": "resume",

  "status": "ok"

}


​4.10.​ Scheduler info

Request

Name

Type

Value

Description

id

String

Message ID

command

String

scheduler

option

String

info

Pause scheduler

Response

Name

Type

Value

Description

id

String

Message ID

message_type

String

Available only if showType enabled in unid.conf

command

String

info

timestamp

UNIX Epoch timestamp when info requested

timeout

Remaining timeout seconds until scheduler will be resumed

status

String

Status message

timestamp_mqtt_send

Integer

Available only if timestamp_mqtt_send enabled in unid.conf

Example

Request

Response

{

  "id": 9,

  "command": "scheduler",

  "option": "info"

}

{
   "id": 9,
   "command": "scheduler",
   "option": "info",
   "paused": true,
   "timestamp": 1506414303,
   "timeout": 292,
   "status": "ok"
}


​5.​ Application message payloads

Target gateway topic: $GW/application 

Request

Name

Type

Description

message_topic

String

Source topic of the message

message

Object

Response message from GW or custom object via MQTT

Response

Name

Type

Description

message_topic

String

Target topic of the message

message

Object

Valid  Request message object or custom message for only MQTT

publish_qos

Only for MQTT target topic. Quality of Service for publish QoS

retain

Only for MQTT target topic

Example

Request

Response

{

  "message_topic": "topic_received",

  "message": "msg"

}

{

  "message_topic": "topic_publish",

  "message": "msg",  

  "publish_qos":1,

  "retain":false

}


​6.​ Appendix

​6.1.​ Status messages

Request

Response

ok

Status ok

error

General error

empty_payload

empty message payload

invalid_target

Request interface target is missing or invalid

invalid_command

control command is missing or invalid

invalid_option

control option is missing or invalid

invalid_action

control action is missing or invalid

request_format_error

Request message payload invalid format

content_format_error

Request content error

folder_access_error

File download/upload no access to folder

file_access_error

File download/upload no access to file

file_read_error

File read error

file_write_error

File write error

store_nofreespace

No free space left on configuration storage device

interface_busy

Interface busy

interface_blocked

Interface blocked ( IQRF IDE Network management mode active)

script_exceeds_limit

Number of running scripts is exceeds limit

network_queue_full

RF network queue is full

feature_disabled

Requested feature is disabled in configuration file

timeout

$GW/iqrf request timeout

communication_error

$GW/iqrf communication error

framework_error

$GW/iqrf DPA framework error


​6.2.​ QoS - Quality of Service

​6.3.​ Cron expression

┌─────────────  sec (0-59)

│ ┌────────────── min (0 - 59)

│ │ ┌─────────────── hour (0 - 23)

│ │ │ ┌──────────────── day of month (1 - 31)

│ │ │ │ ┌───────────────── month (1 - 12)

│ │ │ │ │ ┌──────────────── day of week (0 - 6)(0to 6 are Sunday to
│ │ │ │ │ │        Saturday, (or use names??)
│ │ │ │ │ │        7 is Sunday, the same as 0)

│ │ │ │ │ │

* * * * * *

Valid cron expressions:

Expression

Description

Example

Run job at

Number

In every Xth unit

0 5 * * * *

Every 5th minute

*

In every unit

0 * * * * *

Every minute

*/5

In every 5th unit

*/10 * * * * *

Every 10th second

1,2,3

In every 1,2,3 unit

0 0 0,12 * * *

Twice per day

1-10

In every unit in the 1-10 interval

0 0-5 * * * *

Every hour 0,1,2,3,4,5th minute


​6.4.​ Topics

Topics start with $GW/ reserved for gateway specific topics.

Name

Description

Request Topic

Response Topic

$GW/iqrf

IQRF network

𝗑

Any topic that does not start with $GW

MQTT

$GW/control

Gateway control

𝗑

$GW/application

UDP Application

Automatic replacements in topics

Name

Description

%h

Hostname (GW Hostname)

%s

Serial ID of the gateway

%m

Module ID of the RF module

%c

Client ID from MQTT config

%u

Username from MQTT config

Example:

iqhome/gateway/%s/response used as iqhome/gateway/GW-3E70000/response


​6.5.​ Location information

Location information available only for 4G/LTE models.

Name

Type

Description

timestamp

Integer

Timestamp of the location information

latitude

Float

Latitude coordinate

longitude

Float

Longitude coordinate

type

String

Invalid - Invalid position information

cbsp - Location information by Cell Base Station Positioning

gnss - Location information by GPS+GLONASS

valid

Boolean

If true the last request for location information was valid


​6.8.​ MQTT payload string content

<content> - ASCII strings with escape characters

E.g.:

1. JSON content

Original:

{

"key":"value"

}

Encoded:

"{\n\"key\": \"value\"}\n"

2. Plain text

  Orinigal:

Test text.

Another line.

Encoded:

"Test text.\nAnother line."

​6.9.​ Login

Default credentials

Username: gw

Password: iqhome


​6.10.​ LTE RSSI value

Value

dBm

Description

0

-113

Bad

1

-111

Bad

2

-109

Marginal

3

-107

Marginal

4

-105

Marginal

5

-103

Marginal

6

-101

Marginal

7

-99

Marginal

8

-97

Marginal

9

-95

Marginal

10

-93

OK

11

-91

OK

12

-89

OK

13

-87

OK

14

-85

OK

15

-83

Good

16

-81

Good

17

-79

Good

18

-77

Good

19

-75

Good

20

-73

Excellent

21

-71

Excellent

22

-69

Excellent

23

-67

Excellent

24

-65

Excellent

25

-63

Excellent

26

-61

Excellent

27

-59

Excellent

28

-57

Excellent

29

-55

Excellent

30

-53

Excellent

31

-51

Excellent

99

Not known or not detectable

255

Can’t read from LTE module

​6.11.​ Ports

Service

Port

Protocol

Gateway local connection

13013

TCP

Gateway zconf service

1313

UDP

©2018 IQHome Kft

www.iqhome.org

 /