diff --git a/content/arduino-cloud/02.hardware/06.device-provisioning/content.md b/content/arduino-cloud/02.hardware/06.device-provisioning/content.md index 88b73593f8..4b4e24b599 100644 --- a/content/arduino-cloud/02.hardware/06.device-provisioning/content.md +++ b/content/arduino-cloud/02.hardware/06.device-provisioning/content.md @@ -146,7 +146,7 @@ During this process you will be asked to wipe out the current network configurat 3. Click on the device you want to update the network settings for. 4. Click on the "change" button by the network section. 5. If you are using the Arduino Cloud webpage, select the Bluetooth method. -6. 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. +6. Reset the board using the method of your board. Have a look at the [How to set up the Reconfiguration Procedure](https://docs.arduino.cc/arduino-cloud/cloud-interface/sketches/#how-to-set-up-the-reconfiguration-procedure) article to find the default board reset pin. If you have changed the reset pin from the default one, please use that. 7. The board will reboot, and you will see the LED pulsing. 8. Connect to the board on the Arduino Cloud. 9. Input the new network configuration. @@ -173,7 +173,7 @@ If you want to delete the stored network configuration without updating it, ther To proceed with the next steps, the Cloud-generated sketch must be uploaded to the board. -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. +Reset the board using the method of your board. Have a look at the [How to set up the Reconfiguration Procedure](https://docs.arduino.cc/arduino-cloud/cloud-interface/sketches/#how-to-set-up-the-reconfiguration-procedure) article to find the default board reset pin. If you have changed the reset pin from the default one, please use that. ### Using the DeleteConfiguration Sketch @@ -181,19 +181,3 @@ Open Arduino IDE and on the left side open the **Library Manager**. Search for * The sketch can also be found [here](https://github.com/arduino-libraries/Arduino_NetworkConfigurator/blob/main/examples/utility/DeleteConfiguration/DeleteConfiguration.ino). -### How to set up the Reconfiguration Procedure - -As the Provisioning 2.0 ends, the Bluetooth LE interface is turned off. - -To restart the Bluetooth LE interface to update the network settings, the [**Arduino_NetworkConfigurator**](https://github.com/arduino-libraries/Arduino_NetworkConfigurator?tab=readme-ov-file) library provides a procedure called "Reconfiguration Procedure". This procedure is based on the shorting of two pins of the board. - -The library provides a default implementation according to the board type. - -- `Arduino Opta`: Press and hold the user button (BTN_USER) until the led (LED_USER) turns off -- `Arduino MKR WiFi 1010`: Short pin 7 to GND until the led turns off -- `Arduino GIGA R1 WiFi`: Short pin 7 to GND until the led turns off -- `Arduino Nano RP2040 Connect`: Short pin 2 to 3.3V until the led turns off -- `Arduino Portenta H7`: Short pin 0 to GND until the led turns off -- `Arduino Portenta C33`: Short pin 0 to GND until the led turns off -- `Other boards`: Short pin 2 to GND until the led turns off -- `Portenta Machine Control`: Currently the reset procedure is not available \ No newline at end of file diff --git a/content/arduino-cloud/03.cloud-interface/00.sketches/sketches.md b/content/arduino-cloud/03.cloud-interface/00.sketches/sketches.md index b8d61cd065..ba2e700978 100644 --- a/content/arduino-cloud/03.cloud-interface/00.sketches/sketches.md +++ b/content/arduino-cloud/03.cloud-interface/00.sketches/sketches.md @@ -311,6 +311,57 @@ void initProperties(){ ArduinoCloud.addProperty(variable, READWRITE, ON_CHANGE, onVariableChange); } ``` +### How to set up the Reconfiguration Procedure + +As the Provisioning 2.0 ends, the Bluetooth LE interface is turned off. + +To restart the Bluetooth LE interface to update the network settings, the [**Arduino_NetworkConfigurator**](https://github.com/arduino-libraries/Arduino_NetworkConfigurator?tab=readme-ov-file) library provides a procedure called "Reconfiguration Procedure". This procedure is based on the shorting of two pins of the board. + +The library provides a default implementation according to the board type. + +- `Arduino Opta`: Press and hold the user button (BTN_USER) until the led (LED_USER) turns off +- `Arduino MKR WiFi 1010`: Short pin 7 to GND until the led turns off +- `Arduino GIGA R1 WiFi`: Short pin 7 to GND until the led turns off +- `Nicla Vision`: Short the pin PA_13 to GND until the led turns off +- `Arduino Portenta H7`: Short pin 0 to GND until the led turns off +- `Arduino Portenta C33`: Short pin 0 to GND until the led turns off +- `Other boards`: Short pin 2 to GND until the led turns off +- `Portenta Machine Control`: Currently the reset procedure is not available + +***Internally, the pin designated for the procedure is set as INPUT_PULLUP (except for Arduino Opta ), and it's attached to an ISR fired on every change of the pin's status.*** + +#### How to use the Reconfiguration pin in your sketch + +If you want to use the Reconfiguration pin in your sketch, you can add a custom callback function to be fired every time the pin’s state changes. + +1. Define a function having this signature: `void func(void)` +Example: +``` +void onReconfigurationPinInterrupt() +``` +2. Pass the callback function to the `NetworkConfigurator`, adding this line in the `initProperties()` function of the `thingProperties.h` +``` +NetworkConfigurator.addReconfigurePinCallback(onReconfigurationPinInterrupt); +``` + +#### Change the Reconfiguration pin + +Despite the default reconfiguration pin, you can change it using the following code: +``` +NetworkConfigurator.setReconfigurePin(your_pin); +``` +in the `initProperties()` function of the `thingProperties.h` + +The new pin must be in the list of digital pins usable for interrupts. +Please refer to the Arduino documentation for more [details](https://docs.arduino.cc/language-reference/en/functions/external-interrupts/attachInterrupt/). + +#### Disable the Reconfiguration feature + +To disable the reconfiguration procedure, use the following function: +``` +NetworkConfigurator.setReconfigurePin(DISABLE_PIN); +``` +in the `initProperties()` function of the `thingProperties.h` ## Offline Sketches