Skip to content
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

Add UNO R4 WiFi basic support #366

Merged
merged 7 commits into from
Jul 7, 2023
Merged

Conversation

pennam
Copy link
Collaborator

@pennam pennam commented Jun 28, 2023

To connect to ArduinoIoTCloud WiFi firmware need to be updated. The minimum required version is 0.2.0.

Pre release of the firmware is available here: https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/tag/0.2.0
Updater tool for linux, win, macos.

Instructions for flashing the new firmware available here

@per1234
Copy link
Contributor

per1234 commented Jun 28, 2023

About the failure of the "Unit Tests" workflow run:
https://github.com/arduino-libraries/ArduinoIoTCloud/actions/runs/5398721798/jobs/9804897397?pr=366#step:4:49

We have been seeing a recent increase in these spurious failures caused by intermittent errors while uploading the coverage data to Codecov.

The Tooling Team has had success by adding the upload token as suggested in the error message:
arduino/arduino-cli#2129

There is a detailed explanation of our chosen approach in the commit message here:
arduino/report-size-deltas@4175071

If you think that approach would be appropriate for this project, I will be happy to submit a pull request to make the equivalent change in the "Unit Tests" workflow.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jun 28, 2023
@pennam
Copy link
Collaborator Author

pennam commented Jun 28, 2023

If you think that approach would be appropriate for this project, I will be happy to submit a pull request to make the equivalent change in the "Unit Tests" workflow.

Thanks @per1234 that would be perfect!

@github-actions
Copy link

Memory usage change @ 0969755

Board flash % RAM for global variables %
arduino:mbed_giga:giga 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 🔺 +28 - +36 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nicla:nicla_vision 🔺 0 - +64 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_opta:opta 🔺 0 - +64 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
arduino:samd:mkr1000 🔺 +24 - +32 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 🔺 +24 - +32 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 🔺 +24 - +32 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 🔺 +32 - +32 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 +24 - +40 +0.01 - +0.02 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 🔺 +24 - +40 +0.01 - +0.02 0 - 0 0.0 - 0.0
esp32:esp32:esp32 🔺 +36 - +44 0.0 - 0.0 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah 🔺 +64 - +80 +0.01 - +0.01 0 - 0 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/utility/ArduinoIoTCloud_Travis_CI
flash
% examples/utility/ArduinoIoTCloud_Travis_CI
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:mbed_giga:giga 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect 28 0.0 0 0.0 28 0.0 0 0.0 28 0.0 0 0.0 36 0.0 0 0.0 36 0.0 0 0.0
arduino:mbed_nicla:nicla_vision 64 0.0 0 0.0 0 0.0 0 0.0 64 0.0 0 0.0 64 0.0 0 0.0
arduino:mbed_opta:opta 0 0.0 0 0.0 64 0.01 0 0.0 0 0.0 0 0.0 64 0.01 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
arduino:samd:mkr1000 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 32 0.01 0 0.0
arduino:samd:mkrgsm1400 24 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0
arduino:samd:mkrnb1500 32 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 32 0.01 0 0.0
arduino:samd:mkrwan1300 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0
arduino:samd:mkrwifi1010 24 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 40 0.02 0 0.0 32 0.01 0 0.0
arduino:samd:nano_33_iot 24 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 40 0.02 0 0.0
esp32:esp32:esp32 36 0.0 0 0.0 40 0.0 0 0.0 44 0.0 0 0.0
esp8266:esp8266:huzzah 64 0.01 0 0.0 80 0.01 0 0.0 80 0.01 0 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/utility/ArduinoIoTCloud_Travis_CI<br>flash,%,examples/utility/ArduinoIoTCloud_Travis_CI<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:mbed_giga:giga,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,28,0.0,0,0.0,28,0.0,0,0.0,28,0.0,0,0.0,36,0.0,0,0.0,36,0.0,0,0.0
arduino:mbed_nicla:nicla_vision,64,0.0,0,0.0,0,0.0,0,0.0,64,0.0,0,0.0,64,0.0,0,0.0,,,,
arduino:mbed_opta:opta,0,0.0,0,0.0,64,0.01,0,0.0,0,0.0,0,0.0,64,0.01,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,,,,
arduino:samd:mkr1000,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,,,,
arduino:samd:mkrgsm1400,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,,,,
arduino:samd:mkrnb1500,32,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,,,,
arduino:samd:mkrwan1300,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,,,,,,,,
arduino:samd:mkrwifi1010,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,40,0.02,0,0.0,32,0.01,0,0.0
arduino:samd:nano_33_iot,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,40,0.02,0,0.0
esp32:esp32:esp32,36,0.0,0,0.0,40,0.0,0,0.0,44,0.0,0,0.0,,,,,,,,
esp8266:esp8266:huzzah,64,0.01,0,0.0,80,0.01,0,0.0,80,0.01,0,0.0,,,,,,,,

@pennam
Copy link
Collaborator Author

pennam commented Jul 3, 2023

rebased to fix conflicts

@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Merging #366 (44f92b0) into master (a50ab82) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #366   +/-   ##
=======================================
  Coverage   95.00%   95.00%           
=======================================
  Files          27       27           
  Lines        1220     1220           
=======================================
  Hits         1159     1159           
  Misses         61       61           

@github-actions
Copy link

github-actions bot commented Jul 3, 2023

Memory usage change @ 44f92b0

Board flash % RAM for global variables %
arduino:mbed_giga:giga 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 🔺 +28 - +36 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nicla:nicla_vision 🔺 0 - +64 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_opta:opta 🔺 0 - +64 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 🔺 +16 - +32 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:renesas_uno:unor4wifi N/A N/A N/A N/A
arduino:samd:mkr1000 🔺 +24 - +32 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 🔺 +24 - +32 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 🔺 +24 - +32 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 🔺 +32 - +32 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 +24 - +40 +0.01 - +0.02 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 🔺 +24 - +40 +0.01 - +0.02 0 - 0 0.0 - 0.0
esp32:esp32:esp32 🔺 +36 - +44 0.0 - 0.0 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah 🔺 +64 - +80 +0.01 - +0.01 0 - 0 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/utility/ArduinoIoTCloud_Travis_CI
flash
% examples/utility/ArduinoIoTCloud_Travis_CI
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:mbed_giga:giga 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect 28 0.0 0 0.0 28 0.0 0 0.0 28 0.0 0 0.0 36 0.0 0 0.0 36 0.0 0 0.0
arduino:mbed_nicla:nicla_vision 64 0.0 0 0.0 0 0.0 0 0.0 64 0.0 0 0.0 64 0.0 0 0.0
arduino:mbed_opta:opta 0 0.0 0 0.0 64 0.01 0 0.0 0 0.0 0 0.0 64 0.01 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
arduino:renesas_portenta:portenta_c33 16 0.0 0 0.0 16 0.0 0 0.0 16 0.0 0 0.0 32 0.0 0 0.0
arduino:renesas_uno:unor4wifi 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:samd:mkr1000 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 32 0.01 0 0.0
arduino:samd:mkrgsm1400 24 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0
arduino:samd:mkrnb1500 32 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 32 0.01 0 0.0
arduino:samd:mkrwan1300 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0
arduino:samd:mkrwifi1010 24 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 40 0.02 0 0.0 32 0.01 0 0.0
arduino:samd:nano_33_iot 24 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 32 0.01 0 0.0 40 0.02 0 0.0
esp32:esp32:esp32 36 0.0 0 0.0 40 0.0 0 0.0 44 0.0 0 0.0
esp8266:esp8266:huzzah 64 0.01 0 0.0 80 0.01 0 0.0 80 0.01 0 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/utility/ArduinoIoTCloud_Travis_CI<br>flash,%,examples/utility/ArduinoIoTCloud_Travis_CI<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:mbed_giga:giga,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,28,0.0,0,0.0,28,0.0,0,0.0,28,0.0,0,0.0,36,0.0,0,0.0,36,0.0,0,0.0
arduino:mbed_nicla:nicla_vision,64,0.0,0,0.0,0,0.0,0,0.0,64,0.0,0,0.0,64,0.0,0,0.0,,,,
arduino:mbed_opta:opta,0,0.0,0,0.0,64,0.01,0,0.0,0,0.0,0,0.0,64,0.01,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,,,,
arduino:renesas_portenta:portenta_c33,16,0.0,0,0.0,16,0.0,0,0.0,16,0.0,0,0.0,32,0.0,0,0.0,,,,
arduino:renesas_uno:unor4wifi,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:samd:mkr1000,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,,,,
arduino:samd:mkrgsm1400,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,,,,
arduino:samd:mkrnb1500,32,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,,,,
arduino:samd:mkrwan1300,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,,,,,,,,
arduino:samd:mkrwifi1010,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,40,0.02,0,0.0,32,0.01,0,0.0
arduino:samd:nano_33_iot,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,40,0.02,0,0.0
esp32:esp32:esp32,36,0.0,0,0.0,40,0.0,0,0.0,44,0.0,0,0.0,,,,,,,,
esp8266:esp8266:huzzah,64,0.01,0,0.0,80,0.01,0,0.0,80,0.01,0,0.0,,,,,,,,

@@ -327,6 +327,12 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
reconnection_retry_delay = min(reconnection_retry_delay, static_cast<unsigned long>(AIOT_CONFIG_MAX_RECONNECTION_RETRY_DELAY_ms));
_next_connection_attempt_tick = millis() + reconnection_retry_delay;

#if defined(ARDUINO_UNOWIFIR4)
if (String(WiFi.firmwareVersion()) < String("0.2.0")) {
DEBUG_ERROR("ArduinoIoTCloudTCP::%s In order to connect to Arduino IoT Cloud, WiFI firmware needs to be >= 0.2.0, current %s", __FUNCTION__, WiFi.firmwareVersion());

Choose a reason for hiding this comment

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

It should read WiFi firmware instead of WiFI firmware (with lowercase i)

@pennam pennam merged commit 9163dcb into arduino-libraries:master Jul 7, 2023
19 checks passed
@pennam pennam deleted the unor4 branch May 17, 2024 09:10
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.

None yet

3 participants