Skip to content

Commit 8d6b9c8

Browse files
Last additions to content
1 parent 8331d93 commit 8d6b9c8

File tree

2 files changed

+33
-72
lines changed
  • content/arduino-cloud

2 files changed

+33
-72
lines changed

content/arduino-cloud/02.hardware/06.device-provisioning/content.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -142,23 +142,14 @@ You can update the network settings from the detail page of the device on the Ar
142142
During this process you will be asked to wipe out the current network configuration to restart the board's BLE interface.
143143

144144
- Power on the board.
145-
146145
- Reset the board using the method of your board. Have a look at the [How to set up the Reconfiguration Procedure](#How-to-set-up-the Reconfiguration-Procedure) section of this article to find the default board reset pin. If you have changed the reset pin from the default one, please use that.
147-
148146
- Open the devices page of the Mobile App or the Arduino Cloud webpage.
149-
150147
- Click on the device you want to update the network settings for.
151-
152148
- Click on the "change" button by the network section.
153-
154149
- If you are using the Arduino Cloud webpage, select the BLE method.
155-
156150
- The board will reboot, and you will see the LED pulsing.
157-
158151
- Connect to the board.
159-
160152
- Input the new network configuration.
161-
162153
- The board will validate it, and if correct, it will close the connection.
163154

164155
### Update Using the Serial Interface
@@ -168,28 +159,23 @@ Ensure that the "SerialAgent" is enabled in the cloud sketch, via "thingProperti
168159
This method only works with the Arduino Cloud website. You can update the network settings from the detail page of the board on the webpage. The Serial interface, if enabled, is always ready to receive a new configuration.
169160

170161
- Turn on the board and connect it to your PC using a USB cable.
171-
172162
- Open the devices page on the Arduino Cloud webpage.
173-
174163
- Click on the board you want to update the network settings for.
175-
176164
- Click on the "change" button by the network section.
177-
178165
- Input the new network configuration.
179-
180166
- The board will validate it, and if correct, it will close the connection.
181167

182168
## How to delete a stored network configuration
183169

184170
If you want to delete the stored network configuration without updating it, there are two possible methods to do so.
185171

186-
### Board Reset procedure
172+
### Board Reset Procedure
187173

188174
To proceed with the next steps, the cloud-generated sketch must be uploaded to the board.
189175

190176
Reset the board using the method of your board. Have a look at the [How to set up the Reconfiguration Procedure](#How-to-set-up-the Reconfiguration-Procedure) section of this article to find the default board reset pin. If you have changed the reset pin from the default one, please use that.
191177

192-
### Using the DeleteConfiguration sketch
178+
### Using the DeleteConfiguration Sketch
193179

194180
Open Arduino IDE and on the left side open the **library manager**. Search for **Arduino_NetworkConfigurator** and download it. Once it is downloaded go to **File > Examples > Arduino_NetworkConfigurator > Utility > DeleteConfiguration**, this will open a new example sketch. Select your board and port then upload this example sketch to your board. When the sketch has been uploaded you can look at the serial monitor to monitor the progress and troubleshoot if needed.
195181

content/arduino-cloud/03.cloud-interface/00.sketches/sketches.md

Lines changed: 31 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -131,61 +131,48 @@ This file will be visible as a "Secret" tab in the Cloud Editor and is named `ar
131131

132132
Note that if you are using the offline IDE / Arduino CLI, you will need to manually create this file. More information is in the **Offline Sketches section**.
133133

134-
135-
136134
## thingsProperties.h and the NetworkConfigurator
137135

138136
The thingProperties.h file plays a key role in managing credential capabilities, including the NetworkConfigurator, which enables two main features:
139137

140138
- Credentials stored on NVS: Boards can now securely store network settings in Non-Volatile Storage (NVS), removing them from the sketch (secrets.h).
139+
- Over-the-Air (OTA) communication: Enables the possibility to provide network configuration settings via Bluetooth (BLE).
141140

142-
- Over-the-Air (OTA) communication: Enables the possibility to provide network settings configuration via Bluetooth (BLE)
143-
144-
The thingProperties.h will be generated accordingly to the provisioning mechanism, so if the board has been registered using the provisioning 2.0, automatically the thingProperties.h file will have the NetworkConfigurator component enabled.
145-
146-
A board registered with Provisioning 2.0 includes Arduino_NetworkConfigurator.h in the generated thingProperties.h.
141+
The `thingProperties.h` will be generated accordingly to the provisioning mechanism, so if the board has been registered using the provisioning 2.0, the `thingProperties.h` file will automatically have the NetworkConfigurator component enabled. A board registered with Provisioning 2.0 includes `Arduino_NetworkConfigurator.h` in the generated `thingProperties.h` file.
147142

148143
### How the NetworkConfigurator works
149144

150145
To work, the NetworkConfigurator needs:
151146

152-
- One or more Configurator Agents: Objects that handle the communication between the board and the user device (PC, laptop, or Mobile phone). The NetworkConfigurator library out-of-the-box provides two Agents:
147+
- One or more Configurator Agents: Objects that handle the communication between the board and the user device (PC, laptop, or Mobile phone).
148+
- A Key-Value Storage library: the NetworkConfigurator needs an external storage library that implements the KVStoreInterface. Arduino provides the `Arduino_KVStore` library for handling the storage and saving the NetworkConfigurator configurations.
149+
- A ConnectionHandler: the object responsible for the board's Internet connection management.
153150

154-
- BLEAgent for handling the BLE communication
151+
The `NetworkConfigurator` library out-of-the-box provides two Agents:
155152

153+
- BLEAgent for handling the BLE communication.
156154
- SerialAgents for the Serial communication.
157155

158-
- A Key-Value Storage library: the NetworkConfigurator needs an external storage library that implements the KVStoreInterface. Arduino provides the Arduino_KVStore library for handling the storage and saving the NetworkConfigurator configurations.
159-
160-
- A ConnectionHandler: the object responsible for the board’s Internet connection management
156+
## thingsProperties.h Default Setup
161157

162-
### thingsProperties.h
163-
Here is how the thingsProperties.h file changes to set up the NetworkConfigurator.
158+
Here is how the `thingsProperties.h` file changes to set up the NetworkConfigurator. This setup is automatically generated if the board has been registered with Provisioning 2.0.
164159

165-
### Default setup
166-
This setup is automatically generated if the board has been registered with Provisioning 2.0.
160+
*** Do not follow these steps if the board has not been registered with the Provisioning 2.0 ***
167161

168-
Do not try if the board has not been registered with the Provisioning 2.0
162+
### Libraries and object declarations
169163

170-
Automatically, both the SeralAgent and the BLEAgent are enabled
171-
172-
Libraries and object declarations
173164
The following libraries are automatically included:
174165

175-
Arduino_NetworkConfigurator library
176-
177-
BLEAgent.h and SerialAgent.h
178-
179-
The objects declared:
180-
181-
kvStore: for handling the NVM operations
182-
183-
BLEAgent for handling the BLE interface
166+
- Arduino_NetworkConfigurator library
167+
- BLEAgent.h
168+
- SerialAgent.h
184169

185-
SerialAgent: for handling the Serial Interface
186-
187-
NetworkConfigurator: the networkConfigurator instance
170+
These objects are declared in `thingsProperties.h`:
188171

172+
- `kvStore`: handles the NVM operations
173+
- `BLEAgent`: handles the BLE interface
174+
- `SerialAgent`: handles the Serial Interface
175+
- `NetworkConfigurator`: the networkConfigurator instance
189176

190177
```arduino
191178
#include <ArduinoIoTCloud.h>
@@ -203,15 +190,13 @@ NetworkConfiguratorClass NetworkConfigurator(ArduinoIoTPreferredConnection);
203190
```
204191

205192
### initProperties()
206-
In the initProperties function, the following instructions are added:
207-
208-
NetworkConfigurator.addAgent(BLEAgent); For enabling the BLEAgent
209193

210-
NetworkConfigurator.addAgent(SerialAgent); For enabling the SerialAgent
211-
212-
NetworkConfigurator.setStorage(kvStore); For setting the KVStore
194+
In the initProperties function, the following instructions are added:
213195

214-
ArduinoCloud.setConfigurator(NetworkConfigurator); For embedding the NetworkConfigurator in the ArduinoCloud
196+
- `NetworkConfigurator.addAgent(BLEAgent);` For enabling the BLEAgent.
197+
- `NetworkConfigurator.addAgent(SerialAgent);` For enabling the SerialAgent.
198+
- `NetworkConfigurator.setStorage(kvStore);` For setting the KVStore.
199+
- `ArduinoCloud.setConfigurator(NetworkConfigurator);` For embedding the NetworkConfigurator in the ArduinoCloud.
215200

216201
```arduino
217202
NetworkConfigurator.addAgent(BLEAgent);
@@ -220,7 +205,7 @@ NetworkConfigurator.setStorage(kvStore);
220205
ArduinoCloud.setConfigurator(NetworkConfigurator);
221206
```
222207

223-
The final thingProperties.h file:
208+
The final `thingProperties.h` file:
224209

225210
```arduino
226211
#include <ArduinoIoTCloud.h>
@@ -248,13 +233,9 @@ void initProperties(){
248233

249234
### Disable the BLEAgent
250235

251-
To save board storage and memory, after the provisioning, the BLEAgent can be removed. ~30KB of storage and ~ 2KB of memory are saved for BSS and Data.
236+
To save board storage and memory, after the provisioning, the `BLEAgent` can be removed. ~30KB of storage and ~ 2KB of memory are saved for BSS and Data. The network credentials provided in the provisioning phase can no longer be changed via Bluetooth if this is disabled.
252237

253-
The network credentials provided in the provisioning phase can no longer be changed via Bluetooth
254-
255-
To disable the BLEAgent, just comment out or remove the lines of code that include, declare, and enable it.
256-
257-
The final result should be the following:
238+
To disable the `BLEAgent`, just comment out or remove the lines of code that include, declare, and enable it. The final result should be the following:
258239

259240
```arduino
260241
#include <ArduinoIoTCloud.h>
@@ -282,13 +263,9 @@ void initProperties(){
282263

283264
### Disable the SerialAgent
284265

285-
To save board storage and memory, after the provisioning, the SerialAgent can be removed. ~1KB of storage is saved for BSS and Data
286-
287-
The network credentials provided in the provisioning phase can no longer be changed via USB
266+
To save board storage and memory, after the provisioning, the SerialAgent can be removed. ~1KB of storage is saved for BSS and Data. The network credentials provided in the provisioning phase can no longer be changed via USB if this is disabled.
288267

289-
To disable the SerialAgent, just comment out or remove the lines of code that include, declare, and enable it.
290-
291-
The final result should be the following:
268+
To disable the `SerialAgent`, just comment out or remove the lines of code that include, declare, and enable it. The final result should be the following:
292269

293270
```arduino
294271
#include <ArduinoIoTCloud.h>
@@ -318,11 +295,9 @@ void initProperties(){
318295

319296
To save board storage and memory, after the provisioning, the NetworkConfigurator can be removed. ~40KB of storage and ~ 2,9KB of memory are saved for BSS and Data.
320297

321-
In this setup, the only way to handle network settings is to return to using the secrets declared in secrets.h file. This can be done manually by adding the secrets.h file with the defines needed.
322-
323-
In order to change the network settings, you must flash your sketch with the updated network settings in the secrets.h file. The network settings can no longer be updated using the Arduino Cloud WebUI or the mobile app.
298+
In this setup, the only way to handle network settings is to return to using the secrets declared in `secrets.h` file. This can be done manually by adding the `secrets.h` file with the defines needed.
324299

325-
The final result should be the following (thingProperties.h file):
300+
In order to change the network settings, you must flash your sketch with the updated network settings in the `secrets.h` file. The network settings can no longer be updated using the Arduino Cloud Webpage or the mobile app. The final result should be the following (`thingProperties.h` file):
326301

327302
```arduino
328303
#include <ArduinoIoTCloud.h>

0 commit comments

Comments
 (0)