Skip to content

Commit 1f64f87

Browse files
Merge pull request #410 from arduino/main
update
2 parents ac76943 + 2bec1ad commit 1f64f87

File tree

1,023 files changed

+105907
-18941
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,023 files changed

+105907
-18941
lines changed

content/arduino-cloud/01.getting-started/01.iot-cloud-getting-started/iot-cloud-getting-started.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ The following boards connect to the Arduino IoT Cloud via Wi-Fi.
5757
- [MKR WiFi 1010](https://store.arduino.cc/arduino-mkr-wifi-1010)
5858
- [Nano RP2040 Connect](https://store.arduino.cc/nano-rp2040-connect)
5959
- [Nano 33 IoT](https://store.arduino.cc/arduino-nano-33-iot)
60+
- [GIGA R1 WiFi](https://store.arduino.cc/products/giga-r1-wifi)
6061
- [Portenta H7](https://store.arduino.cc/portenta-h7)
6162
- [Portenta H7 Lite Connected](https://store.arduino.cc/products/portenta-h7-lite-connected)
6263
- [Portenta Machine Control](https://store.arduino.cc/products/arduino-portenta-machine-control)
6364
- [Nicla Vision](https://store.arduino.cc/products/nicla-vision)
64-
- [Opta](https://docs.arduino.cc/hardware/opta).\*
65-
66-
\* The Opta is scheduled to be released soon, along with documentation how to use it. Read more at the [Opta communications page](https://store.arduino.cc/pages/opta).
65+
- [Opta](https://docs.arduino.cc/hardware/opta).
6766

6867
Connection via Wi-Fi is an easy alternative, and your credentials can safely be entered during the configuration of a project. This type of connection is most suitable for low-range projects, where you connect your board to the cloud via your home/work/school router.
6968

@@ -103,9 +102,7 @@ The Arduino IoT Cloud supports a wide range of third party boards based on the E
103102

104103
The Arduino IoT Cloud supports connection via Ethernet on a number of devices. The options to connect via Ethernet are the following:
105104
- Connect with the [Portenta H7](https://store.arduino.cc/products/portenta-h7) in combination with an Ethernet compatible carrier/shield (see below).
106-
- Connect with the [Opta](https://docs.arduino.cc/hardware/opta).\*
107-
108-
\* The Opta is scheduled to be released soon, along with documentation how to use it. Read more at the [Opta communications page](https://store.arduino.cc/pages/opta).
105+
- Connect with the [Opta](https://docs.arduino.cc/hardware/opta).
109106

110107
To connect with the **Portenta H7** board, you will need one of the following shields/carriers:
111108
- [Portenta Vision Shield Ethernet](https://store.arduino.cc/products/arduino-portenta-vision-shield-ethernet)
@@ -147,7 +144,7 @@ The journey always begin by creating a new **Thing**. In the Thing overview, we
147144

148145
### 4. Configuring a Device
149146

150-
Devices can easily be added and linked to a Thing. The Arduino IoT Cloud requires your computer to have the [Arduino Agent installed](https://create.arduino.cc/getting-started/plugin/welcome). The configuration process is quick and easy, and can be done by clicking on the **“Select device”** button in the Thing overview. Here, we can choose from any board that has been configured, or select the **“Configure new device”** option.
147+
Devices can easily be added and linked to a Thing. The Arduino IoT Cloud requires your computer to have the [Arduino Create Agent installed](https://create.arduino.cc/getting-started/plugin/welcome). The configuration process is quick and easy, and can be done by clicking on the **“Select device”** button in the Thing overview. Here, we can choose from any board that has been configured, or select the **“Configure new device”** option.
151148

152149
![Configuring a device.](assets/gs-device-attach.png)
153150

content/arduino-cloud/01.getting-started/02.technical-reference/iot-cloud-tech-ref.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The following boards connect to the Arduino IoT Cloud via Wi-Fi.
2525
- [MKR WiFi 1010](https://store.arduino.cc/arduino-mkr-wifi-1010)
2626
- [Nano RP2040 Connect](https://store.arduino.cc/nano-rp2040-connect)
2727
- [Nano 33 IoT](https://store.arduino.cc/arduino-nano-33-iot)
28+
- [GIGA R1 WiFi](https://store.arduino.cc/products/giga-r1-wifi)
2829
- [Portenta H7](https://store.arduino.cc/portenta-h7)
2930
- [Portenta H7 Lite Connected](https://store.arduino.cc/products/portenta-h7-lite-connected)
3031
- [Nicla Vision](https://store.arduino.cc/products/nicla-vision)

content/arduino-cloud/01.getting-started/04.api-overview/api-overview.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,62 @@
22
title: Arduino IoT Cloud APIs
33
description: Arduino IoT Cloud has two different set of APIs. Read below to learn more
44
author: Karl Söderby, Fabrizio Mirabito
5-
tags: [IoT Cloud, API, JavaScript]
5+
tags: [IoT Cloud, Device API, Application API, JavaScript]
66
---
7+
78
The [Arduino IoT Cloud](https://create.arduino.cc/iot/) has different sets of APIs that provide different functionalities. This article serves as an introduction to how to work and what you can achieve with them.
89

9-
## Configuration API
10-
### What you can achieve
11-
The main goal of Configuration API is to allow you to create and manage IoT resources like dashboards, devices, things, and variables, along with the retrieval and handling of historical data coming from your IoT Devices. The core of those APIs is organized around [REST](http://en.wikipedia.org/wiki/Representational_State_Transfer). Our API has predictable resource-oriented URLs, accepts [form-encoded](https://en.wikipedia.org/wiki/POST_(HTTP)#Use_for_submitting_web_forms) request bodies, returns [JSON-encoded](http://www.json.org/) responses, and uses standard HTTP response codes, authentication, and verbs. You can use those APIs, both directly calling our HTTP endpoints or using our clients that wrap those calls into easy-to-use abstractions like objects and functions. We have Applications API clients available in `javascript`, `golang`, and `python`.
10+
## Application API
11+
12+
The main goal of the Application API is to allow you to create and manage IoT resources like dashboards, devices, things, and variables, along with the retrieval and handling of historical data coming from your IoT Devices.
1213

13-
To use the Configuration API, you need to create an **API Key** in the [API Keys](https://cloud.arduino.cc/home/api-keys) section.
14+
The core of those APIs is organized around [REST](http://en.wikipedia.org/wiki/Representational_State_Transfer). Our API has predictable resource-oriented URLs, accepts [form-encoded](https://en.wikipedia.org/wiki/POST_(HTTP)#Use_for_submitting_web_forms) request bodies, returns [JSON-encoded](http://www.json.org/) responses, and uses standard HTTP response codes, authentication, and verbs.
1415

15-
**Examples**
16+
You can use those APIs, both directly calling our HTTP endpoints or using our clients that wrap those calls into easy-to-use abstractions like objects and functions. We have Applications API clients available in `javascript`, `golang`, and `python`. To use the Application API, you need to create an **API Key** in the [API Keys](https://cloud.arduino.cc/home/api-keys) section.
1617

18+
With this API, you can:
1719
- Build an automated script to create your things, in bulk
1820
- Duplicate the configuration of things, dashboards, devices
1921
- Create your own personal web application to manage your resources
2022
- Build a script that reads your variables' data and provides custom analytics
2123

22-
You can find the full list of available resources and actions in the [Arduino IoT Cloud Configuration API Technical Reference](https://www.arduino.cc/reference/en/iot/api/).
24+
### Resources
25+
26+
You can find the full list of available resources and actions in the [Arduino IoT Cloud Application API Technical Reference](https://www.arduino.cc/reference/en/iot/api/).
27+
28+
***For learning how to successfully authenticate and interface with this API, visit the [Arduino Cloud REST API & SDK](https://docs.arduino.cc/arduino-cloud/getting-started/arduino-iot-api) article. Examples using JavaScript, Python and Golang are available here.***
2329

24-
## Data API
25-
Data API allows sending and receiving any kind of data (sensors' values, commands for actuators, configuration changes...) from and to IoT Devices and the Cloud. Under the hood, they
30+
## Device API
31+
32+
The **Device API** allows sending and receiving any kind of data (sensors' values, commands for actuators, configuration changes...) from and to IoT Devices and the Cloud. Under the hood, they:
2633

2734
- take care of the data exchange with our MQTT broker
2835
- handle best in class authentication & security
2936
- manage compression, data format, and transport protocols
3037

31-
### What you can achieve
38+
With this API, you can:
3239
- Send sensors' values to the cloud
3340
- Send and receive input and commands from and to dashboards
3441
- Listen for variables' values changes and act upon them
3542

36-
Inside this set of API, we have:
43+
As a wrapper for the Device API, we have the following libraries:
3744

3845
- An official Arduino IoT Cloud Library for your Arduino sketches: `ArduinoIoTCloud.h`
3946
- An NPM Javascript package: `arduino-iot-js`
4047

41-
**Arduino IoT Cloud Sketch library**
42-
As described above, is the Arduino library that allows your Arduino devices to connect and exchange data with the IoT Cloud. If you edit your sketch directly inside IoT Cloud or Cloud Editor, you don't need to install it: it comes out of the box.
48+
### Arduino IoT Cloud Sketch library
49+
50+
The Arduino (C++) library allows your Arduino devices to connect and exchange data with the IoT Cloud. If you use the Arduino Cloud online environment, you do not need to install this library.
51+
52+
This library is also available in the library manager for [Arduino IDE](https://www.arduino.cc/en/software). With a paid subscription, you can push/pull changes to your online sketches in the offline editor.
4353

4454
You can find more details at:
4555

4656
- The [official repository](https://github.com/arduino-libraries/ArduinoIoTCloud)
4757
- The [cheat sheet](https://docs.arduino.cc/arduino-cloud/getting-started/technical-reference)
4858

49-
**Arduino IoT JS**
59+
### Arduino IoT JS
60+
5061
The `arduino-iot-js` NPM module is designed for communicating with the Arduino IoT Cloud broker using the MQTT over Websocket protocol. It is primarily used to send and receive variable values.
5162

5263
Example:

content/arduino-cloud/01.getting-started/06.cloud-variables/cloud-variables.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,19 @@ You can use them just like a normal variable of the wrapped type, since they sup
182182

183183
The following variable types hold multiple values internally and are used to represent more complex data. In order to access such values, methods are provided.
184184

185+
#### CloudSchedule
186+
187+
`CloudSchedule` is used to check for an active state or to retrieve the timestamp.
188+
189+
| Description | Type | Read value |
190+
| ---------------------- | ------ | ----------------------- |
191+
| Check for active state | `bool` | `x.isActive()` |
192+
| From (start date) | `int` | `x.getCloudValue().frm` |
193+
| To (end date)\* | `int` | `x.getCloudValue().to` |
194+
| Length of Timestamp | `int` | `x.getCloudValue().len` |
195+
196+
\*If no end date is selected, value is defaulted to `0`.
197+
185198
#### DimmedLight
186199

187200
Declared as `CloudDimmedLight x;`
@@ -195,24 +208,26 @@ Declared as `CloudDimmedLight x;`
195208

196209
Declared as `CloudColoredLight x;`
197210

198-
| Property | Type | Read value | Set value |
199-
| ---------- | --------------- | ------------------- | ------------------- |
200-
| Switch | `bool` | `x.getSwitch()` | `x.setSwitch()` |
201-
| Hue | `float` (0-360) | `x.getHue()` | `x.setHue()` |
202-
| Saturation | `float` (0-100) | `x.getSaturation()` | `x.setSaturation()` |
203-
| Brightness | `float` (0-100) | `x.getBrightness()` | `x.setBrightness()` |
211+
| Property | Type | Read value | Set value |
212+
| ---------- | ----------------- | ------------------- | ------------------- |
213+
| Switch | `bool` | `x.getSwitch()` | `x.setSwitch()` |
214+
| Hue | `float` (0-360) | `x.getHue()` | `x.setHue()` |
215+
| Saturation | `float` (0-100) | `x.getSaturation()` | `x.setSaturation()` |
216+
| Brightness | `float` (0-100) | `x.getBrightness()` | `x.setBrightness()` |
217+
| Color | `uint8_t` (0-255) | `x.getRGB(r,g,b)` | `x.setRGB(r,g,b)` |
204218

205219
#### CloudColor
206220

207221
Declared as `CloudColor x;`.
208222

209223
To read the Color values, we can use the following method `Color colorValues = x.getValue();`. This will assign the hue, saturation, and brightness values to the `colorValues` variable.
210224

211-
| Property | Type | Read value | Set value |
212-
| ---------- | ------- | ----------------- | -------------------------------------- |
213-
| Hue | `float` | `colorValues.hue` | `x = Color(hue,saturation,brightness)` |
214-
| Saturation | `float` | `colorValues.sat` | `x = Color(hue,saturation,brightness)` |
215-
| Brightness | `float` | `colorValues.bri` | `x = Color(hue,saturation,brightness)` |
225+
| Property | Type | Read value | Set value |
226+
| ---------- | ----------------- | ----------------- | -------------------------------------- |
227+
| Hue | `float` (0-360) | `colorValues.hue` | `x = Color(hue,saturation,brightness)` |
228+
| Saturation | `float` (0-100) | `colorValues.sat` | `x = Color(hue,saturation,brightness)` |
229+
| Brightness | `float` (0-100) | `colorValues.bri` | `x = Color(hue,saturation,brightness)` |
230+
| Color | `uint8_t` (0-255) | `x.getRGB(r,g,b)` | `x.set(r,g,b)` |
216231

217232
To set the color, we can assign the CloudColor variable directly to float variables `x = {hue,saturation,brightness}`, or using the method ` x = Color(hue,saturation,brightness)`.
218233

Loading
Loading
Loading

content/arduino-cloud/01.getting-started/06.dashboard-widgets/dashboard-widgets.md

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,49 @@ The chart widget is great for data analytics. It is used to track real time data
318318
An example of how it is used in a sketch:
319319

320320
```arduino
321-
locationChart = analogRead(A0);
321+
variable = analogRead(A0);
322322
```
323323

324+
### Advanced Chart
325+
326+
![Advanced Chart Widget](assets/widget-advanced-chart.gif)
327+
328+
The advanced chart widget allows you to track up to **5 variables simultaneously**. This widget also includes an additional configuration interface that appears while editing the widget.
329+
330+
![Widget Configuration](assets/widget-advanced-chart-2.png)
331+
332+
An example of how it is used in code:
333+
334+
```arduino
335+
variable_1 = analogRead(A1)
336+
variable_2 = analogRead(A2)
337+
variable_3 = analogRead(A3)
338+
variable_4 = analogRead(A4)
339+
variable_5 = analogRead(A5)
340+
```
341+
342+
***Check out the [Advanced Chart](/arduino-cloud/features/advanced-chart) guide for more information.***
343+
344+
### Scheduler
345+
346+
![Scheduler Widget](assets/widget-scheduler.png)
347+
348+
The Scheduler Widget allows you to schedule a job in the future. With this widget, you can schedule:
349+
- A job to activate at a specific hour, minute and second.
350+
- A job to execute only on specific days.
351+
- A job that should last for X amount of seconds, minutes or hours.
352+
353+
In a sketch, use the `x.isActive()` boolean to check whether a state is active.
354+
355+
Example:
356+
357+
```arduino
358+
if(scheduleVariable.isActive){}
359+
```
360+
361+
362+
***Check out the [Scheduler](/arduino-cloud/features/cloud-scheduler) guide for more information.***
363+
324364
### Sticky Note
325365

326366
![Sticky Note](assets/widget-sticky-note.png)
@@ -329,3 +369,38 @@ The sticky note widget can be used to write important notes or to categorize you
329369

330370
The sticky note can **not** be linked with a variable, and is designed to keep notes only while using a dashboard. It does support the use of markdown, so that you can create titles, links, code blocks etc.
331371

372+
### Value Selector
373+
374+
![Value Selector](assets/widget-value-picker.png)
375+
376+
The value selector widget can be used to switch between predetermined values through available buttons. Supported variable types are `int` and `String`.
377+
378+
Example:
379+
380+
```arduino
381+
if(valueSelector == 0){
382+
//if value matches, execute code
383+
}
384+
385+
if(valueSelector == "string"){
386+
//if string matches, execute code
387+
}
388+
```
389+
390+
### Value Dropdown
391+
392+
![Value Dropdown](assets/widget-dropdown.png)
393+
394+
The value dropdown widget works similarly to **value selector**, and is be used to switch between predetermined values through a dropdown menu. Supported variable types are `int` and `String`.
395+
396+
Example:
397+
398+
```arduino
399+
if(valueDropDown == 0){
400+
//if value matches, execute code
401+
}
402+
403+
if(valueDropDown == "string"){
404+
//if string matches, execute code
405+
}
406+
```

content/arduino-cloud/01.getting-started/07.arduino-cloud-cli/arduino-cloud-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ arduino-cloud-cli ota mass-upload --fqbn <deviceFQBN> --device-tags <key0>=<valu
410410
When uploading a sketch using OTA, you will need to compile the binary file (`.bin`) first. This is **not** a feature in the `arduino-cloud-cli`, so you will need to use the following options:
411411

412412
- [Arduino CLI](https://arduino.github.io/arduino-cli/)
413-
- [Arduino IDE 1.8.x or 2.0](https://www.arduino.cc/en/software)
413+
- [Arduino IDE](https://www.arduino.cc/en/software)
414414

415415
#### Compile with Arduino CLI
416416

Loading
Loading
Loading

0 commit comments

Comments
 (0)