-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Enhancement request: Stream or File support #35
Comments
I’m pretty busy lately, but I’ll see what I can do |
So I tried to take a knack at it the last day or two:
Wrote: 1101598 of 1101408 in loops: 4337 4337 read * 254 bytes = 1101598 = what was written to update.h by size_t written = Update.write((uint8_t*)updateBuffer, sizeof(updateBuffer)-1); // -1 = remove null terminator from c string But the data on the flashdrive was 1101408 big I chatted to a couple guys on the arduino-esp32 gitter about it, and it seems readFile is meant for ascii data, and having trouble with the Binary data I am trying to read (firmware image bin) So might not need full on streaming support, but if you can find a couple minutes to play with the sample code and see what I am doing wrong, or if I should be using https://github.com/djuseeq/Ch376msc/blob/master/src/Read.cpp#L72 or something else (: |
Just checking if if you maybe have had a chance to look at this (: |
Hi, to read a binary data use readRaw() function instead. Try this branch, i wrote one extra function to be more simply to use. For testing purpose i read 848 Kb .elf file and send it over UART to computer, after a compare two files, the checksum s are identical, so the read is correct. |
That did the job (:
I'll clean up my code after this stint of the project, and then I'll send over an Example sketch for this (: very useful Thank you for your help! |
So I can use writeStream from https://github.com/espressif/arduino-esp32/blob/master/libraries/Update/examples/SD_Update/SD_Update.ino (:
Other example: https://techtutorialsx.com/2019/07/21/esp32-arduino-updating-firmware-from-the-spiffs-file-system/
Between the examples, SD and SPIFFS covered, no if only CH376s library had a stream interface (;
[alternative, I am far to stupid to figure out hehe, is to use https://github.com/espressif/arduino-esp32/blob/master/libraries/Update/src/Update.h#L46-L50
The text was updated successfully, but these errors were encountered: