ArduinoIoTCloud icon indicating copy to clipboard operation
ArduinoIoTCloud copied to clipboard

Add logs on OTA process steps

Open zmoog opened this issue 4 years ago • 8 comments

Motivation

The current version of IoTCloudLibrary does not log every step involved in the Over-the-Air (OTA) update process, so it's not trivial do understand what's going on when something goes wrong.

Change description

These additional log statements highlight each step in the Over-the-Air (OTA) update process.

Additional Notes

Reviewer checklist

  • [ ] PR address a single concern.
  • [ ] PR title and description are properly filled.
  • [ ] Changes will be merged in master.
  • [ ] Changes are covered by tests.
  • [ ] Logging is meaningful in case of troubleshooting.
  • [ ] History is clean, commit messages are meaningful (see CONTRIBUTING.md) and are well formatted.

zmoog avatar Oct 25 '21 09:10 zmoog

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Maurizio Branca seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Oct 25 '21 09:10 CLAassistant

Codecov Report

Merging #282 (f98c0c6) into master (5e19f33) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #282   +/-   ##
=======================================
  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 5e19f33...f98c0c6. Read the comment docs.

codecov-commenter avatar Oct 25 '21 09:10 codecov-commenter

Memory usage change @ f98c0c6ff25be865ab14fc9f36c5cbbdab110ad5

Board flash % RAM for global variables %
arduino:mbed:envie_m4 :small_red_triangle: +512 - +640 +0.05 - +0.06 0 - 0 0.0 - 0.0
arduino:mbed:envie_m7 :small_red_triangle: +664 - +864 +0.08 - +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 :small_red_triangle: +512 - +608 +0.2 - +0.23 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 :small_red_triangle: +512 - +688 +0.2 - +0.26 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 :small_red_triangle: +512 - +608 +0.2 - +0.23 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 :small_red_triangle: +112 - +112 +0.04 - +0.04 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 :small_red_triangle: 0 - +888 0.0 - +0.34 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot :small_red_triangle: 0 - +888 0.0 - +0.34 0 - 0 0.0 - 0.0
esp32:esp32:esp32 :small_red_triangle: +668 - +724 +0.05 - +0.06 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah :small_red_triangle: +620 - +624 +0.06 - +0.06 :small_red_triangle: +352 - +364 +0.43 - +0.44
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 640 0.06 0 0.0 568 0.05 0 0.0 632 0.06 0 0.0 512 0.05 0 0.0
arduino:mbed:envie_m7 856 0.11 0 0.0 864 0.11 0 0.0 856 0.11 0 0.0 664 0.08 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 608 0.23 0 0.0 600 0.23 0 0.0 600 0.23 0 0.0 512 0.2 0 0.0
arduino:samd:mkrgsm1400 688 0.26 0 0.0 688 0.26 0 0.0 688 0.26 0 0.0 512 0.2 0 0.0
arduino:samd:mkrnb1500 608 0.23 0 0.0 600 0.23 0 0.0 600 0.23 0 0.0 512 0.2 0 0.0
arduino:samd:mkrwan1300 112 0.04 0 0.0 112 0.04 0 0.0 112 0.04 0 0.0
arduino:samd:mkrwifi1010 888 0.34 0 0.0 888 0.34 0 0.0 888 0.34 0 0.0 704 0.27 0 0.0 0 0.0 0 0.0
arduino:samd:nano_33_iot 888 0.34 0 0.0 888 0.34 0 0.0 888 0.34 0 0.0 704 0.27 0 0.0 0 0.0 0 0.0
esp32:esp32:esp32 724 0.06 0 0.0 668 0.05 0 0.0 716 0.05 0 0.0
esp8266:esp8266:huzzah 620 0.06 352 0.43 624 0.06 364 0.44 620 0.06 352 0.43
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,640,0.06,0,0.0,568,0.05,0,0.0,632,0.06,0,0.0,512,0.05,0,0.0
arduino:mbed:envie_m7,856,0.11,0,0.0,864,0.11,0,0.0,856,0.11,0,0.0,664,0.08,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,608,0.23,0,0.0,600,0.23,0,0.0,600,0.23,0,0.0,512,0.2,0,0.0,,,,
arduino:samd:mkrgsm1400,688,0.26,0,0.0,688,0.26,0,0.0,688,0.26,0,0.0,512,0.2,0,0.0,,,,
arduino:samd:mkrnb1500,608,0.23,0,0.0,600,0.23,0,0.0,600,0.23,0,0.0,512,0.2,0,0.0,,,,
arduino:samd:mkrwan1300,112,0.04,0,0.0,112,0.04,0,0.0,112,0.04,0,0.0,,,,,,,,
arduino:samd:mkrwifi1010,888,0.34,0,0.0,888,0.34,0,0.0,888,0.34,0,0.0,704,0.27,0,0.0,0,0.0,0,0.0
arduino:samd:nano_33_iot,888,0.34,0,0.0,888,0.34,0,0.0,888,0.34,0,0.0,704,0.27,0,0.0,0,0.0,0,0.0
esp32:esp32:esp32,724,0.06,0,0.0,668,0.05,0,0.0,716,0.05,0,0.0,,,,,,,,
esp8266:esp8266:huzzah,620,0.06,352,0.43,624,0.06,364,0.44,620,0.06,352,0.43,,,,,,,,

github-actions[bot] avatar Oct 25 '21 09:10 github-actions[bot]

@zmoog a part from the qos thing that @aentinger already pointed out i would love to see this pr mainlined.

This will give the possibility to user to enable a more detailed log only setting setDebugMessageLevel(DEBUG_VERBOSE) in the sketch.

I think is worth to add the download start and reset information also for the portenta and the rp2040. See OTA-portenta-h7.cpp and OTA-nano-rp2040.cpp files.

@aentinger is there any particular reason why library is shipped with this line commented out?

pennam avatar Oct 27 '21 13:10 pennam

I think is worth to add the download start and reset information also for the portenta and the rp2040. See OTA-portenta-h7.cpp and OTA-nano-rp2040.cpp files.

I also added a few DEBUG_VERBOSE() for portenta h7 and rp2040 boards to mark download start/end and reboot.

zmoog avatar Oct 27 '21 14:10 zmoog

Memory usage change @ 614ebe66bcb91586bb224b0aed30d3772e075f07

Board flash % RAM for global variables %
arduino:mbed:envie_m4 :small_red_triangle: +512 - +640 +0.05 - +0.06 0 - 0 0.0 - 0.0
arduino:mbed:envie_m7 :small_red_triangle: +840 - +968 +0.11 - +0.12 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 :small_red_triangle: +512 - +608 +0.2 - +0.23 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 :small_red_triangle: +512 - +688 +0.2 - +0.26 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 :small_red_triangle: +512 - +608 +0.2 - +0.23 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 :small_red_triangle: +112 - +112 +0.04 - +0.04 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 :small_red_triangle: 0 - +888 0.0 - +0.34 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot :small_red_triangle: 0 - +888 0.0 - +0.34 0 - 0 0.0 - 0.0
esp32:esp32:esp32 :small_red_triangle: +668 - +724 +0.05 - +0.06 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah :small_red_triangle: +620 - +624 +0.06 - +0.06 :small_red_triangle: +352 - +364 +0.43 - +0.44
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 640 0.06 0 0.0 568 0.05 0 0.0 632 0.06 0 0.0 512 0.05 0 0.0
arduino:mbed:envie_m7 968 0.12 0 0.0 968 0.12 0 0.0 960 0.12 0 0.0 840 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 608 0.23 0 0.0 600 0.23 0 0.0 600 0.23 0 0.0 512 0.2 0 0.0
arduino:samd:mkrgsm1400 688 0.26 0 0.0 688 0.26 0 0.0 688 0.26 0 0.0 512 0.2 0 0.0
arduino:samd:mkrnb1500 608 0.23 0 0.0 600 0.23 0 0.0 600 0.23 0 0.0 512 0.2 0 0.0
arduino:samd:mkrwan1300 112 0.04 0 0.0 112 0.04 0 0.0 112 0.04 0 0.0
arduino:samd:mkrwifi1010 888 0.34 0 0.0 888 0.34 0 0.0 888 0.34 0 0.0 704 0.27 0 0.0 0 0.0 0 0.0
arduino:samd:nano_33_iot 888 0.34 0 0.0 888 0.34 0 0.0 888 0.34 0 0.0 704 0.27 0 0.0 0 0.0 0 0.0
esp32:esp32:esp32 724 0.06 0 0.0 668 0.05 0 0.0 716 0.05 0 0.0
esp8266:esp8266:huzzah 620 0.06 352 0.43 624 0.06 364 0.44 620 0.06 352 0.43
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,640,0.06,0,0.0,568,0.05,0,0.0,632,0.06,0,0.0,512,0.05,0,0.0
arduino:mbed:envie_m7,968,0.12,0,0.0,968,0.12,0,0.0,960,0.12,0,0.0,840,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,608,0.23,0,0.0,600,0.23,0,0.0,600,0.23,0,0.0,512,0.2,0,0.0,,,,
arduino:samd:mkrgsm1400,688,0.26,0,0.0,688,0.26,0,0.0,688,0.26,0,0.0,512,0.2,0,0.0,,,,
arduino:samd:mkrnb1500,608,0.23,0,0.0,600,0.23,0,0.0,600,0.23,0,0.0,512,0.2,0,0.0,,,,
arduino:samd:mkrwan1300,112,0.04,0,0.0,112,0.04,0,0.0,112,0.04,0,0.0,,,,,,,,
arduino:samd:mkrwifi1010,888,0.34,0,0.0,888,0.34,0,0.0,888,0.34,0,0.0,704,0.27,0,0.0,0,0.0,0,0.0
arduino:samd:nano_33_iot,888,0.34,0,0.0,888,0.34,0,0.0,888,0.34,0,0.0,704,0.27,0,0.0,0,0.0,0,0.0
esp32:esp32:esp32,724,0.06,0,0.0,668,0.05,0,0.0,716,0.05,0,0.0,,,,,,,,
esp8266:esp8266:huzzah,620,0.06,352,0.43,624,0.06,364,0.44,620,0.06,352,0.43,,,,,,,,

github-actions[bot] avatar Oct 27 '21 18:10 github-actions[bot]

@aentinger is there any particular reason why library is shipped with this line commented out?

Yes. It consumes a lot of memory, since all debug strings are stored in flash. However, I think RP2040 and Portenta H7 can take the flash hit, SAMD based boards definitely shouldn't, Uno WiFi Rev. 2 couldn't :wink: Just keep this in the back of your mind.

aentinger avatar Oct 28 '21 04:10 aentinger

Addition: If you think some output is super-useful, you could upgrade it to DEBUG_INFO?

aentinger avatar Oct 28 '21 04:10 aentinger

superseded by #449

pennam avatar Apr 24 '24 08:04 pennam