Changes

no edit summary
Line 248: Line 248:  
====Checking if data reaches IoT Hub on Azure====
 
====Checking if data reaches IoT Hub on Azure====
   −
To determine whether data successfully reaches Azure IoT Hub select your device and navigate to the "Telemetry" tab on the Azure IoT Explorer. Ensure that "'''Use built-in event hub'''" option is enabled and press the "'''Start'''" button. After some time you should see that data was sent from the device to the Azure IoT Hub.
+
To determine whether data successfully reaches Azure IoT Hub select your device and navigate to the "Telemetry" tab on the Azure IoT Explorer. Ensure that '''"Use built-in event hub"''' option is enabled and press the '''"Start"''' button. After some time you should see that data was sent from the device to the Azure IoT Hub.
    
[[File:Azure RutOSconf 29.png|border|class=tlt-border]]
 
[[File:Azure RutOSconf 29.png|border|class=tlt-border]]
Line 274: Line 274:  
====Modbus TCP Server====
 
====Modbus TCP Server====
   −
Enable the service in '''Services -> Modbus -> Modbus TCP Server''' with '''Enable''' option. For more information about this service you can find it on our Modbus Wiki [https://wiki.teltonika-networks.com/view/RUTX11_Modbus#Modbus_TCP_Server TCP server section]
+
Enable the service in '''Services -> Modbus -> Modbus TCP Server''' with '''"Enable"''' option. For more information about this service you can find it on our Modbus Wiki [https://wiki.teltonika-networks.com/view/RUTX11_Modbus#Modbus_TCP_Server TCP server section]
    
====Modbus TCP Client====
 
====Modbus TCP Client====
Line 293: Line 293:  
1. Go to '''Services -> Data to Server''' page and create a new collection instance.
 
1. Go to '''Services -> Data to Server''' page and create a new collection instance.
   −
1.1. Select the input '''Type''' to '''Modbus''';
+
1.1. Select the input '''Type''' to '''"Modbus"''';
   −
1.2. Change the '''Format type''' to '''Custom''';
+
1.2. Change the '''Format type''' to '''"Custom"''';
   −
1.3. In the '''Format string''' we will enter the following data: '''{"Date (Linux timestamp)": %timestamp%, "MODBUS server ID": "%server_id%", "MODBUS server name" : "%server_name%", "Request name": "%name%", "Start register": "%addr%", "Register data (JSON object)": %data%, "Raw data": "%raw_data%"}'''. This will form requests about Modbus data including the register values;
+
1.3. In the '''Format string''' we will enter the following data:  
 +
'''{"Date (Linux timestamp)": %timestamp%, "MODBUS server ID": "%server_id%", "MODBUS server name" : "%server_name%", "Request name": "%name%", "Start register": "%addr%", "Register data (JSON object)": %data%, "Raw data": "%raw_data%"}'''
 +
This will form requests about Modbus data including the register values;
   −
1.4. In the '''Collection configuration''' page select the '''Format type''' to custom;
+
1.4. In the '''"Collection configuration"''' page select the '''"Format type"''' to '''"Custom"''';
   −
1.5. Change the '''Format string''' to '''{ "input1": %input1% }'''. Make sure to change the '''%input1%''' value to your specific input name. Note that this value is not enclosed in braces. This is intentional since the braces are present in the Modbus input '''Format string''' field;
+
1.5. Change the '''"Format string"''' to '''{ "input1": %input1% }'''. Make sure to change the '''%input1%''' value to your specific input name. Note that this value is not enclosed in braces. This is intentional since the braces are present in the Modbus input '''Format string''' field;
   −
1.6. In the '''Server configuration''' select the '''Type''' to '''Azure IoT Hub''' and configure the Azure configuration instance in accordance to your needs.
+
1.6. In the '''"Server configuration"''' select the '''"Type"''' to '''"Azure IoT Hub"''' and configure the Azure configuration instance in accordance to your needs.
    
====Monitoring and controlling incoming data====
 
====Monitoring and controlling incoming data====
Line 311: Line 313:  
[[File:Azure modbus example 1 modified 1.png|border|class=tlt-border]]
 
[[File:Azure modbus example 1 modified 1.png|border|class=tlt-border]]
   −
In order to change the type of Modbus data sent to the Azure IoT Hub without going to the device WebUI the '''Direct Methods''' feature can be utilized. Using Azure IoT Explorer go to the device identity that was configured on the Teltonika device and select '''Direct method''' tab.
+
In order to change the type of Modbus data sent to the Azure IoT Hub without going to the device WebUI the '''Direct Methods''' feature can be utilized. Using Azure IoT Explorer go to the device identity that was configured on the Teltonika device and select '''"Direct method"''' tab.
   −
Using the '''api_call''' direct method create API requests that update the Modbus TCP Client request configurations (API reference for Modbus services can be found [https://developers.teltonika-networks.com/reference/7.6.10/v1/modbus/ here]. In this example the request configuration will be changed to collect '''Mobile signal strength'''. To do this using only API we will need to resolve the Modbus TCP client instance ID then the request ID of the instance which currently collects the temperature data. Using both of the IDs we will form the last API PUT request to update the register values:
+
Using the '''"api_call"''' direct method create API requests that update the Modbus TCP Client request configurations (API reference for Modbus services can be found [https://developers.teltonika-networks.com/reference/7.6.10/v1/modbus/ here]. In this example the request configuration will be changed to collect '''"Mobile signal strength"'''. To do this using only API we will need to resolve the Modbus TCP client instance ID then the request ID of the instance which currently collects the temperature data. Using both of the IDs we will form the last API PUT request to update the register values:
   −
2.1. Invoke '''/modbus/client/tcp/config''' GET request and inspect the output on IoT Explorer. The '''"data"''' array will contain JSON objects of every configured client instance. The '''"id"''' value will be used when forming the next API request;
+
2.1. Invoke '''"/modbus/client/tcp/config"''' GET request and inspect the output on IoT Explorer. The '''"data"''' array will contain JSON objects of every configured client instance. The '''"id"''' value will be used when forming the next API request;
    
[[File:Azure modbus example 2.png|border|class=tlt-border]]
 
[[File:Azure modbus example 2.png|border|class=tlt-border]]
   −
2.2. Invoke '''/modbus/client/tcp/{id}/requests/config''' GET request and replace the '''{id}''' with the '''"id"''' value from the previous step. Inspecting the output will reveal the '''"data"''' array which contain JSON objects of every configured request. The '''"id"''' value of the request that collects temperature data will be used when forming the next API request;
+
2.2. Invoke '''"/modbus/client/tcp/{id}/requests/config"''' GET request and replace the '''"{id}"''' with the '''"id"''' value from the previous step. Inspecting the output will reveal the '''"data"''' array which contain JSON objects of every configured request. The '''"id"''' value of the request that collects temperature data will be used when forming the next API request;
    
[[File:Azure modbus example 3.png|border|class=tlt-border]]
 
[[File:Azure modbus example 3.png|border|class=tlt-border]]
   −
2.3. Invoke '''/modbus/client/tcp/{id}/requests/config/{request_id}''' PUT request and replace the '''{id}''' with the '''"id"''' value from the 2.1. step and replace the '''{request_id}''' with the '''"id"''' value from the 2.2. step. In the '''request_body''' field add values to change the first register and data type values: '''{"data":{"first_reg":"4","data_type":"32bit_int1234"}}''' which corresponds to mobile signal strength register (other parameters such as number of registers stay the same since the timestamp register count is the same too).
+
2.3. Invoke '''"/modbus/client/tcp/{id}/requests/config/{request_id}"''' PUT request and replace the '''"{id}"''' with the '''"id"''' value from the 2.1. step and replace the '''"{request_id}"''' with the '''"id"''' value from the 2.2. step. In the '''"request_body"''' field add values to change the first register and data type values: '''{"data":{"first_reg":"4","data_type":"32bit_int1234"}}''' which corresponds to mobile signal strength register (other parameters such as number of registers stay the same since the timestamp register count is the same too).
    
[[File:Azure modbus example 4.png|border|class=tlt-border]]
 
[[File:Azure modbus example 4.png|border|class=tlt-border]]