Skip to content

Commit e1afb76

Browse files
authored
Small fixes, banner image removed from text (#1622)
* Small fixes, banner image removed from text * Trademark and Images descriptions fixed * Not used image removed
1 parent db83710 commit e1afb76

File tree

2 files changed

+43
-47
lines changed

2 files changed

+43
-47
lines changed

content/hardware/07.opta/opta-family/opta/tutorials/opta-azure-iot-tutorial-en/content.md

Lines changed: 43 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: 'Arduino Opta with Azure IoT'
3-
description: "Learn to connect your Arduino Opta to the Microsoft Azure cloud"
2+
title: 'Opta with Azure IoT'
3+
description: "Learn to connect your Opta to the Microsoft Azure cloud"
44
author: 'Mirko Pacioni'
55
libraries:
66
- name: 'Azure SDK for C'
@@ -15,17 +15,15 @@ hardware:
1515
- hardware/07.opta/opta-family/opta
1616
---
1717

18-
![Arduino Opta Azure IoT Tutorial Hero Banner](hero-banner.png)
19-
2018
## Introduction
2119

22-
This tutorial demonstrates the integration of Arduino Opta with Azure IoT. You will proceed to create a reliable and secure IoT environment, harnessing the power of these two technologies.
20+
This tutorial demonstrates the integration of Opta with Azure IoT. You will proceed to create a reliable and secure IoT environment, harnessing the power of these two technologies.
2321

2422
## Goals
2523

26-
- **Initial Configuration:** Guide the user through the initial setup steps for Azure IoT and IoT Hub to establish a connection between Arduino Opta and Azure IoT.
24+
- **Initial Configuration:** Guide the user through the initial setup steps for Azure IoT and IoT Hub to establish a connection between Opta and Azure IoT.
2725

28-
- **Reliable Transmission:** How to reliably transmit data from Arduino Opta to Azure IoT.
26+
- **Reliable Transmission:** How to reliably transmit data from Opta to Azure IoT.
2927

3028
## Required Hardware and Software
3129

@@ -67,7 +65,7 @@ Open the Library Manager from the menu **Sketch->Include Library->Manage Librari
6765

6866
Search for the "Azure SDK for C" library using the Library Manager's search feature.
6967

70-
![Arduino Opta Azure IoT Tutorial Library Manager](assets/opta-azure-iot-tutorial-213345.png)
68+
![Opta Azure IoT Tutorial Library Manager](assets/opta-azure-iot-tutorial-213345.png)
7169

7270

7371
## Azure IoT Instructions
@@ -78,19 +76,19 @@ Sign in to your Microsoft account from the [Azure portal](https://portal.azure.c
7876

7977
You will be presented with the home page where you can add resources to your subscription.
8078

81-
![Arduino Opta Azure IoT Tutorial 1](assets/opta-azure-iot-tutorial-194248.png)
79+
![Home page of Azure IoT Portal](assets/opta-azure-iot-tutorial-194248.png)
8280

8381
You'll need to add an IoT Hub to your subscription, so click on **Create a resource**, and the Azure resource store will appear.
8482

85-
![Arduino Opta Azure IoT Tutorial 2](assets/opta-azure-iot-tutorial-194314.png)
83+
![Create a resource page inside Azure IoT Portal](assets/opta-azure-iot-tutorial-194314.png)
8684

8785
You can use the search function to search for the keyword **"iot hub"**.
8886

89-
![Arduino Opta Azure IoT Tutorial 3](assets/opta-azure-iot-tutorial-194413.png)
87+
![Marketplace inside sAzure IoT Portal](assets/opta-azure-iot-tutorial-194413.png)
9088

9189
Among the search results, the resource we're interested in, IoT Hub, will appear as the first result. Click on **Create** to start creating your IoT Hub.
9290

93-
![Arduino Opta Azure IoT Tutorial 4](assets/opta-azure-iot-tutorial-194518.png)
91+
![Click on IoT hub and fill the required information](assets/opta-azure-iot-tutorial-194518.png)
9492

9593
To create the new IoT Hub, fill in all the required fields on the page.
9694

@@ -102,35 +100,35 @@ To create the new IoT Hub, fill in all the required fields on the page.
102100

103101
The daily message limit for the **Free** plan is 8,000 and cannot be changed otherwise.
104102

105-
After entering all the necessary information, you should have something similar to this:
103+
After entering all the necessary information, you should have something similar to the following images:
106104

107-
![Arduino Opta Azure IoT Tutorial 5](assets/opta-azure-iot-tutorial-194559.png)
105+
![IoT hub configuration - Create a new Resource group](assets/opta-azure-iot-tutorial-194559.png)
108106

109-
![Arduino Opta Azure IoT Tutorial 5](assets/opta-azure-iot-tutorial-195158.png)
107+
![Iot hub configuration - Be sure to check the Tier plan more convenient to you](assets/opta-azure-iot-tutorial-195158.png)
110108

111109
After entering all the necessary information, you can click on **Review + create**, skipping the other configurations.
112110

113111
A final summary prompts you to check that the entered information is correct, after which you can click on **Create** to complete the Hub creation and move on to the next steps.
114112

115-
![Arduino Opta Azure IoT Tutorial 6](assets/opta-azure-iot-tutorial-195244.png)
113+
![Final summary showing the information filled](assets/opta-azure-iot-tutorial-195244.png)
116114

117-
![Arduino Opta Azure IoT Tutorial 6](assets/opta-azure-iot-tutorial-194452.png)
115+
![Overview page of your new IoT Hub subscription](assets/opta-azure-iot-tutorial-194452.png)
118116

119117
You will be redirected to the creation and registration status page of the new IoT Hub; the operation takes a few moments.
120118

121-
![Arduino Opta Azure IoT Tutorial 7](assets/opta-azure-iot-tutorial-195326.png)
119+
![Deployment page](assets/opta-azure-iot-tutorial-195326.png)
122120

123121
Subsequently, you will receive a message confirming that the IoT Hub is created and configured.
124122

125-
![Arduino Opta Azure IoT Tutorial 8](assets/opta-azure-iot-tutorial-195443.png)
123+
![Deployment complete screen](assets/opta-azure-iot-tutorial-195443.png)
126124

127125
You can click on **Go to resource** to access the IoT Hub dashboard.
128126

129-
![Arduino Opta Azure IoT Tutorial 9](assets/opta-azure-iot-tutorial-195509.png)
127+
![IoT Hub Dashboard](assets/opta-azure-iot-tutorial-195509.png)
130128

131-
Now you can add a device to your Hub; the new device will allow the connection to your Arduino Opta. To add a new device, click on **Devices** under the **Device management** section on the left side of your Hub.
129+
Now you can add a device to your Hub; the new device will allow the connection to your Opta. To add a new device, click on **Devices** under the **Device management** section on the left side of your Hub.
132130

133-
![Arduino Opta Azure IoT Tutorial 10](assets/opta-azure-iot-tutorial-195552.png)
131+
![Devices screen](assets/opta-azure-iot-tutorial-195552.png)
134132

135133
On the page that appears, click on **Add Device**.
136134

@@ -140,43 +138,41 @@ On the page that appears, click on **Add Device**.
140138

141139
You will then have a page with fields filled in similar to this:
142140

143-
![Arduino Opta Azure IoT Tutorial 11](assets/opta-azure-iot-tutorial-195652.png)
141+
![Creation of a new device](assets/opta-azure-iot-tutorial-195652.png)
144142

145143
By clicking on **Save**, you will be redirected back to the list of devices.
146144

147-
![Arduino Opta Azure IoT Tutorial 12](assets/opta-azure-iot-tutorial-195718.png)
145+
![New device created is now listed](assets/opta-azure-iot-tutorial-195718.png)
148146

149-
Click on the name of the newly created device in the list of devices associated with your Hub. The device configuration page will be displayed. You don't need to make any changes to this page, but you will need to use the information provided on this page in the sketch to be uploaded to Arduino Opta.
147+
Click on the name of the newly created device in the list of devices associated with your Hub. The device configuration page will be displayed. You don't need to make any changes to this page, but you will need to use the information provided on this page in the sketch to be uploaded to Opta.
150148

151149
From the current page, the only information needed for the configuration is the **Device ID** and the **Primary key**. Once requested, you can easily copy them using the 'Copy' button next to each corresponding field.
152150

153-
![Arduino Opta Azure IoT Tutorial 13](assets/opta-azure-iot-tutorial-195821.png)
154-
155-
![Arduino Opta Azure IoT Tutorial 13](assets/opta-azure-iot-tutorial-201212.png)
151+
![Opta™ Azure IoT Tutorial 13](assets/opta-azure-iot-tutorial-195821.png)
156152

157153
The next step of the tutorial is dedicated to customizing and understanding the sample code.
158154

159155
## Sketch
160156

161157
### Introduction
162158

163-
In this section, some parts of the sample code provided by Microsoft are analyzed and explained, modified to be used correctly on Arduino Opta.
159+
In this section, some parts of the sample code provided by Microsoft are analyzed and explained, modified to be used correctly on Opta.
164160

165161
The original project example can be found in the official library repository, accessible from [this page](https://github.com/Azure/azure-sdk-for-c-arduino/blob/main/examples/Azure_IoT_Hub_PortentaH7/Azure_IoT_Hub_PortentaH7.ino).
166162

167-
The example modified for Arduino Opta is available [here](assets/opta-azure-iot-tutorial-sketch.zip).
163+
The example modified for Opta is available [here](assets/opta-azure-iot-tutorial-sketch.zip).
168164

169165
### Sketch Configuration for Connection
170166

171-
To establish a connection to Azure IoT, you don't need to make many changes to your sketch. All the configurations necessary to make the transmission of data from Arduino Opta to the Microsoft cloud work are enclosed in a few lines of code.
167+
To establish a connection to Azure IoT, you don't need to make any changes to your sketch. All the configurations necessary to make the transmission of data from Opta to the Microsoft cloud work are enclosed in a few lines of code.
172168

173169
In particular, the information to be customized for the connection is represented by various **#define** in the **iot_configs.h** file.
174170

175-
![Arduino Opta Azure IoT Tutorial Sketch 1](assets/opta-azure-iot-tutorial-201329.png)
171+
![Opta Azure IoT Tutorial Sketch- Defines section](assets/opta-azure-iot-tutorial-201329.png)
176172

177173
You will need some of the information present on the device configuration page on Azure. As mentioned earlier, you can copy the necessary information and modify the code accordingly:
178174

179-
```cpp
175+
``` arduino
180176
// Wifi
181177
#define IOT_CONFIG_WIFI_SSID "MyWifi" // Change it to your Wi-Fi network name
182178
#define IOT_CONFIG_WIFI_PASSWORD "12345678" // Change it to your Wi-Fi network password
@@ -192,32 +188,32 @@ The **IOT_CONFIG_WIFI_SSID** definition assumes the value of your Wi-Fi network'
192188

193189
Note that **IOT_CONFIG_IOTHUB_FQDN** contains the hostname, easily obtainable by copying the name of your IoT Hub. In the context of this tutorial, the chosen name is **MyOptaHub**.
194190

195-
The hostname that facilitates the connection of Arduino Opta to Azure IoT is consistently **azure-devices.net**. You will need to add the name of your hub before this hostname as follows: **MyHubID.azure-devices.net**. Consequently, for this tutorial, it becomes **MyOptaHub.azure-devices.net**.
191+
The hostname that facilitates the connection of Opta to Azure IoT is consistently **azure-devices.net**. You will need to add the name of your hub before this hostname as follows: **MyHubID.azure-devices.net**. Consequently, for this tutorial, it becomes **MyOptaHub.azure-devices.net**.
196192

197193
The **IOT_CONFIG_DEVICE_ID** definition specifies the device identifier, and for this tutorial, **MyOpta** was selected.
198194

199195
Finally, **IOT_CONFIG_DEVICE_KEY** requires entering the device's private key.
200196

201197
### Other Code Customizations
202198

203-
In the **iot_configs.h** file, you find a definition that allows indicating in milliseconds the time that must elapse between sending one telemetry message and the next. The relevant definition is **IOT_CONFIG_TELEMETRY_FREQUENCY_MS** at line 19.
199+
In the **iot_configs.h** file, you find a definition that allows indicating in milliseconds the time that must elapse between sending one telemetry message and the next. The relevant definition is **IOT_CONFIG_TELEMETRY_FREQUENCY_MS** on line 19.
204200

205-
In the code, it is set to 300,000 milliseconds, or 5 minutes:
201+
In the code, it is set to 300,000 milliseconds or 5 minutes:
206202

207-
![Arduino Opta Azure IoT Tutorial Sketch 1](assets/opta-azure-iot-tutorial-202105.png)
203+
![Opta Azure IoT Tutorial Sketch - Telemetry frequency](assets/opta-azure-iot-tutorial-202105.png)
208204

209-
```cpp
205+
``` arduino
210206
// Publish 1 message every 5 minutes
211207
#define IOT_CONFIG_TELEMETRY_FREQUENCY_MS 300000
212208
```
213209
You can customize the value in milliseconds to change the time interval between sending messages.
214210

215211
In the **Azure_IoT_Hub_Opta.ino** file, you find a portion of code represented by the **generateTelemetry()** function at line 329, which is called to allow sending the message to Azure IoT:
216212

217-
![Arduino Opta Azure IoT Tutorial Sketch 1](assets/opta-azure-iot-tutorial-202627.png)
213+
![Opta Azure IoT Tutorial Sketch - Telemetry payload](assets/opta-azure-iot-tutorial-202627.png)
218214

219215

220-
```cpp
216+
``` arduino
221217
/*
222218
* generateTelemetry:
223219
* Simulated telemetry.
@@ -237,7 +233,7 @@ You can modify this function by changing the value of **telemetryPayload** and s
237233

238234
You can modify this function to send a different message, for example, a classic "Hello, World":
239235

240-
```cpp
236+
``` arduino
241237
static char* generateTelemetry()
242238
{
243239
telemetryPayload = String("Hello, World!");
@@ -247,22 +243,22 @@ static char* generateTelemetry()
247243

248244
### Uploading the Sketch
249245

250-
If the modifications made to the code meet your requirements, you can upload the code to your Arduino Opta and check if a message confirming the successful sending of telemetry data is displayed in the serial monitor:
246+
If the modifications made to the code meet your requirements, you can upload the code to your Opta and check if a message confirming the successful sending of telemetry data is displayed in the serial monitor:
251247

252-
![Arduino Opta Azure IoT Tutorial Sketch 1](assets/opta-azure-iot-tutorial-213347.png)
248+
![Serial monitor messages](assets/opta-azure-iot-tutorial-213347.png)
253249

254250
You can verify the actual reception of messages from the dashboard of our IoT Hub:
255251

256-
![Arduino Opta Azure IoT Tutorial Sketch 1](assets/opta-azure-iot-tutorial-201604.png)
252+
![IoT Hub Dashboard receiving data from Opta™](assets/opta-azure-iot-tutorial-201604.png)
257253

258254
### Conclusion
259255

260-
In conclusion to this tutorial, we have explored and customized a sample sketch provided by Microsoft to enable the connection of Arduino Opta to Azure IoT. Here's a summary of the activities performed:
256+
In conclusion to this tutorial, we have explored and customized a sample sketch provided by Microsoft to enable the connection of Opta to Azure IoT. Here's a summary of the activities performed:
261257

262258
- **Analysis of the Sample Sketch:** We examined a sample sketch provided by Microsoft for connecting to Azure IoT, available in the official library repository.
263-
- **Modifications for Arduino Opta:** We made the necessary changes to the sketch to adapt it and use it correctly with Arduino Opta, customizing definitions and configurations.
259+
- **Modifications for Opta:** We made the necessary changes to the sketch to adapt it and use it correctly with Opta, customizing definitions and configurations.
264260
- **Azure IoT Configuration:** We explained how to obtain the necessary information from the device configuration on Azure IoT, including the hostname of your hub and the device key.
265261
- **Integration with Azure IoT Hub:** We illustrated the process of configuring the definitions in the `iot_configs.h` file, which manages Wi-Fi connection and communication with Azure IoT Hub.
266262
- **Code Customizations:** We provided guidance on further customizing the code, including adjusting the telemetry message sending interval and modifying the simulated data sent to Azure IoT.
267263

268-
The tutorial provides a detailed guide to connect Arduino Opta to Azure IoT, allowing the secure and reliable transmission of data. This is just a starting point, and further customizations can be made based on the specific needs of the project. Hoping that this tutorial has been helpful and has contributed to understanding the integration of Arduino Opta with Azure IoT.
264+
The tutorial provides a detailed guide to connect Opta to Azure IoT, allowing the secure and reliable transmission of data. This is just a starting point, and further customizations can be made based on the specific needs of the project. In case you want to dig deeper into the Azure IoT technology, check the [Azure IoT official documentation](https://learn.microsoft.com/en-us/azure/iot/).fSA

0 commit comments

Comments
 (0)