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

Error: Port is opening #752

Closed
Zighy opened this issue Apr 12, 2016 · 0 comments
Closed

Error: Port is opening #752

Zighy opened this issue Apr 12, 2016 · 0 comments

Comments

@Zighy
Copy link

Zighy commented Apr 12, 2016

Operating System and Hardware: Linux CentOS 6.7 64-bit
NodeJS Version: v0.10.42
Serialport version: >= 2.0.6
Python Version: 2.6.6
(Run node -v && npm -v && python --version to get the version numbers.)
node v0.10.42
npm 1.3.6
Python 2.6.6

Expected behavior

Open multiple serial ports, send and receive data on them.

Actual behavior

I receive the following error message:

Error: Port is opening
at SerialPort.open (/home/SIMU/node_modules/serialport/serialport.js:219:24)
at SerialPort. (/home/SIMU/node_modules/serialport/serialport.js:197:12)
at process._tickCallback (node.js:448:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:935:3

Steps and/or code to reproduce the issue

I called open on multiple connections with as a chain of "Q" promises.
Once the connections are opened I start the execution of my code.

To solve the problem i opened the ..../node_modules/serialport/serialport.js at line 219 and I commented out this error handler :

/_if (this.opening) {
return this.error(new Error('Port is opening'), callback);
}
/

Now it works like a charm! everything as expected, but I wonder why this error handler was causing problems...

Is there maybe a more elegant solution? What are the negative effects of this modification I made?

==== SOLVED =====

I forgot to use the "openImmediatly" flag set to "false" while using .open() method.. Now it works like a charm again with the error handler... This is not an issue anymore.

@Zighy Zighy closed this as completed Apr 12, 2016
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant