Changes

no edit summary
Line 95: Line 95:  
===SAS key connection type configuration===
 
===SAS key connection type configuration===
 
Configuring Azure IoT Hub using the SAS key connection type is straightforward:
 
Configuring Azure IoT Hub using the SAS key connection type is straightforward:
<div>1. Make sure to enable the instance by pressing '''Enable''' button </div>
+
<div>1. Make sure to enable the instance by pressing '''"Enable"''' button </div>
<div>2. Paste previously copied '''Connection String'''</div>
+
<div>2. Paste previously copied '''"Primary Connection String"'''</div>
<div>3. Press '''Save & Apply''' button </div>
+
<div>3. Press '''"Save & Apply"''' button </div>
 
[[File:Azure RutOSconf 2.2.png|border|class=tlt-border]]
 
[[File:Azure RutOSconf 2.2.png|border|class=tlt-border]]
 
</ul>
 
</ul>
Line 131: Line 131:  
3.1 Set connection type as a '''Device Provisioning Service (DPS)''';
 
3.1 Set connection type as a '''Device Provisioning Service (DPS)''';
   −
3.2 Enter '''ID Scope''' of your DPS service page on Azure. This value can be retrieved from the DPS instance found on Azure Portal page or by following the earlier guide;
+
3.2 Enter '''"ID Scope"''' of your DPS service page on Azure. This value can be retrieved from the DPS instance found on Azure Portal page or by following the earlier guide;
   −
3.3 Specify the '''Registration ID'''. This is the subject common name (CN) of the device leaf certificate that was created using the earlier guide.
+
3.3 Specify the '''"Registration ID"'''. This is the subject common name (CN) of the device leaf certificate that was created using the earlier guide.
    
3.4 Upload the certificate chain file and the private key file.  
 
3.4 Upload the certificate chain file and the private key file.  
Line 152: Line 152:  
Inspecting the newly created enrollment group will reveal some keys. The primary key will be used to derive each individual device identity. This can be done using a script which is available on Microsoft DPS documentation [https://learn.microsoft.com/en-us/azure/iot-dps/how-to-legacy-device-symm-key?tabs=linux&amp%3Bpivots=programming-language-ansi-c&pivots=programming-language-ansi-c#derive-a-device-key here].
 
Inspecting the newly created enrollment group will reveal some keys. The primary key will be used to derive each individual device identity. This can be done using a script which is available on Microsoft DPS documentation [https://learn.microsoft.com/en-us/azure/iot-dps/how-to-legacy-device-symm-key?tabs=linux&amp%3Bpivots=programming-language-ansi-c&pivots=programming-language-ansi-c#derive-a-device-key here].
   −
The script contains a couple of variables: '''KEY''' and '''REG_ID'''. The KEY field shall contain the primary key which is obtained from the newly created enrollment group. The '''REG_ID''' field specifies the device identity name that will be created. Upon executing the script a shared access key will be created.
+
The script contains a couple of variables: '''"KEY"''' and '''"REG_ID"'''. The KEY field shall contain the primary key which is obtained from the newly created enrollment group. The '''"REG_ID"''' field specifies the device identity name that will be created. Upon executing the script a shared access key will be created.
    
[[File:Azure symm example 1.png|border|class=tlt-border]]
 
[[File:Azure symm example 1.png|border|class=tlt-border]]
Line 159: Line 159:     
<ul>
 
<ul>
<li> In the '''ID scope''' field specify your Azure DPS service ID. This value can be retrieved from the DPS instance found on Azure Portal page or by following the earlier guides from Microsoft.</li>
+
<li> In the '''"ID scope"''' field specify your Azure DPS service ID. This value can be retrieved from the DPS instance found on Azure Portal page or by following the earlier guides from Microsoft.</li>
<li> In the '''Registration ID''' field enter the "REG_ID" value that was specified in the earlier script.</li>
+
<li> In the '''"Registration ID"''' field enter the '''"REG_ID"''' value that was specified in the earlier script.</li>
<li> In the '''Symmetric key''' field enter the output value of the script that was used earlier].</li>
+
<li> In the '''"Symmetric key"''' field enter the output value of the script that was used earlier].</li>
 
</ul>
 
</ul>
   Line 170: Line 170:  
After a few moments the device should establish connection to the Azure server.
 
After a few moments the device should establish connection to the Azure server.
   −
After returning to the IoT Hub services in the Azure portal page it can be observed that the DPS service has created a new device identity was named the same as what we specified in the '''REG_ID''' field in the script.
+
After returning to the IoT Hub services in the Azure portal page it can be observed that the DPS service has created a new device identity was named the same as what we specified in the '''"REG_ID"''' field in the script.
    
[[File:Azure symm example 3.png|border|class=tlt-border]]
 
[[File:Azure symm example 3.png|border|class=tlt-border]]
Line 186: Line 186:  
For testing and demonstration purposes we will use the Azure IoT Explorer application. The Azure IoT Explorer is a graphical tool for interacting with devices connected to your IoT hub. To learn more about this tool you can follow the Microsoft documentation [https://learn.microsoft.com/en-us/azure/iot/howto-use-iot-explorer here].  
 
For testing and demonstration purposes we will use the Azure IoT Explorer application. The Azure IoT Explorer is a graphical tool for interacting with devices connected to your IoT hub. To learn more about this tool you can follow the Microsoft documentation [https://learn.microsoft.com/en-us/azure/iot/howto-use-iot-explorer here].  
   −
After enabling the Direct Method feature go to Azure IoT Explorer, select the appropriate device identity and navigate to the Direct Methods tab. All our devices support the '''api_call''' direct method which exposes the API interface to be used from the Azure side. In this example we will make a simple GET request to retrieve the I/O status of the device. Full documentation of Teltonika devices API can be found [https://developers.teltonika-networks.com/ here] .
+
After enabling the Direct Method feature go to Azure IoT Explorer, select the appropriate device identity and navigate to the Direct Methods tab. All our devices support the '''"api_call"''' direct method which exposes the API interface to be used from the Azure side. In this example we will make a simple GET request to retrieve the I/O status of the device. Full documentation of Teltonika devices API can be found [https://developers.teltonika-networks.com/ here] .
   −
The Azure IoT Explorer Direct Method tab will have a Payload field. In this field the '''api_call''' method expects JSON formatted data.
+
The Azure IoT Explorer Direct Method tab will have a Payload field. In this field the '''"api_call"''' method expects JSON formatted data.
    
[[File:Azure RutOSconf 20.png|border|class=tlt-border]]
 
[[File:Azure RutOSconf 20.png|border|class=tlt-border]]
   −
The API call expects at least two parameters. The first one is called '''"method"''' which needs to have an integer value between zero and three, corresponding to the API method type - either GET, POST, PUT or DELETE. The second parameter is '''"endpoint"''' which expects a string value of the API endpoint. In this case, we will call the '''/io/status''' endpoint.
+
The API call expects at least two parameters. The first one is called '''"method"''' which needs to have an integer value between zero and three, corresponding to the API method type - either GET, POST, PUT or DELETE. The second parameter is '''"endpoint"''' which expects a string value of the API endpoint. In this case, we will call the '''"/io/status"''' endpoint.
    
[[File:Azure RutOSconf 22.1.png|border|class=tlt-border]]
 
[[File:Azure RutOSconf 22.1.png|border|class=tlt-border]]
Line 200: Line 200:  
[[File:Azure RutOSconf 21.png|border|class=tlt-border]]
 
[[File:Azure RutOSconf 21.png|border|class=tlt-border]]
   −
To determine the appropriate payload and method to use we provide an additional file currently called '''teltonikaGenericDevice.json'''. This file is written in '''Digital Twin Definition Language (DTDL)'''. To learn more about DTDLs and Digital Twins read about it in Microsoft documentation [https://learn.microsoft.com/en-us/azure/digital-twins/concepts-models here].
+
To determine the appropriate payload and method to use we provide an additional file currently called '''"teltonikaGenericDevice.json"'''. This file is written in '''Digital Twin Definition Language (DTDL)'''. To learn more about DTDLs and Digital Twins read about it in Microsoft documentation [https://learn.microsoft.com/en-us/azure/digital-twins/concepts-models here].
    
In this file you can see that it supports the api_call method, which accepts three values. The request body is optional, as some methods, such as the GET method, may not require it. JSON files can be downloaded  [[Media:Teltonika-dtmi-docs.zip|here]].
 
In this file you can see that it supports the api_call method, which accepts three values. The request body is optional, as some methods, such as the GET method, may not require it. JSON files can be downloaded  [[Media:Teltonika-dtmi-docs.zip|here]].