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

stty not called until baud rate is changed #13

Open
chrstphrchvz opened this issue May 9, 2016 · 0 comments
Open

stty not called until baud rate is changed #13

chrstphrchvz opened this issue May 9, 2016 · 0 comments

Comments

@chrstphrchvz
Copy link
Collaborator

I mentioned encountering difficulty getting a device working under Linux in #5:

I haven't gotten the board working with HSW12 on Linux yet, but I don't think it's an issue with HSW12 specifically. It looks as if it's immediately echoing back any prompts from D-Bug12 and gets stuck in a "Bad Command" loop, but the same happens when using cat < /dev/ttyUSB0. minicom works, though.

I have since found that once I used minicom with the device, other programs such as HSW12 and cat worked as expected. This was due to the terminal line settings being updated by minicom and persisting in other programs, as stty -F /dev/ttyUSB0 will output many changes in the settings compared to the default Linux settings or stty -F /dev/ttyUSB0 sane (neither of which were usable due to echoing, hardware flow control, etc.).

The default settings for stty in hsw12_pod.pm indeed make the device usable, but at the moment stty is not called until the baud is manually configured (which I had not been doing). But if the device is already be sending data to the computer, then it immediately gets stuck in an echo loop, sometimes hanging HSW12, and not allow the baud to be changed (and stty to turn off echoing).

So should HSW12 either be executing stty when connecting to the port, or should it also be setting the baud (in turn executing stty)? If the stty command needs to include setting the baud, maybe either a default baud is specified (e.g. 9600), or the existing baud is read using stty -F $device speed before executing stty again.

chrstphrchvz added a commit to chrstphrchvz/HSW12 that referenced this issue May 22, 2018
chrstphrchvz added a commit to chrstphrchvz/HSW12 that referenced this issue May 24, 2018
chrstphrchvz added a commit to chrstphrchvz/HSW12 that referenced this issue May 31, 2018
chrstphrchvz added a commit to chrstphrchvz/HSW12 that referenced this issue Jul 2, 2018
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

1 participant