Skip to content

Fix OTA properties synchronization #289

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

Merged
merged 2 commits into from
Nov 12, 2021

Conversation

pennam
Copy link
Collaborator

@pennam pennam commented Nov 11, 2021

Switching to ArduinoIoTCloud 1.3.0 from earlier version can lead to an OTA loop caused by bad synchronization of OTA_REQ property. The OTA loop occurs when the resulting CBOR message created calling sendPropertiesToCloud() is greater than 256 byte and thus it gets splitted in multiple parts. If the OTA variables are not synched within the firs part of the message the OTA process restart before the remainig properties are synched.

With this PR the OTA properties are synched all together within the same CBOR message ensuring a correct synchronization.

Updating an application builded with an ArduinoIoTCloud library < 1.3.0 with an OTA will still lead to an OTA process executed two times.

Thanks @eclipse1985 for spotting this.

/cc @zmoog

@pennam pennam requested a review from aentinger November 11, 2021 16:01
@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2021

Codecov Report

Merging #289 (052b30e) into master (4c3af93) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #289   +/-   ##
=======================================
  Coverage   95.31%   95.31%           
=======================================
  Files          25       25           
  Lines         896      896           
=======================================
  Hits          854      854           
  Misses         42       42           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c3af93...052b30e. Read the comment docs.

@github-actions
Copy link

Memory usage change @ e51f540

Board flash % RAM for global variables %
arduino:mbed:envie_m4 🔺 0 - +64 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:mbed:envie_m7 🔺 +448 - +896 +0.06 - +0.11 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 🔺 +24 - +24 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 🔺 +352 - +960 +0.13 - +0.37 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 🔺 +24 - +24 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 0 - +1096 0.0 - +0.42 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 🔺 0 - +1104 0.0 - +0.42 0 - 0 0.0 - 0.0
esp32:esp32:esp32 🔺 +72 - +72 +0.01 - +0.01 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah 🔺 +76 - +92 +0.01 - +0.01 🔺 +44 - +48 +0.05 - +0.06
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:envie_m4 64 0.01 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed:envie_m7 448 0.06 0 0.0 448 0.06 0 0.0 512 0.07 0 0.0 896 0.11 0 0.0
arduino:mbed_nano:nanorp2040connect 0 0.0 0 0.0 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:samd:mkr1000 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0
arduino:samd:mkrgsm1400 352 0.13 0 0.0 352 0.13 0 0.0 352 0.13 0 0.0 960 0.37 0 0.0
arduino:samd:mkrnb1500 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0
arduino:samd:mkrwan1300 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwifi1010 352 0.13 0 0.0 352 0.13 0 0.0 352 0.13 0 0.0 1096 0.42 0 0.0 0 0.0 0 0.0
arduino:samd:nano_33_iot 352 0.13 0 0.0 352 0.13 0 0.0 352 0.13 0 0.0 1104 0.42 0 0.0 0 0.0 0 0.0
esp32:esp32:esp32 72 0.01 0 0.0 72 0.01 0 0.0 72 0.01 0 0.0
esp8266:esp8266:huzzah 76 0.01 44 0.05 80 0.01 48 0.06 92 0.01 44 0.05
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:envie_m4,64,0.01,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed:envie_m7,448,0.06,0,0.0,448,0.06,0,0.0,512,0.07,0,0.0,896,0.11,0,0.0
arduino:mbed_nano:nanorp2040connect,0,0.0,0,0.0,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:samd:mkr1000,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,,,,
arduino:samd:mkrgsm1400,352,0.13,0,0.0,352,0.13,0,0.0,352,0.13,0,0.0,960,0.37,0,0.0,,,,
arduino:samd:mkrnb1500,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,,,,
arduino:samd:mkrwan1300,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,,,,,,,,
arduino:samd:mkrwifi1010,352,0.13,0,0.0,352,0.13,0,0.0,352,0.13,0,0.0,1096,0.42,0,0.0,0,0.0,0,0.0
arduino:samd:nano_33_iot,352,0.13,0,0.0,352,0.13,0,0.0,352,0.13,0,0.0,1104,0.42,0,0.0,0,0.0,0,0.0
esp32:esp32:esp32,72,0.01,0,0.0,72,0.01,0,0.0,72,0.01,0,0.0,,,,,,,,
esp8266:esp8266:huzzah,76,0.01,44,0.05,80,0.01,48,0.06,92,0.01,44,0.05,,,,,,,,

Copy link
Contributor

@aentinger aentinger left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Minor nitpicks - use the feedback at your own caution - overall looks good 👍

@pennam pennam force-pushed the 1.3.0-hotfix-lambda branch from e51f540 to 052b30e Compare November 12, 2021 10:46
@pennam pennam merged commit 765012d into arduino-libraries:master Nov 12, 2021
@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Nov 22, 2021
@pennam pennam deleted the 1.3.0-hotfix-lambda branch May 17, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants