Skip to content

Commit 0f4e02d

Browse files
Merge branch 'main' into kateryna-lukina/certification-updates
2 parents a017073 + 42bc2c0 commit 0f4e02d

File tree

1,063 files changed

+694858
-19350
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,063 files changed

+694858
-19350
lines changed

.github/workflows/deploy-prd.yml

Lines changed: 12 additions & 2 deletions
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

Lines changed: 12 additions & 2 deletions
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
Lines changed: 23 additions & 0 deletions
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

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ gatsby-*
66
node_modules
77
public
88
src
9-
.DS_Store
9+
.DS_Store
10+
.vscode/settings.json

.vscode/tasks.json

Lines changed: 13 additions & 10 deletions
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",

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ The docs.arduino.cc website is built from the Markdown sources hosted in this re
44

55
## How to Contribute
66

7-
In order to contribute new or updated documentation, you must first create a GitHub account and fork the original repository to your own account. You can make changes, save them in your repository, then [make a pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) against this repository. The pull request will appear [in the repository](https://github.com/arduino/docs.arduino.cc/pulls) where it can be assessed by the maintainers, copy edited, and if appropriate, merged.
7+
In order to contribute new or updated documentation, you must first create a GitHub account and fork the original repository to your own account. You can make changes, save them in your repository, then [make a pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) against this repository. The pull request will appear [in the repository](https://github.com/arduino/docs-content/pulls) where it can be assessed by the maintainers, copy edited, and if appropriate, merged.
88

9-
**NOTE:** Unless you are opening a pull request which will only make small corrections, for instance to correct a typo, you are more likely to get traction for your changes if you [open an issue](https://github.com/arduino/docs.arduino.cc/issues) first to discuss the proposed changes.
9+
**NOTE:** Unless you are opening a pull request which will only make small corrections, for instance to correct a typo, you are more likely to get traction for your changes if you [open an issue](https://github.com/arduino/docs-content/issues) first to discuss the proposed changes.
1010

1111
## Type of Content
1212

README.md

Lines changed: 2 additions & 0 deletions
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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,17 @@ To use the Arduino IoT Cloud, a **cloud compatible board** is required. You can
5353

5454
The following boards connect to the Arduino IoT Cloud via Wi-Fi.
5555

56-
- [MKR 1000 WiFi](https://store.arduino.cc/arduino-mkr1000-wifi)
56+
- [MKR 1000 WiFi](/hardware/mkr-1000-wifi)
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)
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

Lines changed: 82 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,30 @@ A shortcut to add a device is also provided in **"Things" page** as explained in
107107

108108
Below you will find a list of features that are available in the Arduino IoT Cloud.
109109

110-
### Uploading over-the-air (OTA)
110+
### Uploading Over-The-Air (OTA)
111111

112-
This feature allows for uploading sketches wirelessly to Arduino boards, without the need to connect the board physically. This feature is supported for the following **compatible Arduino boards**:
113-
114-
![Over The Air compatible boards](./images/ota_compatible_boards.png)
112+
This feature allows for uploading sketches wirelessly to Arduino boards, without the need to connect the board physically. This feature is supported for the following boards:
115113

116114
- [Arduino MKR WiFi 1010](https://store.arduino.cc/arduino-mkr-wifi-1010)
117115
- [Arduino NANO 33 IoT](https://store.arduino.cc/arduino-nano-33-iot)
118116
- [Arduino Nano RP2040 Connect](https://store.arduino.cc/products/arduino-nano-rp2040-connect-with-headers)
119117
- [Portenta H7](https://store.arduino.cc/products/portenta-h7)
118+
- Cloud compatible ESP32 boards (see list below).
119+
120+
#### Verified ESP32 Boards Supporting OTA
121+
122+
The following ESP32 boards have been tested and verified to support OTA:
123+
124+
- ESP32-S2-DevKitC
125+
- NODEMCU-32-S2
126+
- WEMOS LOLIN D32
127+
- ESP32-S3-DevKitC
128+
- WEMOS LOLIN D32
129+
- ESP32-CAM
130+
- NodeMCU-32S
131+
- Freenove ESP32 WROVER
132+
- ESP32-DevKitC32E
133+
- DOIT ESP32 DevKit v1
120134

121135
![Connecting the device with the OTA option](./images/device_OtA.png)
122136

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

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

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

313327
## Recommended Code Practices
314328

315-
### Avoid blocking commands within the loop()
329+
This section highlights some important aspects of writing code with regard to the implementations in the [ArduinoIoTCloud](https://github.com/arduino-libraries/ArduinoIoTCloud).
330+
331+
### Watchdog Timer (WDT)
332+
333+
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.
334+
335+
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.
336+
337+
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.
338+
339+
The WDT can however be disabled inside of the `setup()` function, by adding the `false` parameter:
340+
341+
```arduino
342+
ArduinoCloud.begin(ArduinoIoTPreferredConnection, false).
343+
```
344+
345+
***You can view the source code of this implementation [here](https://github.com/arduino-libraries/ArduinoIoTCloud/tree/master/src/utility/watchdog).***
346+
347+
### Alternatives to Delays
316348

317349
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.
318350

319351
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.
320352

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

323-
void loop() {
324-
ArduinoCloud.update();
325-
326-
digitalWrite(LED_BUILTIN, HIGH);
327-
delay(1000);
328-
digitalWrite(LED_BUILTIN, LOW);
329-
delay(1000);
330-
}
355+
```arduino
356+
void loop() {
357+
ArduinoCloud.update();
358+
359+
digitalWrite(LED_BUILTIN, HIGH);
360+
delay(1000);
361+
digitalWrite(LED_BUILTIN, LOW);
362+
delay(1000);
363+
}
364+
```
331365

332366
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.
333367

334368
This can be rewritten in a non-blocking way as follows:
335369

336-
void loop() {
337-
ArduinoCloud.update();
338-
339-
digitalWrite(LED_PIN, (millis() % 2000) < 1000);
340-
}
370+
```arduino
371+
void loop() {
372+
ArduinoCloud.update();
373+
374+
digitalWrite(LED_PIN, (millis() % 2000) < 1000);
375+
}
376+
```
341377

342378
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.
343379

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

346-
### Avoid waiting for Serial Monitor to initialize connection
382+
### I2C Usage
383+
384+
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.
385+
386+
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:
387+
388+
```arduino
389+
void setup() {
390+
Serial.begin(9600);
391+
delay(1500);
392+
393+
initProperties();
394+
395+
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
396+
setDebugMessageLevel(2);
397+
ArduinoCloud.printDebugInfo();
398+
399+
//initializing the Arduino_MKRENV library
400+
if (!ENV.begin()) {
401+
Serial.println("Failed to initialize MKR ENV shield!");
402+
while (1);
403+
}
404+
```
405+
406+
407+
### Avoid Blocking Serial Communication
347408

348409
`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.
349410

@@ -358,7 +419,7 @@ We provide two Arduino Iot Cloud APIs:
358419

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

364425
**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.

0 commit comments

Comments
 (0)