Skip to content

Improve reliability on connection loss #233

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 4 commits into from
Mar 4, 2021

Conversation

aentinger
Copy link
Contributor

This fixes #86 and #221 (:pray:). @jcham @IgorSchelle can you please test?

CC @eclipse1985 @zmoog can please you test on your setup too?

…event getting stuck up in low_read/low_write (BearSSLClient::clientRead/clientWrite.
…ng topic subscription and request of last values. Otherwise it can happen that the connection is ripped out under you and you won't even notice.
@aentinger aentinger added the type: enhancement Proposed improvement label Mar 1, 2021
@aentinger aentinger self-assigned this Mar 1, 2021
@eclipse1985
Copy link
Contributor

Sure, I just uploaded a sketch that uses this PR.

@github-actions
Copy link

github-actions bot commented Mar 1, 2021

Memory usage change @ 5d3b90c

Board flash % RAM for global variables %
arduino:mbed:envie_m4 🔺 +152 - +224 +0.01 - +0.02 🔺 +8 - +8 0.0 - 0.0
arduino:mbed:envie_m7 🔺 +152 - +216 +0.02 - +0.03 🔺 +8 - +8 0.0 - 0.0
arduino:samd:mkr1000 🔺 +192 - +192 +0.07 - +0.07 🔺 +8 - +8 +0.02 - +0.02
arduino:samd:mkrgsm1400 🔺 +192 - +200 +0.07 - +0.08 🔺 +8 - +8 +0.02 - +0.02
arduino:samd:mkrnb1500 🔺 +192 - +192 +0.07 - +0.07 🔺 +8 - +8 +0.02 - +0.02
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 0 - +192 0.0 - +0.07 🔺 0 - +8 0.0 - +0.02
arduino:samd:nano_33_iot 🔺 0 - +192 0.0 - +0.07 🔺 0 - +8 0.0 - +0.02
esp32:esp32:esp32 🔺 +132 - +132 +0.01 - +0.01 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah 🔺 +120 - +120 +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:envie_m4 216 0.02 8 0.0 224 0.02 8 0.0 152 0.01 8 0.0 216 0.02 8 0.0
arduino:mbed:envie_m7 152 0.02 8 0.0 216 0.03 8 0.0 216 0.03 8 0.0 152 0.02 8 0.0
arduino:samd:mkr1000 192 0.07 8 0.02 192 0.07 8 0.02 192 0.07 8 0.02 192 0.07 8 0.02
arduino:samd:mkrgsm1400 192 0.07 8 0.02 192 0.07 8 0.02 200 0.08 8 0.02 192 0.07 8 0.02
arduino:samd:mkrnb1500 192 0.07 8 0.02 192 0.07 8 0.02 192 0.07 8 0.02 192 0.07 8 0.02
arduino:samd:mkrwan1300 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwifi1010 192 0.07 8 0.02 192 0.07 8 0.02 192 0.07 8 0.02 192 0.07 8 0.02 0 0.0 0 0.0
arduino:samd:nano_33_iot 192 0.07 8 0.02 192 0.07 8 0.02 192 0.07 8 0.02 192 0.07 8 0.02 0 0.0 0 0.0
esp32:esp32:esp32 132 0.01 0 0.0 132 0.01 0 0.0 132 0.01 0 0.0
esp8266:esp8266:huzzah 120 0.01 0 0.0 120 0.01 0 0.0 120 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:envie_m4,216,0.02,8,0.0,224,0.02,8,0.0,152,0.01,8,0.0,216,0.02,8,0.0
arduino:mbed:envie_m7,152,0.02,8,0.0,216,0.03,8,0.0,216,0.03,8,0.0,152,0.02,8,0.0
arduino:samd:mkr1000,192,0.07,8,0.02,192,0.07,8,0.02,192,0.07,8,0.02,192,0.07,8,0.02
arduino:samd:mkrgsm1400,192,0.07,8,0.02,192,0.07,8,0.02,200,0.08,8,0.02,192,0.07,8,0.02
arduino:samd:mkrnb1500,192,0.07,8,0.02,192,0.07,8,0.02,192,0.07,8,0.02,192,0.07,8,0.02
arduino:samd:mkrwan1300,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,,,,
arduino:samd:mkrwifi1010,192,0.07,8,0.02,192,0.07,8,0.02,192,0.07,8,0.02,192,0.07,8,0.02,0,0.0,0,0.0
arduino:samd:nano_33_iot,192,0.07,8,0.02,192,0.07,8,0.02,192,0.07,8,0.02,192,0.07,8,0.02,0,0.0,0,0.0
esp32:esp32:esp32,132,0.01,0,0.0,132,0.01,0,0.0,132,0.01,0,0.0,,,,,,,,
esp8266:esp8266:huzzah,120,0.01,0,0.0,120,0.01,0,0.0,120,0.01,0,0.0,,,,,,,,

@IgorSchelle
Copy link

IgorSchelle commented Mar 1, 2021 via email

@zmoog
Copy link

zmoog commented Mar 1, 2021

@aentinger deployed on my test weather station.

@aentinger aentinger marked this pull request as ready for review March 4, 2021 09:58
@codecov-io
Copy link

codecov-io commented Mar 4, 2021

Codecov Report

Merging #233 (9852cd6) into master (d8a3a98) will decrease coverage by 0.11%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #233      +/-   ##
==========================================
- Coverage   95.27%   95.15%   -0.12%     
==========================================
  Files          25       24       -1     
  Lines         889      867      -22     
==========================================
- Hits          847      825      -22     
  Misses         42       42              
Impacted Files Coverage Δ
src/property/Property.h 88.88% <0.00%> (-1.59%) ⬇️
src/property/PropertyContainer.cpp 88.88% <0.00%> (-0.40%) ⬇️
src/property/types/CloudColor.h 97.05% <0.00%> (-0.03%) ⬇️
src/property/types/CloudInt.h 100.00% <0.00%> (ø)
src/property/types/CloudBool.h 100.00% <0.00%> (ø)
src/property/types/CloudFloat.h 100.00% <0.00%> (ø)
src/property/types/CloudString.h 100.00% <0.00%> (ø)
src/property/types/CloudLocation.h 100.00% <0.00%> (ø)
src/property/types/automation/CloudLight.h 100.00% <0.00%> (ø)
src/property/types/automation/CloudSwitch.h 100.00% <0.00%> (ø)
... and 8 more

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 68f4b51...9852cd6. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Mar 4, 2021

Memory usage change @ 9852cd6

Board flash % RAM for global variables %
arduino:mbed:envie_m4 🔺 +152 - +224 +0.01 - +0.02 🔺 +8 - +8 0.0 - 0.0
arduino:mbed:envie_m7 🔺 +152 - +216 +0.02 - +0.03 🔺 +8 - +8 0.0 - 0.0
arduino:samd:mkr1000 🔺 +168 - +176 +0.06 - +0.07 🔺 +8 - +8 +0.02 - +0.02
arduino:samd:mkrgsm1400 🔺 +176 - +176 +0.07 - +0.07 🔺 +8 - +8 +0.02 - +0.02
arduino:samd:mkrnb1500 🔺 +168 - +176 +0.06 - +0.07 🔺 +8 - +8 +0.02 - +0.02
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 0 - +176 0.0 - +0.07 🔺 0 - +8 0.0 - +0.02
arduino:samd:nano_33_iot 🔺 0 - +176 0.0 - +0.07 🔺 0 - +8 0.0 - +0.02
esp32:esp32:esp32 🔺 +132 - +132 +0.01 - +0.01 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah 🔺 +120 - +120 +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:envie_m4 152 0.01 8 0.0 224 0.02 8 0.0 152 0.01 8 0.0 216 0.02 8 0.0
arduino:mbed:envie_m7 152 0.02 8 0.0 216 0.03 8 0.0 216 0.03 8 0.0 152 0.02 8 0.0
arduino:samd:mkr1000 176 0.07 8 0.02 168 0.06 8 0.02 176 0.07 8 0.02 176 0.07 8 0.02
arduino:samd:mkrgsm1400 176 0.07 8 0.02 176 0.07 8 0.02 176 0.07 8 0.02 176 0.07 8 0.02
arduino:samd:mkrnb1500 168 0.06 8 0.02 176 0.07 8 0.02 176 0.07 8 0.02 176 0.07 8 0.02
arduino:samd:mkrwan1300 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwifi1010 168 0.06 8 0.02 176 0.07 8 0.02 176 0.07 8 0.02 176 0.07 8 0.02 0 0.0 0 0.0
arduino:samd:nano_33_iot 168 0.06 8 0.02 176 0.07 8 0.02 176 0.07 8 0.02 168 0.06 8 0.02 0 0.0 0 0.0
esp32:esp32:esp32 132 0.01 0 0.0 132 0.01 0 0.0 132 0.01 0 0.0
esp8266:esp8266:huzzah 120 0.01 0 0.0 120 0.01 0 0.0 120 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:envie_m4,152,0.01,8,0.0,224,0.02,8,0.0,152,0.01,8,0.0,216,0.02,8,0.0
arduino:mbed:envie_m7,152,0.02,8,0.0,216,0.03,8,0.0,216,0.03,8,0.0,152,0.02,8,0.0
arduino:samd:mkr1000,176,0.07,8,0.02,168,0.06,8,0.02,176,0.07,8,0.02,176,0.07,8,0.02
arduino:samd:mkrgsm1400,176,0.07,8,0.02,176,0.07,8,0.02,176,0.07,8,0.02,176,0.07,8,0.02
arduino:samd:mkrnb1500,168,0.06,8,0.02,176,0.07,8,0.02,176,0.07,8,0.02,176,0.07,8,0.02
arduino:samd:mkrwan1300,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,,,,
arduino:samd:mkrwifi1010,168,0.06,8,0.02,176,0.07,8,0.02,176,0.07,8,0.02,176,0.07,8,0.02,0,0.0,0,0.0
arduino:samd:nano_33_iot,168,0.06,8,0.02,176,0.07,8,0.02,176,0.07,8,0.02,168,0.06,8,0.02,0,0.0,0,0.0
esp32:esp32:esp32,132,0.01,0,0.0,132,0.01,0,0.0,132,0.01,0,0.0,,,,,,,,
esp8266:esp8266:huzzah,120,0.01,0,0.0,120,0.01,0,0.0,120,0.01,0,0.0,,,,,,,,

@arduino-libraries arduino-libraries deleted a comment from github-actions bot Mar 4, 2021
@aentinger aentinger merged commit 70efc00 into master Mar 4, 2021
@aentinger aentinger deleted the fix-reliability-on-connection-loss branch March 4, 2021 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ArduinoIoTCloudClass::update() stuck when internet connection fails
5 participants