Skip to content

Commit 519d3ad

Browse files
committed
Update IoT Cloud > Arduino Cloud
1 parent 9c6f027 commit 519d3ad

File tree

29 files changed

+175
-152
lines changed

29 files changed

+175
-152
lines changed

content/arduino-cloud/00.guides/03.micropython/content.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ Next step is to create some cloud variables, which we will later interact with v
6161
4. Create another variable, name it `ledSwitch` and select it to be `int` type.
6262

6363
You should now have **two variables**:
64-
- `test_switch`
65-
- `test_value`
64+
- `led` - boolean
65+
- `ledSwitch` - boolean
6666

6767
It is important that they are named exactly like this, as we will be using them in the example script of this guide.
6868

@@ -72,8 +72,23 @@ Your Thing should look something like this when you are finished:
7272

7373
***Learn more about how variables work in the [Variables documentation](/arduino-cloud/cloud-interface/variables)***
7474

75+
### Create Dashboard
76+
77+
When finished with creating your Thing, we also need to create a dashboard, a tool to monitor & interact with the cloud variables.
78+
79+
1. Go to the [dashboards](app.arduino.cc/dashboards) section, and **create a new dashboard.**
80+
2. In the dashboard, first create a **LED** widget, and link it to the `led` variable we created earlier.
81+
3. Create a **Switch** widget, and link it to `ledSwitch`.
82+
4. You should now have two widgets, looking something like the image below:
83+
84+
![Dashboard with LED & Switch widgets.](assets/dashboard.png)
85+
86+
We are now finished with the Arduino Cloud configuration, and we can proceed with the MicroPython setup.
87+
7588
## MicroPython Setup
7689

90+
In this section, we will install the [Arduino IoT Cloud Python](https://pypi.org/project/arduino-iot-cloud/) library on the Arduino board, and run a script that synchronizes the board with the Arduino Cloud.
91+
7792
### Create Secret.py File
7893

7994
During the [device configuration](#thing--device-configuration), you obtained a **device ID** and **secret key**. These details can be stored, along with your Wi-Fi® credentials, in a `secrets.py` file. Here is an example of how `secrets.py` should look like:
@@ -190,7 +205,7 @@ if __name__ == "__main__":
190205

191206
## Testing It Out
192207

193-
Open Arduino Lab for MicroPython and connect to your board. Pasting the above code and run the script. Then open your Arduino IoT Cloud dashboard. You should see the registered "ledSwitch" and "led" widgets. Toggle the "ledSwitch", and the LED on your Arduino board should light up accordingly. The state of the "led" variable should also change, mirroring the state of the physical LED.
208+
Open Arduino Lab for MicroPython and connect to your board. Pasting the above code and run the script. Then open your Arduino Cloud dashboard. You should see the registered "ledSwitch" and "led" widgets. Toggle the "ledSwitch", and the LED on your Arduino board should light up accordingly. The state of the "led" variable should also change, mirroring the state of the physical LED.
194209

195210
## Troubleshoot
196211

1.82 MB
Loading
1.61 MB
Loading

content/arduino-cloud/00.guides/04.python/assets/Screenshot 2023-10-24 at 16.02 1.png renamed to content/arduino-cloud/00.guides/04.python/assets/values.png

File renamed without changes.

content/arduino-cloud/00.guides/04.python/python.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: 'Python'
3-
description: 'Learn how to use the Python library to connect to the Arduino IoT Cloud.'
3+
description: 'Learn how to use the Python library to connect to the Arduino Cloud.'
44
tags:
55
- IoT
66
- Python
@@ -45,6 +45,8 @@ To begin with, we need to create a manual device, and create a new [Thing](/ardu
4545
3. Click on **"Set Up New Device"**, and select the bottom category (**"Manual Device"**). Click continue in the next window, and choose a name for your device.
4646
4. Finally, you will see a new **Device ID** and a **Secret Key** generate. You can download them as a PDF. Make sure to save it as you cannot access your Secret Key again.
4747

48+
![Device ID & Secret key.](assets/device-key.png)
49+
4850
- Learn more about Things in the [Things documentation](/arduino-cloud/cloud-interface/things)
4951
- Learn more about Devices in the [Devices documentation](/arduino-cloud/hardware/devices)
5052

@@ -59,6 +61,8 @@ Next step is to create some cloud variables, which we will later interact with v
5961

6062
You should now have **two variables**, `test_switch` and `test_value`. It is important that they are named exactly like this, as we will be using them in the example script of this guide.
6163

64+
![Complete Thing.](assets/thing.png)
65+
6266
- Learn more about how variables work in the [Variables documentation](/arduino-cloud/cloud-interface/variables)
6367

6468
***Variables that we create here can also be synchronized with variables running on any other device in the platform. This makes it possible to link an Arduino boards with a Python or JavaScript project without writing any connection code!***
@@ -74,7 +78,7 @@ python3 --version
7478

7579
### Install Packages
7680

77-
To install the [arduino-iot-cloud] client, run the following command:
81+
To install the Arduino IoT Cloud Python client, run the following command:
7882

7983
```
8084
pip install arduino-iot-cloud
1.82 MB
Loading
1.57 MB
Loading

content/arduino-cloud/00.guides/05.javascript/javascript.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ To begin with, we need to create a manual device, and create a new [Thing](/ardu
3737
3. Click on **"Set Up New Device"**, and select the bottom category (**"Manual Device"**). Click continue in the next window, and choose a name for your device.
3838
4. Finally, you will see a new **Device ID** and a **Secret Key** generate. You can download them as a PDF. Make sure to save it as you cannot access your Secret Key again.
3939

40+
![Device credentials.](assets/device-key.png)
41+
4042
- Learn more about Things in the [Things documentation](/arduino-cloud/cloud-interface/things)
4143
- Learn more about Devices in the [Devices documentation](/arduino-cloud/hardware/devices)
4244

@@ -50,6 +52,8 @@ Next step is to create a cloud variable, which we will later interact with in ou
5052

5153
You should now have a variable named `test_value`. It is important that it is named exactly like this, as we will be using it in the example script of this guide.
5254

55+
![Complete Thing.](assets/thing.png)
56+
5357
- Learn more about how variables work in the [Variables documentation](/arduino-cloud/cloud-interface/variables)
5458

5559
***Variables that we create here can also be synchronized with variables running on any other device in the platform. This makes it possible to link an Arduino boards with a Python or JavaScript project without writing any connection code!***

content/arduino-cloud/00.guides/06.node-red/nodered-intro.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ author: 'Liam Aljundi'
1313

1414
Node-RED is a programming tool for connecting hardware devices such as Arduino with other hardware devices, APIs, and online services easily using a web-based flow editor. It allows you to connect those different devices and services by connecting a combination of nodes that create your desired flow.
1515

16-
In this tutorial, we will look into the applications of using Node-RED together with the Arduino IoT Cloud. The integration of the two platforms allows us to facilitate communications between the Arduino IoT Cloud and home automation devices, send and receive data from online services such as Email and SMS, and write JavaScript code to manipulate the data.
16+
In this tutorial, we will look into the applications of using Node-RED together with the Arduino Cloud. The integration of the two platforms allows us to facilitate communications between the Arduino Cloud and home automation devices, send and receive data from online services such as Email and SMS, and write JavaScript code to manipulate the data.
1717

18-
***Note: this tutorial requires a [subscription to the Arduino IoT Cloud](https://cloud.arduino.cc/plans), all three subscriptions (Entry, Maker & Maker Plus) are valid.***
18+
***Note: this tutorial requires a [subscription to the Arduino Cloud](https://cloud.arduino.cc/plans), all three subscriptions (Entry, Maker & Maker Plus) are valid.***
1919

2020
## Goals
2121

22-
- Set up Node-RED with the Arduino IoT Cloud.
22+
- Set up Node-RED with the Arduino Cloud.
2323
- Use simple Flows with Node-RED.
24-
- Build a Node-RED Flow that pulls data from Arduino IoT Cloud.
25-
- Manipulate data received from the Arduino IoT Cloud using JavaScript code.
26-
- Send email notifications with data from the Arduino IoT Cloud.
24+
- Build a Node-RED Flow that pulls data from Arduino Cloud.
25+
- Manipulate data received from the Arduino Cloud using JavaScript code.
26+
- Send email notifications with data from the Arduino Cloud.
2727

2828
## Hardware & Software Requirements
2929

@@ -33,7 +33,7 @@ In this tutorial, we will look into the applications of using Node-RED together
3333

3434
For this tutorial, you will need a cloud compatible board. You will find all compatible boards in the link below:
3535

36-
- [Arduino IoT Cloud compatible hardware.](/cloud/iot-cloud/tutorials/iot-cloud-getting-started#compatible-hardware)
36+
- [Arduino Cloud compatible hardware.](/cloud/iot-cloud/tutorials/iot-cloud-getting-started#compatible-hardware)
3737

3838

3939
## Node-RED Setup
@@ -107,7 +107,7 @@ You can run the simple flow shown below using Node-RED's default nodes:
107107

108108
Your message should be printed to the console on the right side.
109109

110-
In addition to the default nodes installed in node-RED, you can use the palette manager to install additional nodes that can be useful to creating more advanced flows. Follow the steps below to install the Arduino IoT Cloud nodes using the palette manager:
110+
In addition to the default nodes installed in node-RED, you can use the palette manager to install additional nodes that can be useful to creating more advanced flows. Follow the steps below to install the Arduino Cloud nodes using the palette manager:
111111

112112
**1.** Click on the menu in the header bar in the top right corner.
113113

@@ -119,17 +119,17 @@ In addition to the default nodes installed in node-RED, you can use the palette
119119

120120
**5.** From the results, install **"@arduino/node-red-contrib-arduino-iot-cloud"**.
121121

122-
![Installing the Arduino IoT Cloud Palette](assets/nodered-03.gif)
122+
![Installing the Arduino Cloud Palette](assets/nodered-03.gif)
123123

124-
Now, you should be able to use the Arduino IoT Cloud nodes from the palette on the left side of the editor. There are five IoT Cloud nodes: property in, property out, historic, periodic, and inject. Each of the nodes has a description of its function, which appears when you hover over the node.
124+
Now, you should be able to use the Arduino Cloud nodes from the palette on the left side of the editor. There are five IoT Cloud nodes: property in, property out, historic, periodic, and inject. Each of the nodes has a description of its function, which appears when you hover over the node.
125125

126126
## Setting Up a Thing
127127

128128
The Thing we will create for this example is quite simple. It is a sketch to read humidity values from a **DHT11 humidity sensor**, any other values can be used alternatively, such as temperature, soil moisture, light etc. Keep in mind that the code and example below are specific to using the DHT11 humidity sensor.
129129

130130
Follow the steps below to set up the Thing:
131131

132-
- Go to the Arduino IoT Cloud -> Thing -> Create a Thing
132+
- Go to the Arduino Cloud -> Thing -> Create a Thing
133133
- Add your Device and your Network credentials
134134
- Add an integer Variable, with the name humidity, and set permissions to Read Only
135135
- Go to the **"Sketch"** tab and replace the code with the code below:
@@ -153,7 +153,7 @@ Follow the steps below to set up the Thing:
153153
// Defined in thingProperties.h
154154
initProperties();
155155
156-
// Connect to Arduino IoT Cloud
156+
// Connect to Arduino Cloud
157157
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
158158
159159
setDebugMessageLevel(2);
@@ -179,15 +179,15 @@ The final step is connecting the **DHT11 humidity sensor** to our Arduino MKR Wi
179179

180180
## Communicating with Node-RED
181181

182-
Use the steps below to use Node-RED with the Arduino IoT Cloud:
182+
Use the steps below to use Node-RED with the Arduino Cloud:
183183

184184
**1.** Go to the [API keys section](app.arduino.cc/home/api-keys), and create a new API key.
185185

186186
**2.** Save the Client ID and Client Secret in a safe document
187187

188188
**3.** Go to Node-RED web page at [http://localhost:1880](http://localhost:1880)
189189

190-
**4.** Add the Arduino IoT Cloud "**property out**" node from the palette menu on the left side
190+
**4.** Add the Arduino Cloud "**property out**" node from the palette menu on the left side
191191

192192
**5.** Double click on the node -> select "Add new Arduino-connection"
193193

@@ -201,11 +201,11 @@ Use the steps below to use Node-RED with the Arduino IoT Cloud:
201201

202202
### Creating a Flow
203203

204-
Now that you have a node pulling data from the Arduino IoT Cloud, you need to use the *Inject* node in order to manipulate and send the data. All you need to do is dragging the *Inject* node and connect it to the property out node, then double-clicking on the inject node to ensure that the right Thing and property are selected.
204+
Now that you have a node pulling data from the Arduino Cloud, you need to use the *Inject* node in order to manipulate and send the data. All you need to do is dragging the *Inject* node and connect it to the property out node, then double-clicking on the inject node to ensure that the right Thing and property are selected.
205205

206-
Finally, we will add a debug node from the top of the palette menu, to print the values coming from the Arduino IoT Cloud into the console. You will now be able to see the values from the humidity sensor printed into the Node-RED console.
206+
Finally, we will add a debug node from the top of the palette menu, to print the values coming from the Arduino Cloud into the console. You will now be able to see the values from the humidity sensor printed into the Node-RED console.
207207

208-
The next step is adding a **function node** that processes the data coming from the Arduino IoT Cloud. This node is important when working with a constant flow of data, as it allows you to use JavaScript code to create customized triggers from the received values. After dragging the function node into the editor, double-click on the node and select **"on message"** tab, then insert the code below:
208+
The next step is adding a **function node** that processes the data coming from the Arduino Cloud. This node is important when working with a constant flow of data, as it allows you to use JavaScript code to create customized triggers from the received values. After dragging the function node into the editor, double-click on the node and select **"on message"** tab, then insert the code below:
209209

210210
```js
211211
let data = msg.payload;
@@ -233,7 +233,7 @@ This code will only send values when they are above 60, or when they change back
233233

234234
### Sending Email Notifications
235235

236-
Now that you are able to pull and manipulate data from the Arduino IoT Cloud, it's time to use this data. In this example, we will show how to send alarm notifications to your email, using the Arduino IoT Cloud. To achieve this, we need to add an email nodes following the steps below:
236+
Now that you are able to pull and manipulate data from the Arduino Cloud, it's time to use this data. In this example, we will show how to send alarm notifications to your email, using the Arduino Cloud. To achieve this, we need to add an email nodes following the steps below:
237237

238238
- Click on the menu in the header bar in the top right corner.
239239
- Select **"Manage palette"**.
@@ -245,8 +245,8 @@ Next, drag the email node from the palette menu on the left side into the editor
245245

246246
![Email node](./assets/nodered-08.png)
247247

248-
Now, all you need to do is replace the debug node with the email node to receive email notifications with the humidity data received from the Arduino IoT Cloud. You can customize the emails using the function node if you wish.
248+
Now, all you need to do is replace the debug node with the email node to receive email notifications with the humidity data received from the Arduino Cloud. You can customize the emails using the function node if you wish.
249249

250250
## Further Applications
251251

252-
In this tutorial we demonstrated how you can use the [Arduino IoT Cloud](https://create.arduino.cc/iot/) together with [Node-RED](https://nodered.org/) to build a more complex automation applications. The email notification is only one of the many different use cases, other applications can be creating communication between the Arduino IoT Cloud to other home automation devices, sending customized SMS and WhatsApp messages, and many more.
252+
In this tutorial we demonstrated how you can use the [Arduino Cloud](app.arduino.cc) together with [Node-RED](https://nodered.org/) to build a more complex automation applications. The email notification is only one of the many different use cases, other applications can be creating communication between the Arduino Cloud to other home automation devices, sending customized SMS and WhatsApp messages, and many more.

0 commit comments

Comments
 (0)