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

Address 3 issues: baud rate change, flash reading, instantiation with port #112

Closed
wants to merge 5 commits into from

Conversation

g3gg0
Copy link

@g3gg0 g3gg0 commented Sep 19, 2023

This PR adds 3 changes that made the code usable in TeddyCloud, a toniebox server implementation.

Reading flash memory

the function read_flash() allows reading back the flash

Baud rate fix

changing the baud rate did not resynchronize properly. added sync and retries.
this way 921600 baud connection works always. before it worked 1 out of 30 connection attempts.

Instantiation using WebSerial port as well as Transport

simplify caller's code by directly using WebSerial port object if specified.

esploader = new ESPLoader({
  port: port,
  baudrate: 921600,
  romBaudrate: 115200
});

@balloob
Copy link
Contributor

balloob commented Oct 10, 2023

@igrr this change looks good. It might fix an issue we’re seeing with ESP Web Tools. Can we get this merged and released?

@g3gg0
Copy link
Author

g3gg0 commented Oct 10, 2023

interesting failures...
ah i see. it is complaing due to formatting issues?
got it.

@g3gg0
Copy link
Author

g3gg0 commented Oct 10, 2023

did update the code, but didn't run it yet in our project (https://github.com/toniebox-reverse-engineering/teddycloud)
will do the functional checks in 1-2 days

@brianignacio5
Copy link
Collaborator

Thanks for the PR @g3gg0 looks great !

I've tested locally with esp32 wrover kit and works good. You can test the lint locally with npm run lint and after this will merge the PR.

Copy link
Collaborator

@brianignacio5 brianignacio5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor changes

if (onPacketReceived) {
onPacketReceived(packet, resp.length, size);
}
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove or handle packet not received

try {
await this.sync();
break;
} catch (error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can use this.debug(msg) which will only log when debugLogging is enabled.

@brianignacio5
Copy link
Collaborator

brianignacio5 commented Oct 12, 2023

Closing this PR since it is merged with fixes in 04e337d

@balloob
Copy link
Contributor

balloob commented Oct 16, 2023

Thanks. Don't forget to tag the release on GitHub too.

@balloob
Copy link
Contributor

balloob commented Oct 16, 2023

I found a small bug in the type which I reported here 04e337d#r130045791

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants