Skip to content

Commit 1903a79

Browse files
committed
Merge remote-tracking branch 'docs-private/main' into marqdevx/nicla-voice/launch
2 parents b0faad9 + 6062206 commit 1903a79

File tree

501 files changed

+333815
-9880
lines changed

Some content is hidden

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

501 files changed

+333815
-9880
lines changed

.github/workflows/deploy-prd.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ jobs:
2222
cache: "npm"
2323
cache-dependency-path: "**/package-lock.json"
2424

25+
- name: Render Datasheets
26+
run: cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering;./render-datasheets.sh
27+
28+
- name: Copy Static Files
29+
run: |
30+
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts
31+
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
32+
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
33+
find ./content/hardware -type f -name "*-full-pinout.pdf" -exec cp {} ./static/resources/pinouts/ \;
34+
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
35+
2536
- name: Gatsby main cache
2637
uses: actions/cache@v2
2738
id: gatsby-cache-folder
@@ -41,8 +52,7 @@ jobs:
4152
${{ runner.os }}-public-gatsby-
4253
4354
- run: npm install
44-
45-
- run: GENERATE_DATASHEETS=true npm run build
55+
- run: npm run build
4656

4757
- name: Configure AWS Credentials
4858
uses: aws-actions/configure-aws-credentials@v1

.github/workflows/deploy-stg.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ jobs:
2020
node-version: 14
2121
cache: "npm"
2222
cache-dependency-path: "**/package-lock.json"
23+
24+
- name: Render Datasheets
25+
run: cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering;./render-datasheets.sh
26+
27+
- name: Copy Static Files
28+
run: |
29+
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts
30+
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
31+
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
32+
find ./content/hardware -type f -name "*-full-pinout.pdf" -exec cp {} ./static/resources/pinouts/ \;
33+
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
2334
2435
- name: Gatsby main cache
2536
uses: actions/cache@v2
@@ -40,8 +51,7 @@ jobs:
4051
${{ runner.os }}-public-gatsby-
4152
4253
- run: npm install
43-
44-
- run: GENERATE_DATASHEETS=true npm run build
54+
- run: npm run build
4555

4656
- name: Configure AWS Credentials
4757
uses: aws-actions/configure-aws-credentials@v1
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Render datasheets
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
render-datasheets:
8+
runs-on: ubuntu-latest
9+
env:
10+
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: 14
17+
cache: "npm"
18+
cache-dependency-path: "**/package-lock.json"
19+
20+
- name: Render
21+
run: |
22+
cd scripts/datasheet-rendering
23+
./render-datasheets.sh

.github/workflows/sync-pull-request.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Sync PR
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.SYNC_GITHUB_CLI_TOKEN }}
31-
run: gh pr create --title "$(gh pr view $GITHUB_REF_NAME --json title --jq .title)" --body "$(gh pr view $GITHUB_REF_NAME --json body --jq .body)" --label "$(gh pr view $GITHUB_REF_NAME --json labels --jq .labels[].name)" --reviewer "$(gh pr view $GITHUB_REF_NAME --json reviewRequests --jq .reviewRequests[].login)" --label "arduino" --assignee "$(gh pr view $GITHUB_REF_NAME --json assignees --jq .assignees[].login)" --repo arduino/docs-content
31+
run: gh pr create --repo arduino/docs-content --head sync/${GITHUB_REF_NAME} --title "$(gh pr view $GITHUB_REF_NAME --json title --jq .title)" --body "$(gh pr view $GITHUB_REF_NAME --json body --jq .body)" --label "$(gh pr view $GITHUB_REF_NAME --json labels --jq .labels[].name)" --reviewer "$(gh pr view $GITHUB_REF_NAME --json reviewRequests --jq .reviewRequests[].login)" --label "arduino" --assignee "$(gh pr view $GITHUB_REF_NAME --json assignees --jq .assignees[].login)"
3232

3333
- name: Close PR
3434
env:

.vscode/tasks.json

+13-10
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"cwd": "${workspaceFolder}${pathSeparator}scripts${pathSeparator}validation"
8888
},
8989
"windows": {
90-
"command": "node .\\fix-issues.js -p ..\\..\\content\\hardware\\"
90+
"command": "node .\\fix-issues.js -p '..\\..\\content\\hardware\\'"
9191
},
9292
"group": "none",
9393
"presentation": {
@@ -97,14 +97,14 @@
9797
"problemMatcher": []
9898
},
9999
{
100-
"label": "Generate all datasheets",
100+
"label": "Render all datasheets",
101101
"type": "shell",
102-
"command": "./generate-datasheets.sh",
102+
"command": "./render-datasheets.sh",
103103
"options": {
104-
"cwd": "${workspaceFolder}${pathSeparator}scripts${pathSeparator}datasheet-generator"
104+
"cwd": "${workspaceFolder}${pathSeparator}scripts${pathSeparator}datasheet-rendering"
105105
},
106106
"windows": {
107-
"command": ".\\generate-datasheets.cmd"
107+
"command": ".\\render-datasheets.cmd"
108108
},
109109
"group": "none",
110110
"presentation": {
@@ -114,14 +114,14 @@
114114
"problemMatcher": []
115115
},
116116
{
117-
"label": "Generate datasheet (current document)",
117+
"label": "Render datasheet (current document)",
118118
"type": "shell",
119-
"command": "./generate-datasheets.sh '../../${relativeFileDirname}'",
119+
"command": "./render-datasheets.sh '../../${relativeFileDirname}'",
120120
"options": {
121-
"cwd": "${workspaceFolder}${pathSeparator}scripts${pathSeparator}datasheet-generator"
121+
"cwd": "${workspaceFolder}${pathSeparator}scripts${pathSeparator}datasheet-rendering"
122122
},
123123
"windows": {
124-
"command": ".\\generate-datasheets.cmd '..\\..\\${relativeFileDirname}'"
124+
"command": ".\\render-datasheets.cmd '..\\..\\${relativeFileDirname}'"
125125
},
126126
"group": "none",
127127
"presentation": {
@@ -138,7 +138,7 @@
138138
"cwd": "${workspaceFolder}"
139139
},
140140
"windows": {
141-
"command": ".\\scripts\\spell-check.cmd"
141+
"command": ".\\scripts\\spell-check.cmd"
142142
},
143143
"group": "none",
144144
"presentation": {
@@ -163,6 +163,9 @@
163163
"options": {
164164
"cwd": "${workspaceFolder}"
165165
},
166+
"windows": {
167+
"command": ".\\scripts\\spell-check-fix.cmd"
168+
},
166169
"group": "none",
167170
"presentation": {
168171
"reveal": "always",

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ symbolic link created for AnalogInput <<===>> ..\..\..\..\..\built-in-examples\0
8383
### Including Code Snippets
8484

8585
Code snippets can be included by using the triple backticks syntax e.g. ` ```arduino` followed by the code and three closing backticks. The following syntaxes are supported:
86+
```
8687
arduino, bash, markup, clike, c, cpp, css, css-extras, javascript, jsx, js-extras, coffeescript, diff, git, go, graphql, handlebars, json, less, makefile, markdown, objectivec, ocaml, python, reason, sass, scss, sql, stylus, tsx, typescript, wasm, yaml
88+
```
8789

8890

8991
## Previewing Changes
Loading

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

+21
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ The following boards connect to the Arduino IoT Cloud via Wi-Fi.
5959
- [Nano 33 IoT](https://store.arduino.cc/arduino-nano-33-iot)
6060
- [Portenta H7](https://store.arduino.cc/portenta-h7)
6161
- [Portenta H7 Lite Connected](https://store.arduino.cc/products/portenta-h7-lite-connected)
62+
- [Portenta Machine Control](https://store.arduino.cc/products/arduino-portenta-machine-control)
6263
- [Nicla Vision](https://store.arduino.cc/products/nicla-vision)
64+
- [Opta](https://docs.arduino.cc/hardware/opta).\*
6365

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).
6467

6568
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.
6669

@@ -96,6 +99,24 @@ The Arduino IoT Cloud supports a wide range of third party boards based on the E
9699

97100
***To learn more about ESP32/ESP8266 support and how to set it up, visit the [Connecting ESP32 & ESP8266 to Arduino Cloud IoT](/cloud/iot-cloud/tutorials/esp-32-cloud) guide.***
98101

102+
### Ethernet
103+
104+
The Arduino IoT Cloud supports connection via Ethernet on a number of devices. The options to connect via Ethernet are the following:
105+
- 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).
109+
110+
To connect with the **Portenta H7** board, you will need one of the following shields/carriers:
111+
- [Portenta Vision Shield Ethernet](https://store.arduino.cc/products/arduino-portenta-vision-shield-ethernet)
112+
- [Portenta Machine Control](https://store.arduino.cc/portenta-machine-control)
113+
114+
To enable communication via Ethernet with the Portenta H7, while configuring your device, you need to select the "Ethernet" option. If your device is already configured as a Wi-Fi device, you need to remove it before configuring it to Ethernet communication.
115+
116+
![Choose the Ethernet option.](assets/ethernet.png)
117+
118+
***Please note that older hardware such as the [Ethernet Shield Rev2](https://store.arduino.cc/products/arduino-ethernet-shield-2) and [MKR ETH Shield](https://store.arduino.cc/products/arduino-mkr-eth-shield) are currently not supported by the Arduino IoT Cloud.***
119+
99120
## Support
100121

101122
If you have any problems with the Arduino IoT Cloud, you can browse through common troubleshooting issues and find information on different features in the **Arduino Help Center**. If you don’t find the answer you are looking for, we are always happy to help you with any question regarding our products!

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

+78-18
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,19 @@ This feature allows Arduino devices to communicate with each other by sharing va
131131
Using this feature you can link variables of the same data type between **two or more cloud-enabled devices**, and Arduino IoT Cloud will automatically ensure any change to their value is propagated among all linked boards.
132132
For example, one button could set three smart bulbs to the same color by just setting a variable on one device and reading it on the others. Or you could turn on a heater when temperature sensors in your room or outside in your weather station drop below a certain level.
133133

134+
### Local Time
135+
136+
To retrieve local time, use the `ArduinoCloud.getLocalTime()` method in your sketch. The value returned represents the current local time expressed as a Unix timestamp (i.e. seconds from the epoch), and it automatically takes your time zone settings and DST (Daylight Saving Time) into account. Time zone can be set in the Thing configuration page within the Arduino IoT Cloud platform.
137+
138+
The returned timestamp can be displayed in a dashboard using a `CloudTime` variable and the [Time Picker widget](/arduino-cloud/getting-started/technical-reference#time-picker), or can be parsed with a third-party library such as [Time](https://www.arduino.cc/reference/en/libraries/time/) in case you want to show it on a display.
139+
140+
```arduino
141+
myTimeVariable = ArduinoCloud.getLocalTime()
142+
```
143+
144+
***Note that when using a board equipped with a hardware Real-Time Clock (RTC) the [Arduino_IoTCloud](https://github.com/arduino-libraries/ArduinoIoTCloud) library will use it automatically, thus communicating with the RTC from within your sketch or other libraries is not recommended. You can use the `getLocalTime()` and `getInternalTime()` methods provided by Arduino_IoTCloud instead.
145+
***
146+
134147
## Things
135148

136149
In order to use your devices in IoT Cloud, you need to associate a Thing to each of them. A Thing is an abstract concept which holds the configuration of the variables and other settings, as well as the history of the data collected for the variables.
@@ -153,7 +166,7 @@ The steps below can be used as guidance when **setting up a Thing**:
153166

154167
## Variables
155168

156-
***Visit the main article on [Cloud Variables](arduino-cloud/getting-started/cloud-variables) for a more detailed coverage.***
169+
***Visit the main article on [Cloud Variables](/arduino-cloud/getting-started/cloud-variables) for a more detailed coverage.***
157170

158171
A thing can have one or more variables. A variable can be used for multiple purposes:
159172

@@ -295,42 +308,89 @@ One or more **Things** can be added to a **Dashboard**, with all or some of thei
295308

296309
![Create widgets from a Thing](./images/create-widget-from-thing.png)
297310

298-
***You can read more about [Dashboards & Widgets]().***
311+
***You can read more about [Dashboards & Widgets](/arduino-cloud/getting-started/dashboard-widgets).***
299312

300313
## Recommended Code Practices
301314

302-
### Avoid blocking commands within the loop()
315+
This section highlights some important aspects of writing code with regard to the implementations in the [ArduinoIoTCloud](https://github.com/arduino-libraries/ArduinoIoTCloud).
316+
317+
### Watchdog Timer (WDT)
318+
319+
All IoT Cloud sketches use a **Watchdog Timer (WDT)** by default. The WDT can be used to automatically recover from hardware faults or unrecoverable software errors.
320+
321+
A WDT is essentially a countdown timer, whereas it starts counting from a set value, and upon reaching zero, it resets the board. To prevent it from reaching zero, we continuously call it from the `loop()`, using the `ArduinoCloud.update()` function.
322+
323+
This is why, it is very important to not use any long blocking code in your sketch. For example, using a long `delay()` inside the `loop()` is **strongly discouraged**, as the WDT can reach zero and reset the board.
324+
325+
The WDT can however be disabled inside of the `setup()` function, by adding the `false` parameter:
326+
327+
```arduino
328+
ArduinoCloud.begin(ArduinoIoTPreferredConnection, false).
329+
```
330+
331+
***You can view the source code of this implementation [here](https://github.com/arduino-libraries/ArduinoIoTCloud/tree/master/src/utility/watchdog).***
332+
333+
### Alternatives to Delays
303334

304335
The `loop()` function includes the `ArduinoCloud.update();` call, which sends data to the cloud and receives updates. In order to get the best responsiveness in your cloud-connected projects, the `loop()` function should run as fast as possible. This means that no blocking commands should be used inside, and you should prefer a non-blocking programming approach whenever possible.
305336

306337
A common **blocking pattern** is the use of the `delay()` function which stops the execution of the function for the given time. We strongly advise to **get rid of this function** and achieve the same behavior in a non-blocking way with the `millis()` function as described below.
307338

308339
Let's see how to blink a LED. The traditional way involves the `delay()` function:
309340

310-
void loop() {
311-
ArduinoCloud.update();
312-
313-
digitalWrite(LED_BUILTIN, HIGH);
314-
delay(1000);
315-
digitalWrite(LED_BUILTIN, LOW);
316-
delay(1000);
317-
}
341+
```arduino
342+
void loop() {
343+
ArduinoCloud.update();
344+
345+
digitalWrite(LED_BUILTIN, HIGH);
346+
delay(1000);
347+
digitalWrite(LED_BUILTIN, LOW);
348+
delay(1000);
349+
}
350+
```
318351

319352
This works, but it will cause a delay of at least two seconds between one execution of `ArduinoCloud.update()` and the next one, thus causing bad performance of the cloud communication.
320353

321354
This can be rewritten in a non-blocking way as follows:
322355

323-
void loop() {
324-
ArduinoCloud.update();
325-
326-
digitalWrite(LED_PIN, (millis() % 2000) < 1000);
327-
}
356+
```arduino
357+
void loop() {
358+
ArduinoCloud.update();
359+
360+
digitalWrite(LED_PIN, (millis() % 2000) < 1000);
361+
}
362+
```
328363

329364
How does this work? It gets the current execution time provided by `millis()` and divides it by 2 seconds. If the remainder is smaller than one second it will turn the LED on, and if it's greater it will turn the LED off.
330365

331366
For a more complex and commented example, you can have a look at the [BlinkWithoutDelay example](/built-in-examples/digital/BlinkWithoutDelay).
332367

333-
### Avoid waiting for Serial Monitor to initialize connection
368+
### I2C Usage
369+
370+
Components connected via I²C (including the sensors onboard the [MKR IoT Carrier](https://store.arduino.cc/products/arduino-mkr-iot-carrier)) uses the same bus as the **ECCX08** cryptochip. As the crypto chip is an essential part of establishing a connection to the IoT Cloud (it contains the credentials), it is important that other I²C peripherals are initialized after the connection has been made.
371+
372+
For example, if you are initializing a library such as [Arduino_MKRENV](https://www.arduino.cc/reference/en/libraries/arduino_mkrenv), your `setup()` should be implemented as:
373+
374+
```arduino
375+
void setup() {
376+
Serial.begin(9600);
377+
delay(1500);
378+
379+
initProperties();
380+
381+
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
382+
setDebugMessageLevel(2);
383+
ArduinoCloud.printDebugInfo();
384+
385+
//initializing the Arduino_MKRENV library
386+
if (!ENV.begin()) {
387+
Serial.println("Failed to initialize MKR ENV shield!");
388+
while (1);
389+
}
390+
```
391+
392+
393+
### Avoid Blocking Serial Communication
334394

335395
`while(!Serial) {}` loops endlessly until the Serial Monitor is opened. This is a useful practice in cases where you want to see all debug output from the start of the sketch execution. However, when building IoT systems using **`while(!Serial){}` can hinder our project from running autonomously**, stopping the board from connecting to the network and IoT Cloud before manually opening the Serial Monitor. Therefore, it is recommended to consider removing the `while(!Serial){}` loop if it's not necessary.
336396

@@ -345,7 +405,7 @@ We provide two Arduino Iot Cloud APIs:
345405

346406
The Arduino IoT Cloud REST API can be called just with any **HTTP Client**, or using one of these clients:
347407
- [Javascript NPM package](https://www.npmjs.com/package/@arduino/arduino-iot-client).
348-
- [Python PYPI Package](https://pypi.org/project/arduino-iot-client/).
408+
- [Python® PYPI Package](https://pypi.org/project/arduino-iot-client/).
349409
- [Golang Module](https://github.com/arduino/iot-client-go).
350410

351411
**2.** The second is the **Data API (MQTT)** which allows you to send/receive Variables' data. An example of this API's use is sending IoT Cloud Variables' updates to the browser. A full [documentation of the Arduino IoT Cloud Data API (MQTT)](https://www.npmjs.com/package/arduino-iot-js) is available for advanced users.

content/arduino-cloud/01.getting-started/04.cloud-lora-getting-started/cloud-lora-getting-started_.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ You can visit the [Activate an Arduino Pro Gateway with IoT Cloud](https://suppo
270270
### Migrate Existing Gateway
271271

272272

273-
If you had a gateway setup prior to the [A2A to TTS migration](linktoblogpost.com ), you will need to complete the following steps to use the Pro Gateway.
273+
If you had a gateway setup prior to the A2A to TTS migration, you will need to complete the following steps to use the Pro Gateway.
274274

275275
To perform the Arduino Pro gateway migration:
276276

0 commit comments

Comments
 (0)