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

Remove default baud rate #50

Closed
reconbot opened this issue Sep 23, 2018 · 10 comments
Closed

Remove default baud rate #50

reconbot opened this issue Sep 23, 2018 · 10 comments

Comments

@reconbot
Copy link
Contributor

reconbot commented Sep 23, 2018

The spec asks if there is a default common baudrate. I don't think there is one. Most hardware can operate at a wide range of rates, and most consumer devices want to run at their maximum rate as determined by their hardware. What these rates are is unknown in advance.

It would need to be removed from

If there is a baud rate that is common for a large range of hardware that will make use of this API, the API should provide a default baud rate value.

And EXAMPLE 1 would need to be updated as the settings argument of the constructor would need to be required, or the path moved into the options object.

@Fleker
Copy link

Fleker commented Jun 18, 2019

9600 or 19200 seems to be relatively common.

@reconbot
Copy link
Contributor Author

It's very common, however most devices can run at many different rates. 9600 persists for a variety of reasons (default for arduino, default for many devices) however it's really really slow compared to what most hardware can actually do. Cable length also comes into play 9600 can go about 20 meters and higher rates like 115200 can only go 2-3 meters. In modern devices we only need to go 2-3cm as USB is generally the transport to the device.

All that aside, you need to know what speed your device runs at, it might be 9600 and it might not. A default rate leads to unexplained errors as data generally comes through garbled and the setting that caused that is hidden away. Node serialport used to have a default rate of 9600 and it would cause a common support issue. Since removing the default a few years ago the issue went away.

and since removing that default a few years ago I haven't seen any further support issues

@Fleker
Copy link

Fleker commented Jun 19, 2019

What if there was an autobaud feature?

@reconbot
Copy link
Contributor Author

That’s not an os feature, what we’re you thinking?

@Fleker
Copy link

Fleker commented Jun 19, 2019

Autobaud is software that will automatically determine serial settings including baud rate.

@reconbot
Copy link
Contributor Author

Seems to be a device feature not an host computer feature.

@Fleker
Copy link

Fleker commented Jun 20, 2019

It may serve as a good "default", since it could automatically detect everything without manual setup. But it may also cause more problems due to acting opaquely.

@josesimoes
Copy link

If I understand it correctly that "autobaud" relies on looking for a specific char on the start of a stream in order to go on a trial and error approach until it finds the correct baud that allow that char to be received.
It's application dependent. You would need to enforce that for all devices that would connect using this!

I really think this is not doable nor it's necessary. If automatic baud rate is to exist it should be implemented at application layer not here.

My 2 cents! 😉

@boneskull
Copy link

I agree; make baud rate required. usually with required parameters, I would rather not have to stuff them into an “options” object, fwiw.

@reillyeon
Copy link
Collaborator

This was fixed by #105.

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

5 participants