Skip to content

Nodes Introduction

Where you can find it

The Node field is placed between the Dashboard and the Multicast menu fields.

Find

Usage

The Nodes are the bricks of all the ResIOT structure. A Node is a sensor capable to communicate with other Nodes or with the Server with the help of a Data Connector. Every Node is designed for specific functions.

Nodes Models

You can easily setting up your Node if it fits to one Node Model. A Node Model is a standard configuration based on the Node's Type. For more information see Nodes Wizard.

Node Configuration

Required Fields

  • DevEUI: a 16 bytes unique code.
  • AppEUI: a Node must belong to one or more Application. The AppEUI is an unique identifier of 16 bytes.
  • Name: a unique Node Name.

Authentications

  • No Auth: used in case of external networkserver
  • OTAA Class A: allow bi-directional communications, but downlink messages can only be transmitted after an uplink transmission by the node. Require a 32 byte application key (AppKey).
  • ABP Class A: same functions as Class A OTAA but with different security. It requires an 8 byte unique code (Dev Addres), a 32 byte application security key (AppSKey) and a network security key (NwkSKey).
  • OTAA Class C: continuously open receive windows, only closed when transmitting. Same security key as Class A OTAA
  • ABP Class C same functions as Class C OTAA. Same security keys as Class A ABP.

Tags
Tags represent the fields in which the data retrieved from a Payload is stored. They can be numeric, string or boolean. Numeric tags may be displayed as a chart or a widget chart on the dashboard
The main use of these fields is to keep an historic storage but you can also use them as variables directly linked to the Node. For example, you can trigger an event when the a Tag reaches a certain value.

To define your Node's Tags navigate to the Node menu and select the designed one.

Lookup

Scroll down to the Node Fields table.

Lookup

The data retrieved from the Payload has to reference to the first column: the Tag Field Tag. The second column define if the Tag has to be Tracked by a chart or a widget chart. The third one define the Type of the Tag while the last one defines the Unit of Measurement of the chart.

To save the information from the Payload, the use of the Lua function resiot_setnodevalue is required. It simply takes as input the DevEUI, the AppEUI, the Tag and the Value.

The data stored into the Tags may be recovered visiting the Node Data History page.

Remote Keys
This table is used to set Keys usefull for the synchronization with certain types of LoRaWAN™ Server. For more information see Connectors.

Lookup

Commands
The Commands are encoded instructions that can be sent to Node to make it to execute a particular function.

To create new Commands select a Node:

Lookup

Scroll down to the Commands table:

Lookup

The column represents the Name of the command. The second one, instead, represents the Command Tag: the identifier used to call the Command from a Scene(resiot_tx). The third describes the Inputs for the Node, the standard input format is:

[num/str/bool]Name(Value)Description;

  • [num/str/bool]: the type of the value;
  • Name: the name that need to be called from the Lua code;
  • Value: the value passed to the Node;
  • Description: a pure html description for the Node Command page;

Example

[num]Alive(600)<p>Set the time for the alive message every 600 seconds</p>;

The last column has to contain the Command's Lua code: the heart of the Command.

This is an example how to set the Alive message time to 600(See the previous example) The Alive message is a directive sent by the Node every X minutes.

deveui = resiot_comm_getparam("deveuisource")
appeui = resiot_comm_getparam("appeuisource")
alive = tonumber(resiot_comm_getparam("Alive"))

FinalPayload = resiot_i2nbl(alive, 2)

port = "9" 

err = resiot_tx(FinalPayload, port, deveui, appeui, "", "", true, "")

This is an example how to retrieve the Battery Level.

deveui = resiot_comm_getparam("deveuisource")
appeui = resiot_comm_getparam("appeuisource")

-- Request for the Battery Level
FinalPayload = {0x45, 0x6E, 0x71}

port = "8"

err = resiot_tx(FinalPayload, port, deveui, appeui, "", "", true, "")

This is a class A Node, this means that it will send the data only when it'll send a message to the server.