Skip to content

Conversation

pennam
Copy link
Contributor

@pennam pennam commented Oct 3, 2023

Should fix #152 Needs #134

@pennam pennam requested a review from andreagilardoni October 3, 2023 07:39
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Oct 3, 2023
@yann-l
Copy link

yann-l commented Oct 3, 2023

Hi,
First thanks for this work, such a function is really missing. in IoT, we do need to be able to update the firmware, and of course not from a .h file.

2 comments though:

  • in HTTP: I'm not able to download an ota file. If I try your ota file(330ko) it stops downloading at about 250-300ko, if I try my own ota file (450ko) it stops at about 350ko).

  • It doesn't work over HTTPS:

22:11:18.681 -> ssl_msg.c:1419: mbedtls_cipher_auth_decrypt_ext() returned -25344 (-0x6300)
22:11:18.681 -> ssl_msg.c:3763: ssl_decrypt_buf() returned -29056 (-0x7180)
22:11:18.681 -> ssl_msg.c:3918: ssl_get_next_record() returned -29056 (-0x7180)
22:11:18.681 -> ssl_msg.c:5501: mbedtls_ssl_read_record() returned -29056 (-0x7180)
22:11:18.681 -> [data_to_read():400]: (-29056) SSL - Verification of the message MAC failed

downloading big files (more than 2-3ko) doesn't work with WiFiSSLClient. Here is the exact problem I have and an (IMHO) ugly but working workaround: https://stackoverflow.com/questions/75941895/why-does-my-https-request-get-disconnected-on-large-files
using HTTPS is mandatory for obvious security reasons, and ota files are too big.

EDIT: After applying #134 it works with HTTP and HTTPS. Great work!

@pennam
Copy link
Contributor Author

pennam commented Oct 4, 2023

@yann-l yes, this PR needs #134 to work properly with WiFi. I've updated the description.

Thanks for testing!

@facchinm
Copy link
Member

facchinm commented Oct 9, 2023

The CI error is expected since the download() API is not art of 1.0.4 core. Merging.

@facchinm facchinm merged commit bd5b7fd into arduino:main Oct 9, 2023
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.

C33 SFU OTAUsage example just blinks LEDs?
5 participants