Skip to content
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

Stop reading OTA firmware byte-by-byte? #131

Open
JosephHewitt opened this issue Nov 9, 2023 · 0 comments
Open

Stop reading OTA firmware byte-by-byte? #131

JosephHewitt opened this issue Nov 9, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@JosephHewitt
Copy link
Owner

The updates to A are loaded in chunks into a 4096 buffer one byte at a time:

while (binreader.available()) {
     byte c = binreader.read();
     binbuf[counter] = c;
     counter++;

This can likely be refactored to something like what was recently used for uploading files to WiGLE, eg:

#define CBUFLEN 1024
byte cbuf[CBUFLEN];
while (filereader.available()){
    long bytes_available = filereader.available();
    int toread = CBUFLEN;
    if (bytes_available < CBUFLEN){
      toread = bytes_available;
    }
    
    filereader.read(cbuf, toread);

Check if this increases the OTA update speed. This doesn't need to be done for B since that has other bottlenecks elsewhere.

@JosephHewitt JosephHewitt added the enhancement New feature or request label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant