Info
Content

IQRF GW Daemon

Official website:
IQRF GW Daemon

Hexio IoT Platform supports only IQRF Standart Devices.

Example API request ReadSensorsWithTypes request v1-0-0 - example

Connect to Hexio IoT Platform

After login to IQRF GW WEB application, choose Configuration > MQTT Interface > Add (right corner).

Params:

  • Name of instance - connection label, keep Hexio IoT Cloud
  • Broker address - keep connect.hexio.cloud:1883
  • ClientID - any text can be inserted
  • Persistence - keep 1
  • QoS (quality of service) - keep QoS 1 - At least once
  • Topic for request - Topic for sending requests to the daemon
  • Topic for response - Topic for receivind responses from the daemon

Image: Example configuration in IQRF WEB App

Scheduler Setup

Version 1

Send request "add task" on topic labled as topic for requests (see above). You can user built-in tool in IQRF Net > Send JSON request.

Official documentation for Scheduler

Example of request v1.0.0:

{
  "mType": "mngScheduler_AddTask",
  "data": {
    "msgId": "testSchedulerAdd",
    "req": {
      "clientId": "SchedulerMessaging",
      "task": {
        "messaging": "Hexio IoT Cloud",
        "message": {
          "mType": "iqrfSensor_ReadSensorsWithTypes",
          "data": {
            "msgId": "testRaw",
            "req": {
              "nAdr": 4,
              "param": {
                "sensorIndexes": -1
              }
            },
            "returnVerbose": true
          }
        }
      },
      "timeSpec": {
        "cronTime": [
          "*/10",
          "*",
          "*",
          "*",
          "*",
          "*",
          "*"
        ],
        "periodic": false,
        "period": 0,
        "exactTime": false,
        "startTime": ""
      },
      "persist": true
    },
    "returnVerbose": true
  }
}

Verion 2

Create file in /var/cache/iqrf-gateway-daemon/scheduler/

File is 1.json, 2.json etc.

Example file v2.0.0:

{
  "TasksJson": [
    {
      "time": "0 */1 * * * * *",
      "service": "SchedulerMessaging",
      "task": {
        "messaging": "Hexio IoT Cloud",
        "message": {
          "mType": "iqrfSensor_ReadSensorsWithTypes",
          "data": {
            "msgId": "a726ecb9-ee7c-433a-9aa4-3fb21cae2d4d",
            "repeat": 1,
            "req": {
              "deviceAddr": 1
            },
            "returnVerbose": true
          }
        }
      }
    },
    {
      "time": "1 */1 * * * * *",
      "service": "SchedulerMessaging",
      "task": {
        "messaging": "Hexio IoT Cloud",
        "message": {
          "mType": "iqrfSensor_ReadSensorsWithTypes",
          "data": {
            "msgId": "b726ecb9-ee7c-433a-9aa4-3fb21cae2d4d",
            "repeat": 1,
            "req": {
              "deviceAddr": 2
            },
            "returnVerbose": true
          }
        }
      }
    }
  ]
}

Example file v2.1.0:

{
   "taskId": 1,
   "clientId": "SchedulerMessaging",
   "timeSpec": {
       "cronTime": [
         "*/10",
         "*",
         "*",
         "*",
         "*",
         "*",
         "*"
       ],
       "exactTime": false,
       "periodic": false,
       "period": 0,
       "startTime": ""
   },
   "task": {
       "messaging": "Hexio IoT Cloud",
       "message": {
          "mType": "iqrfSensor_ReadSensorsWithTypes",
          "data": {
             "msgId": "testEmbedSensor",
             "req": {
                "nAdr": 8,
                "param": {
                   "sensorIndexes": -1
                }
             },
            "returnVerbose": true
         }
      }
   }
}

Cron Format

More you can fing here. This CRON format is extended by seconds (first field).

  • Slash / before number means "every"
  • Star * meams the field not matters

Examples:

  • * in minutes: no minutes matters
  • 5 in minutes: every 5th minute
  • */5 in minutes: each 5 minutes

Legend:
Setup for 5 sec interval:

[
  "*/5", - seconds (0 - 59)
  "*", - minutes (0 - 59)
  "*", - hours (0 - 23)
  "*", - day in month (1 - 31)
  "*", - month (1 - 12)
  "*", - day in week (0 = Sunday, 1 = Monday, ..., 6 = Saturday)
  "*" - year
],

Setup for every midnight:

[
  "0", - seconds (0 - 59)
  "0", - minutes (0 - 59)
  "0", - hours (0 - 23)
  "*", - day in month (1 - 31)
  "*", - month (1 - 12)
  "*", - day in wee (0 = Sunday, 1 = Monday, ..., 6 = Saturday)
  "*" - year
],

Setup for every 10th second in every minute:

[
  "10", - seconds (0 - 59)
  "*/1", - minutes (0 - 59)
  "*", - hours (0 - 23)
  "*", - day in month (1 - 31)
  "*", - month (1 - 12)
  "*", - day in wee (0 = Sunday, 1 = Monday, ..., 6 = Saturday)
  "*" - year
],
No Comments
Back to top