-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Custom Baudrate OSX #139
Comments
I had the same issue, but found adding the following block to line 343 a bit more elegant:
Tested this super quickly on my macbook running macOS 10.12 |
@saynono This is correct as far as I can see. I look into source code of PySerial (in def _reconfigure_port(self, force_update=False):
...
# activate settings
if force_update or [iflag, oflag, cflag, lflag, ispeed, ospeed, cc] != orig_attr:
termios.tcsetattr(
self.fd,
termios.TCSANOW,
[iflag, oflag, cflag, lflag, ispeed, ospeed, cc])
# apply custom baud rate, if any
if custom_baud is not None:
self._set_special_baudrate(custom_baud) We need to set custom baudrate after calling tcsetattr. Since I can use PySerial to connect my Arduino by 250000 baudrate yet I cannot do this via this c++ serial library, I believe this is at least a big difference I can find. Same issue also showed up in other project and a similar solution here: Custom baud rate in OSX won't work #57, npat-efault/picocom. In my scenario the problem is solved on macOS Mojave 10.14.4. My commit: 4773265 |
…d by PySerial source code and wjwwood#57 of github.com/npat-efault/picocom, we need to set custom baudrate after calling tcsetattr; tested on macOS Mojave 10.14.4 (wjwwood#218)
…d by PySerial source code and wjwwood#57 of github.com/npat-efault/picocom, we need to set custom baudrate after calling tcsetattr; tested on macOS Mojave 10.14.4 (wjwwood#218)
Hi.
It seems that following line:441 in unix Serial::SerialImpl::reconfigurePort resets custom baudrates on OSX.
Setting custom baudrates after this line fixes this as far as I can tell.
Also for noobs as myself, might be helpfull mentioning to call this on OSX:
stty ospeed <custom_baudrate>
stty ispeed <custom_baudrate>
and on linux
sudo stty -F <port> <custom_baudrate>
My changes here:
saynono@c997027
The text was updated successfully, but these errors were encountered: