-
-
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
Error while opening serial port under Windows #1353
Comments
Does it work in node?
…On Sat, Oct 7, 2017, 10:50 AM Evgeni Milev ***@***.***> wrote:
-
*SerialPort Version*: 6.0.0-beta2
-
*NodeJS Version*: 7.9.0 (Electron 1.8.1)
-
*Operating System* and *Hardware Platform*: Windows 7
-
Have you checked the right *version* of the *api docs?*: yes
-
Are you having trouble installing and you checked the *Installation
Special Cases* docs? yes
-
Are you using *Electron* and have you checked the *Electron Docs*?: yes
Summary of Problem
I get this error when trying to open existing but not connected port:
Error: Open (SetCommState): Unknown error code 87
Steps and Code to Reproduce the Issue
Here is my code:
let port = 'COM1'
let conf = { baudRate: Number(speed) }
port = new SerialPort(port, conf)
const parser = new Readline();
port.pipe(parser)
parser.on('data', (data) => {
console.log(data)
})
port.on('error', err => console.error(t.port + ' error: ', err))
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1353>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABlbmqUO8iUtBNfKTcosQrgrnCa2tYcks5sp4-0gaJpZM4PxX5G>
.
|
It works fine with node 8.6.0 (latest). I'll downgrade node to the version of Electron and I'll try again. |
It also works fine with node 7.9.0 What's interesting tough is that with serialport 5.0.0 my program hangs, and with 6.0.0-beta2 it exists immediately. I don't know if this is related to the error I'm getting with Electron. |
I reproduced the problem with all node versions. I was pasing 0 as |
It appears that the c++ code is running ok, the open error |
It's what the OS gives us ¯\_(ツ)_/¯
…On Sat, Oct 7, 2017, 4:52 PM Evgeni Milev ***@***.***> wrote:
I reproduced the problem with all node versions. I was pasing 0 as
baudRate. I don't know if 0 is a valid value but 'error code 87' is not a
very clear error message.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1353 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABlblMEcfPqq9R7gGhOBJYHPHuJyx2yks5sp-SLgaJpZM4PxX5G>
.
|
I would 100% take a pr that throws on this error, if it hit you it has hit
others too.
…On Sat, Oct 7, 2017, 5:33 PM Francis Gulotta ***@***.***> wrote:
It's what the OS gives us ¯\_(ツ)_/¯
On Sat, Oct 7, 2017, 4:52 PM Evgeni Milev ***@***.***>
wrote:
> I reproduced the problem with all node versions. I was pasing 0 as
> baudRate. I don't know if 0 is a valid value but 'error code 87' is not
> a very clear error message.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#1353 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AABlblMEcfPqq9R7gGhOBJYHPHuJyx2yks5sp-SLgaJpZM4PxX5G>
> .
>
|
Error message according the Microsoft documentation: ERROR_INVALID_PARAMETER = 87 -> The parameter is incorrect. https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx
Thanks for the patch @gozzoo! |
Summary of Problem
I get this error when trying to open existing but not connected port:
Steps and Code to Reproduce the Issue
Here is my code:
The text was updated successfully, but these errors were encountered: