-
-
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
Node exit after new SerialPort() #59
Comments
Are you passing any arguments to the constructor of SerialPort in your example you are not? |
No actually I've gotten away with using the defaults (9600,N,8,1) so far using serialport on Linux and Mac - but yeah I probably should have tried messing with those. Think that's causing the issue? |
Same Issue here, did you get it to work, nosteve? |
@nosteve You at least need to pass in the port name ie "COM1". Try running serialport/bin/serialportList.js and see if that works. var SerialPort = require("serialport").SerialPort
var serialPort = new SerialPort("COM1"); |
Hey @joeferner I also did the serialportList.cmd, which returns a correct list. My port is "COM10" (I used this before). The issue I am observing is the one nosteve already described. Node.js exits the process shortly after the SerialPort() constructor is used. The following script works as expected, returning "foo" directly, then "bar", then exits: var SerialPort = require("serialport").SerialPort
//var serialPort = new SerialPort("COM10");
setTimeout(function() {
console.log("bar");
}, 3000);
console.log("foo"); while this one just returns "foo" and then exits without further notice and without ever returning "bar": var SerialPort = require("serialport").SerialPort
var serialPort = new SerialPort("COM10");
setTimeout(function() {
console.log("bar");
}, 3000);
console.log("foo"); I'm using node 0.6.19. Windows 7 64bit. Works fine for me under GNU/Linux. |
If you don't mind can you pull the latest code and try again. We had some incorrect logic dealing with windows, it should be fixed now. |
Fix worked for me. Going crazy trying to figure out what I was doing wrong. Thanx! |
Worked for me, too. Thanks! |
Traveling atm but sounds like this will fix my problem as well. I was indeed passing the serial port (COM4, and tried .\COM4 too) despite my bad repro code :P The others are describing the same issue and sounds like your change fixed it - so thanks for the quick turnaround! This transmission may contain information that is privileged, confidential, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. |
Is there an ETA for when this will appear on npm? This is a fatal issue for Windows users of this library. |
Published 1.0.2 today. |
Thank you. Tested and fix is working great. |
I have this problem on Windows with serialport 1.3.0 and ruby-1.9.3-p484. |
A bit stumped, node script is causing exit without error on Windows, even when trying to capture unhandled exceptions using the "process.on" trick. Narrowed this behavior down to when I create a new SerialPort object.
System is Windows 7 Pro x64, using latest Node 0.8.3. Built libs using VS Express 2010.
Script works on Mac using same libraries without issue. Removing the new SerialPort() line resolves the issue, script works fine otherwise.
Here is sample program to repro and debug info. I'm not sure where else to look - maybe it's a bad compile, or some kind of 64-bit issue? It seems like the OS might be killing it but I don't see anything in Event Viewer (maybe I need to turn on more options in there?) Any troubleshooting help appreciated.
repro:
debug:
The text was updated successfully, but these errors were encountered: