Skip to content

Use NetworkConfigurator #535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fabik111
Copy link
Contributor

Edit the ArduinoIoTCloudTCP FSM for using the NetworkConfigurator

  • added new method for: setting the NetworkConfigurator void setConfigurator(NetworkConfiguratorClass & configurator)
  • added a new state for getting the network configuration from the NVS and initialize the networkconfigutor
  • added a new state for handling the update of network credentials
  • added a new method for disconnecting from the AIoTCloud void disconnect()

Copy link

codecov bot commented Mar 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.91%. Comparing base (cc01f43) to head (db2abdf).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #535   +/-   ##
=======================================
  Coverage   94.91%   94.91%           
=======================================
  Files          32       32           
  Lines        1376     1376           
=======================================
  Hits         1306     1306           
  Misses         70       70           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fabik111 fabik111 force-pushed the use-networkconfigurator branch from bd3fd1f to 068496c Compare March 28, 2025 10:23
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Mar 28, 2025
@fabik111 fabik111 force-pushed the use-networkconfigurator branch 8 times, most recently from 380e974 to 8047509 Compare April 8, 2025 13:02
@fabik111 fabik111 force-pushed the use-networkconfigurator branch 2 times, most recently from a2067ea to 819161c Compare April 14, 2025 11:57

This comment was marked as outdated.

@fabik111 fabik111 force-pushed the use-networkconfigurator branch from e749fc3 to bbf3f69 Compare April 14, 2025 14:34

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

initProperties();
AgentsManagerClass::getInstance().begin();
LEDFeedbackClass::getInstance().begin();
DEBUG_INFO("Starting Provisioning");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add also the binary version and Network configurator version

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The network configurator version is already inside the NetworkConfigurator with a specific command for read it and for the binary version I think we can keep aligned with the SKETCH_VERSION

This comment was marked as outdated.

@@ -146,6 +152,9 @@ class ArduinoIoTCloudClass
protected:

ConnectionHandler * _connection;
#if NETWORK_CONFIGURATOR_ENABLED
NetworkConfiguratorClass * _configurator = nullptr;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NetworkConfiguratorClass * _configurator = nullptr;
NetworkConfiguratorClass * _configurator;

This comment was marked as outdated.

@fabik111 fabik111 force-pushed the use-networkconfigurator branch 3 times, most recently from 001c63f to ef8fc29 Compare May 15, 2025 14:09

This comment was marked as outdated.

update example of sketch that uses the NetworkConfigurator

use NetworkConfigurator wrappers for agentsManager

update ci test for networkConfigurator

add Arduino_NetworkConfigurator dep to library.properties
fabik111 added 3 commits May 15, 2025 16:41
add GET_PROVISIONING_SKETCH_VERSION command

add define for compile with test env
@fabik111 fabik111 force-pushed the use-networkconfigurator branch from ef8fc29 to db2abdf Compare May 15, 2025 14:42
Copy link

Memory usage change @ db2abdf

Board flash % RAM for global variables %
arduino:esp32:nano_nora 🔺 +8 - +168 0.0 - +0.01 🔺 0 - +8 0.0 - 0.0
arduino:mbed_edge:edge_control 🔺 +8 - +136 0.0 - +0.01 🔺 0 - +8 0.0 - 0.0
arduino:mbed_giga:giga 🔺 0 - +6296 0.0 - +0.32 🔺 0 - +200 0.0 - +0.04
arduino:mbed_nano:nanorp2040connect 🔺 0 - +152 0.0 - 0.0 🔺 0 - +8 0.0 - 0.0
arduino:mbed_nicla:nicla_vision 🔺 0 - +6296 0.0 - +0.32 🔺 0 - +200 0.0 - +0.04
arduino:mbed_opta:opta 🔺 0 - +6984 0.0 - +0.36 🔺 0 - +208 0.0 - +0.04
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 🔺 0 - +7408 0.0 - +0.35 🔺 0 - +364 0.0 - +0.07
arduino:renesas_uno:unor4wifi 🔺 +624 - +10744 +0.24 - +4.1 🔺 +328 - +932 +1.0 - +2.84
arduino:samd:mkr1000 🔺 0 - +136 0.0 - +0.05 🔺 0 - +8 0.0 - +0.02
arduino:samd:mkrgsm1400 🔺 0 - +128 0.0 - +0.05 🔺 0 - +8 0.0 - +0.02
arduino:samd:mkrnb1500 🔺 0 - +128 0.0 - +0.05 🔺 0 - +8 0.0 - +0.02
arduino:samd:mkrwan1300 🔺 +8 - +8 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 0 - +128 0.0 - +0.05 🔺 0 - +8 0.0 - +0.02
arduino:samd:nano_33_iot 🔺 0 - +128 0.0 - +0.05 🔺 0 - +8 0.0 - +0.02
esp32:esp32:esp32 🔺 +20 - +220 0.0 - +0.02 🔺 0 - +8 0.0 - 0.0
esp8266:esp8266:huzzah 🔺 +160 - +176 +0.02 - +0.02 🔺 0 - +8 0.0 - +0.01
rp2040:rp2040:rpipicow 🔺 +128 - +136 +0.01 - +0.01 🔺 0 - +8 0.0 - 0.0
Click for full report table
Board examples/ArduinoIoTCloud-Advanced
flash
% examples/ArduinoIoTCloud-Advanced
RAM for global variables
% examples/ArduinoIoTCloud-Basic
flash
% examples/ArduinoIoTCloud-Basic
RAM for global variables
% examples/ArduinoIoTCloud-Callbacks
flash
% examples/ArduinoIoTCloud-Callbacks
RAM for global variables
% examples/utility/ArduinoIoTCloud_Travis_CI
flash
% examples/utility/ArduinoIoTCloud_Travis_CI
RAM for global variables
% examples/ArduinoIoTCloud-DeferredOTA
flash
% examples/ArduinoIoTCloud-DeferredOTA
RAM for global variables
% examples/ArduinoIoTCloud-Notecard
flash
% examples/ArduinoIoTCloud-Notecard
RAM for global variables
% examples/ArduinoIoTCloud-Schedule
flash
% examples/ArduinoIoTCloud-Schedule
RAM for global variables
% examples/ArduinoIoTCloud-NetConfig
flash
% examples/ArduinoIoTCloud-NetConfig
RAM for global variables
% examples/utility/Provisioning
flash
% examples/utility/Provisioning
RAM for global variables
% examples/utility/SelfProvisioning
flash
% examples/utility/SelfProvisioning
RAM for global variables
%
arduino:esp32:nano_nora 148 0.0 0 0.0 144 0.0 8 0.0 152 0.0 0 0.0 168 0.01 8 0.0 148 0.0 8 0.0 8 0.0 0 0.0 140 0.0 0 0.0
arduino:mbed_edge:edge_control 136 0.01 0 0.0 136 0.01 8 0.0 136 0.01 0 0.0 136 0.01 8 0.0 8 0.0 0 0.0 136 0.01 8 0.0
arduino:mbed_giga:giga 6296 0.32 200 0.04 6296 0.32 168 0.03 6232 0.32 200 0.04 6232 0.32 200 0.04 6232 0.32 200 0.04 272 0.01 32 0.01 6232 0.32 200 0.04 N/A N/A N/A N/A 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect 152 0.0 8 0.0 152 0.0 8 0.0 152 0.0 8 0.0 148 0.0 8 0.0 152 0.0 8 0.0 10 0.0 0 0.0 152 0.0 8 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nicla:nicla_vision 6232 0.32 200 0.04 6224 0.32 168 0.03 6296 0.32 200 0.04 6224 0.32 168 0.03 6296 0.32 200 0.04 208 0.01 32 0.01 6232 0.32 168 0.03 N/A N/A N/A N/A 0 0.0 0 0.0
arduino:mbed_opta:opta 6784 0.35 176 0.03 6984 0.36 208 0.04 6776 0.34 176 0.03 6720 0.34 208 0.04 6776 0.34 176 0.03 272 0.01 32 0.01 6784 0.35 208 0.04 N/A N/A N/A N/A 0 0.0 0 0.0
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 7392 0.35 364 0.07 7408 0.35 332 0.06 7392 0.35 364 0.07 7384 0.35 332 0.06 320 0.02 48 0.01 7392 0.35 332 0.06 N/A N/A N/A N/A 0 0.0 0 0.0
arduino:renesas_uno:unor4wifi 10744 4.1 336 1.03 10744 4.1 328 1.0 10744 4.1 336 1.03 10728 4.09 328 1.0 624 0.24 932 2.84 10744 4.1 328 1.0 N/A N/A N/A N/A
arduino:samd:mkr1000 128 0.05 8 0.02 136 0.05 8 0.02 128 0.05 8 0.02 128 0.05 8 0.02 8 0.0 0 0.0 128 0.05 8 0.02 0 0.0 0 0.0
arduino:samd:mkrgsm1400 128 0.05 8 0.02 128 0.05 8 0.02 128 0.05 8 0.02 120 0.05 8 0.02 8 0.0 0 0.0 128 0.05 8 0.02 0 0.0 0 0.0
arduino:samd:mkrnb1500 128 0.05 8 0.02 128 0.05 8 0.02 128 0.05 8 0.02 128 0.05 8 0.02 8 0.0 0 0.0 128 0.05 8 0.02 0 0.0 0 0.0
arduino:samd:mkrwan1300 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0
arduino:samd:mkrwifi1010 128 0.05 8 0.02 128 0.05 0 0.0 128 0.05 8 0.02 128 0.05 0 0.0 128 0.05 0 0.0 8 0.0 0 0.0 128 0.05 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:nano_33_iot 128 0.05 8 0.02 128 0.05 0 0.0 128 0.05 8 0.02 128 0.05 0 0.0 128 0.05 0 0.0 16 0.01 0 0.0 128 0.05 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
esp32:esp32:esp32 196 0.01 0 0.0 200 0.02 8 0.0 220 0.02 0 0.0 208 0.02 8 0.0 192 0.01 8 0.0 20 0.0 0 0.0 220 0.02 0 0.0
esp8266:esp8266:huzzah 176 0.02 8 0.01 160 0.02 0 0.0 160 0.02 8 0.01 160 0.02 0 0.0 160 0.02 0 0.0
rp2040:rp2040:rpipicow 136 0.01 0 0.0 136 0.01 8 0.0 128 0.01 8 0.0 128 0.01 8 0.0
Click for full report CSV
Board,examples/ArduinoIoTCloud-Advanced<br>flash,%,examples/ArduinoIoTCloud-Advanced<br>RAM for global variables,%,examples/ArduinoIoTCloud-Basic<br>flash,%,examples/ArduinoIoTCloud-Basic<br>RAM for global variables,%,examples/ArduinoIoTCloud-Callbacks<br>flash,%,examples/ArduinoIoTCloud-Callbacks<br>RAM for global variables,%,examples/utility/ArduinoIoTCloud_Travis_CI<br>flash,%,examples/utility/ArduinoIoTCloud_Travis_CI<br>RAM for global variables,%,examples/ArduinoIoTCloud-DeferredOTA<br>flash,%,examples/ArduinoIoTCloud-DeferredOTA<br>RAM for global variables,%,examples/ArduinoIoTCloud-Notecard<br>flash,%,examples/ArduinoIoTCloud-Notecard<br>RAM for global variables,%,examples/ArduinoIoTCloud-Schedule<br>flash,%,examples/ArduinoIoTCloud-Schedule<br>RAM for global variables,%,examples/ArduinoIoTCloud-NetConfig<br>flash,%,examples/ArduinoIoTCloud-NetConfig<br>RAM for global variables,%,examples/utility/Provisioning<br>flash,%,examples/utility/Provisioning<br>RAM for global variables,%,examples/utility/SelfProvisioning<br>flash,%,examples/utility/SelfProvisioning<br>RAM for global variables,%
arduino:esp32:nano_nora,148,0.0,0,0.0,144,0.0,8,0.0,152,0.0,0,0.0,168,0.01,8,0.0,148,0.0,8,0.0,8,0.0,0,0.0,140,0.0,0,0.0
arduino:mbed_edge:edge_control,136,0.01,0,0.0,136,0.01,8,0.0,136,0.01,0,0.0,136,0.01,8,0.0,,,,,8,0.0,0,0.0,136,0.01,8,0.0
arduino:mbed_giga:giga,6296,0.32,200,0.04,6296,0.32,168,0.03,6232,0.32,200,0.04,6232,0.32,200,0.04,6232,0.32,200,0.04,272,0.01,32,0.01,6232,0.32,200,0.04,N/A,N/A,N/A,N/A,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,152,0.0,8,0.0,152,0.0,8,0.0,152,0.0,8,0.0,148,0.0,8,0.0,152,0.0,8,0.0,10,0.0,0,0.0,152,0.0,8,0.0,,,,,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nicla:nicla_vision,6232,0.32,200,0.04,6224,0.32,168,0.03,6296,0.32,200,0.04,6224,0.32,168,0.03,6296,0.32,200,0.04,208,0.01,32,0.01,6232,0.32,168,0.03,N/A,N/A,N/A,N/A,0,0.0,0,0.0,,,,
arduino:mbed_opta:opta,6784,0.35,176,0.03,6984,0.36,208,0.04,6776,0.34,176,0.03,6720,0.34,208,0.04,6776,0.34,176,0.03,272,0.01,32,0.01,6784,0.35,208,0.04,N/A,N/A,N/A,N/A,0,0.0,0,0.0,,,,
arduino:mbed_portenta:envie_m7,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,,,,
arduino:renesas_portenta:portenta_c33,7392,0.35,364,0.07,7408,0.35,332,0.06,7392,0.35,364,0.07,7384,0.35,332,0.06,,,,,320,0.02,48,0.01,7392,0.35,332,0.06,N/A,N/A,N/A,N/A,0,0.0,0,0.0,,,,
arduino:renesas_uno:unor4wifi,10744,4.1,336,1.03,10744,4.1,328,1.0,10744,4.1,336,1.03,10728,4.09,328,1.0,,,,,624,0.24,932,2.84,10744,4.1,328,1.0,N/A,N/A,N/A,N/A,,,,,,,,
arduino:samd:mkr1000,128,0.05,8,0.02,136,0.05,8,0.02,128,0.05,8,0.02,128,0.05,8,0.02,,,,,8,0.0,0,0.0,128,0.05,8,0.02,,,,,0,0.0,0,0.0,,,,
arduino:samd:mkrgsm1400,128,0.05,8,0.02,128,0.05,8,0.02,128,0.05,8,0.02,120,0.05,8,0.02,,,,,8,0.0,0,0.0,128,0.05,8,0.02,,,,,0,0.0,0,0.0,,,,
arduino:samd:mkrnb1500,128,0.05,8,0.02,128,0.05,8,0.02,128,0.05,8,0.02,128,0.05,8,0.02,,,,,8,0.0,0,0.0,128,0.05,8,0.02,,,,,0,0.0,0,0.0,,,,
arduino:samd:mkrwan1300,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,,,,,8,0.0,0,0.0,,,,,,,,,,,,,,,,
arduino:samd:mkrwifi1010,128,0.05,8,0.02,128,0.05,0,0.0,128,0.05,8,0.02,128,0.05,0,0.0,128,0.05,0,0.0,8,0.0,0,0.0,128,0.05,0,0.0,,,,,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:nano_33_iot,128,0.05,8,0.02,128,0.05,0,0.0,128,0.05,8,0.02,128,0.05,0,0.0,128,0.05,0,0.0,16,0.01,0,0.0,128,0.05,0,0.0,,,,,0,0.0,0,0.0,0,0.0,0,0.0
esp32:esp32:esp32,196,0.01,0,0.0,200,0.02,8,0.0,220,0.02,0,0.0,208,0.02,8,0.0,192,0.01,8,0.0,20,0.0,0,0.0,220,0.02,0,0.0,,,,,,,,,,,,
esp8266:esp8266:huzzah,176,0.02,8,0.01,160,0.02,0,0.0,160,0.02,8,0.01,160,0.02,0,0.0,,,,,,,,,160,0.02,0,0.0,,,,,,,,,,,,
rp2040:rp2040:rpipicow,136,0.01,0,0.0,136,0.01,8,0.0,128,0.01,8,0.0,128,0.01,8,0.0,,,,,,,,,,,,,,,,,,,,,,,,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants