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

[Feature] allow serial speed to be increased #277

Open
amandel opened this issue Aug 8, 2022 · 9 comments
Open

[Feature] allow serial speed to be increased #277

amandel opened this issue Aug 8, 2022 · 9 comments

Comments

@amandel
Copy link
Contributor

amandel commented Aug 8, 2022

If I flash via command line I use upload_speed of 921600. It would be great if this is also possible via esp-web-tools, might be as a additional parameter (per build) in the manifest?

@balloob
Copy link
Member

balloob commented Aug 8, 2022

The reason I haven't made it configurable yet until now is because switching the baud rate on a serial port that has been used before on the old baud rate is causing the serial port in the browser to stop working (and I haven't spend time to investigate why). Ideally we would go to a faster speed when we know it is supported.

The current speed is chosen because it works for both good and shitty UART chips.

Allowing you to configure one means it might not work on every chip. Now as a firmware owner you probably know what you do and don't support so this can be considered.

@TD-er
Copy link

TD-er commented Aug 8, 2022

Now as a firmware owner you probably know what you do and don't support

Wow, tricky assumption ;)

But on a more serious note, can you see what the current baudrate is?

@balloob
Copy link
Member

balloob commented Aug 8, 2022

  1. It's currently defined in 3 different places

@TD-er
Copy link

TD-er commented Aug 8, 2022

I meant checking the serial port to ask its set baudrate.
Not the speed you (try to) set it to.

@balloob
Copy link
Member

balloob commented Aug 8, 2022

That's not how it works. We request a port, and then we open it with a specific baudrate (docs)

@amandel
Copy link
Contributor Author

amandel commented Aug 8, 2022

Thanks for the details. Actually we only use one devkit, but still there are many variants and clones out there.
I also like a no options but working solution 😃 so I see your points. But we have groups that install several devices in a row. There it would specially help to speed it up.
I'm not too deep into this, would it be sufficient to adjust the 3 places you mentioned with a higher speed? If so, I could give it a try and feedback (will take some time)

@balloob
Copy link
Member

balloob commented Aug 8, 2022

If it makes your life easier, you could open a PR first to extract it into a single constant. That would make it configurable later on easier too.

@Jason2866
Copy link
Contributor

Jason2866 commented Aug 15, 2022

If I flash via command line I use upload_speed of 921600. It would be great if this is also possible via esp-web-tools, might be as a additional parameter (per build) in the manifest?

Flashed a lot of different devices (beeing a member of Tasmota). Tried to increase the speed from 115200 to higher ones. Finally i went back to 115200 as standard for Tasmota setup. Even devices from the same type (which one worked with higher serial speed) are not safe to use with higher speeds.
You never know what clone USB serial chip is used.

I believe, you like more not to do unnecessary issue work. So it is just telling some users the speed used is the safe one.

I had until now, no Tasmota user complaining about the speed when using the Tasmota Web Installer. Almost everyone is happy how simple it is to get the firmware installed.

@amandel
Copy link
Contributor Author

amandel commented Aug 28, 2022

I had good results using my test device (which does say nothing for the field, I know). Seeing the increase in speed, it might be worth to give it a try and fallback if it does not work. I've to say again that I only work with "esp32dev" boards having to flash any device you are likely better of not putting it in a strange state where you might loose communication.

I had do do minimal changes to the call to the esploader.js where I'm not sure why the initial change_baud call as part of main_fn does not work. Might be esploader.js needs some more love or I've to dive deeper into JS.

The change I did is applied as "patch" to esp-web-tools in this Dockerfile, see the changes here: https://github.com/openbikesensor/OpenBikeSensorFlasher/pull/25/files

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

No branches or pull requests

4 participants