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

Serialport communication fails at 250000 baudrate on Raspberry Pi #1362

Closed
matthova opened this issue Oct 12, 2017 · 6 comments
Closed

Serialport communication fails at 250000 baudrate on Raspberry Pi #1362

matthova opened this issue Oct 12, 2017 · 6 comments

Comments

@matthova
Copy link

matthova commented Oct 12, 2017

  • SerialPort Version: 6

  • NodeJS Version: 8.7

  • Operating System and Hardware Platform: Raspbian Jessie Lite on Raspberry pi

  • Have you checked the right version of the api docs?: Yes

  • Are you having trouble installing and you checked the Installation Special Cases docs? N/A

  • Are you using Electron and have you checked the Electron Docs?: N/A

Summary of Problem

Unable to communicate with Arduino at 250000 baudrate. Identical code runs great on 2014 Mac running OSX 10.12

Steps and Code to Reproduce the Issue

I've created a repo for reproducing this bug:
https://github.com/matthova/serialport-6-250000-test

@matthova matthova changed the title Serialport not able to connect at 250000 baudrate to Ultimaker Serialport communication fails at 250000 baudrate on Raspberry Pi Oct 13, 2017
@matthova
Copy link
Author

Just attempted the same code on Raspbian Stretch lite with the same failure mode of no reply.

@fivdi
Copy link
Contributor

fivdi commented Oct 15, 2017

Linux has standard baud rates and custom baud rates. Standard baud rates are handled by serialport and can be seen here. serialport also has code for handling custom baud rates here.

250000 is a custom baud rate and for some reason it doesn't work. I tried out the code in your repo and attempting to set the baud rate to 250000 actually sets it to 38400. I'm not sure if this is a serialport issue, a Raspbian driver issue or something else. Ubuntu 14.04 also has the issue.

What does work is if the baud rate is set to a standard baud rate like 230400 which is fairly close to 250000.

@matthova
Copy link
Author

@fivdi thanks for confirming the issue and for more background on where it's handled. I wish I could just set the baudrate to 250000 but I'm stuck working with 3rd party hardware that is set at 250000. @reconbot let me know if there is anything I can do to dig into the code and help with a solution.

@reconbot
Copy link
Member

The c++ code needs to use the termios2 struct on linux to get that rate. I tried a while back without success (I knew even less what I was doing back then). The branch is even still around (though horribly out of date) https://github.com/EmergingTechnologyAdvisors/node-serialport/compare/baudrates?expand=1

@stale
Copy link

stale bot commented Sep 16, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week no further activity occurs. Feel free continue the discussion or ask for a never-stale label to keep it open. If this is a support issue, consider sharing it on stack overflow to get more eyes on your problem.

@stale stale bot added the wontfix label Sep 16, 2018
@stale
Copy link

stale bot commented Nov 15, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week no further activity occurs. Feel free continue the discussion or ask for a never-stale label to keep it open. If this is a support issue, consider sharing it on stack overflow to get more eyes on your problem.

@stale stale bot added the stale-issue label Nov 15, 2018
@stale stale bot closed this as completed Nov 22, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants