In the communications window, in the tab "Wifi, Serial and Modbus" you can configure the parameters related to the wifi interface.
Here you can select the operating mode from the following options:
The RTU-X allows the possibility of being in Access Point and Station mode at the same time.
In the communications window, in the tab "Wifi, Serial and Modbus" you can configure the parameters related to the RS-485 serial interfaces.
The RS-485 serial interfaces are optional expansion modules. For each interface, speed and parity can be configured.
In the communications window, in the tab "Wifi, Serial and Modbus" you can configure the parameters related to Modbus.
The parameters are:
In the communications window, in the tab "Modem, Bluetooth, NTP" you can configure the parameters related to the modem. The modem is an optional module.
The parameters that can be configured are:
By default the RTU-X has BLE 4.2 connectivity that can be used to connect to the device from the configuration software and also to act as a master of other BLE devices, such as temperature and humidity sensors.
In the communications window, in the tab "Modem, Bluetooth, NTP" you can configure the parameters related to Bluetooth.
You must select the name of the device (it will be the name advertised by the RTU-X) and the security pin, which will be requested when connecting.
In the communications window, in the tab "Modem, Bluetooth, NTP" you can configure the configuration of an NTP server for time synchronization.
You must select:
The MQTT protocol is a communications protocol over TCP/IP that has been adopted as one of the most widely used standards for IoT devices.
The RTU-X uses MQTT to send the log records to a server in the cloud, but it is also used to perform other more complex functions when the RTU-X is connected to Thingsboard; such as updating all settings, synchronizing shared variables, or sending RPC commands.
The parameters to configure for the MQTT connection are the following:
For the Thingsboard format option, you only need to configure the URI, user (token) that uniquely identifies the device on the platform and certificate (in case of using mqtts). All other parameters are set automatically.
When using the Telemetry + instance of Nettra, you must select the Thingsboard format and fill in only the user (token) that will be provided by Nettra. The URI and certificate are the values that are loaded by default when selecting Thingsboard.
To send variables through MQTT you can use the log and report functions from the script. Both functions can be used with variables of type telemetry or attribute.
The format in which the information is sent in each case is as follows:
Format | Telemetry type variable | Attribute type variable |
JSON and Thingsboard |
where XXX is the timestamp in UTC in unix format in milliseconds of the records |
|
Ultralight 2.0 |
where TTT is the timestamp in UTC in ISO8601 format |
|
All log records created with the same date / time are sent in the same MQTT package.
If the connection is lost, all records are stored in the log and sent when the connection is re-established.
When Thingsboard is selected as the format for the MQTT connection, the RTU-X implements additional functionalities in addition to sending the log by MQTT.
These functionalities are described below.
When a variable in the script is defined with the prefix shared, the value of the variable is synchronized with the value of the shared attribute in Thingsboard with the same name if it exists.
This is achieved without the user having to do anything special because when establishing the MQTT connection, the RTU-X automatically subscribes to the topics
v1/devices/me/attributes
and v1/devices/me/attributes/response/+
When the value of the shared attribute is created or updated in Thingsboard, the system sends the following publish to the RTU-X:
v1/devices/me/attributes
{“variable”:value}
On the other hand, when the RTU-X establishes the MQTT connection (or the script is updated with new variables), the RTU-X performs the following publish:
v1/devices/me/attributes/request/44332
{“sharedKeys”, “variable1,variable2”}
And the Thingsboard server sends the following publish to the RTU-X as a response:
v1/devices/me/attributes/response/44332
{“variable1”:value, “variable2”:value}
The RTU-X automatically publishes a list of useful internal variables to the server.
The following variables are published every time the connection is established with the MQTT server:
Variable | Detalle |
model | RTU-X model (DIN or IP68) and hardware version |
mac_wifi | MAC address of the Wi-Fi module. |
ext1 | Information of the module connected in the extension socket 1. |
ext2 | Information of the module connected in the extension socket 2. |
modem_imei | Modem IMEI (if a modem is present in the communication socket). |
modem_imsi | IMSI of the SIM (if a modem is present in the communication socket). |
The following variables are published periodically every 10 minutes:
Variable | Detalle |
battery | Battery percentage. |
battery_status | Working status of the RTU-X related to battery. It can be Charged, Charging or No power. |
internal_temperature | Internal temperature of the RTU-X |
modem_signal | Modem signal level in dBm. |
wifi_signal | Wi-Fi signal level in dBm. |
RPC stands for “Remote Procedure Call” and is used to send commands and queries from the Thingsboard server to the RTU-X.
To do this, the RTU-X subscribes to the topic “v1/devices/me/rpc/request/+” to receive the commands.
The following RPC commands are valid:
Function | Description | Command | Response |
set_variable | Modify a telemetry, attribute or shared variable |
where NAME is the name of the variable and VALUE the value |
OK |
get_variable | Query a telemetry, attribute or shared variable |
where NAME is the name of the variable |
VALUE |
resend_log | Resends the last N log registers |
where N is the number of log registers to resend |
OK |
timezone | Sets the timezone of the RTU-X |
where t is the new time zone |
OK |
reset | Resets de RTU-X |
|
None |