-
-
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
Detect plugging and unplugging of VirtualComPorts on the fly #802
Comments
This is a known but unexplored issue #702. And on my short list. I'm glad you did some research. I welcome the help. I can tell you that linux is the only OS where we look at |
Hey, thanks for your answer.
On windows, path gets cleaned up just fine or am i misunderstanding you? Do you have a Xcode project or anything else, where i can start debugging with? |
Hi @buejoh we've refactored this a little bit for 4.x. Still haven't fully tested disconnects but we do a bit more to ensure file descriptors get closed on all platforms. |
Hi @reconbot, |
I am able to disconnect and reconnect to an FTDI com port (in this case an arduino with the chipset) multiple times on my mac. OSX EL Capitan. Both with your code and manually testing. I'd imagine that it's something to do with the FTDI drivers. I don't have another FTDI device around to test with. |
I should also note that you're OS notes answers the question. We use some OSX api's to enumerate the ports but if it's not in |
I'm going to close this issue due to it's age, but if you'd like to continue with it feel free to reopen. |
Operating System and Hardware: MAC OS El Capitan 10.11.4
NodeJS Version: 6.1.0
Serialport version: 3.1.2-beta2
Used VCP:
Hi everybody,
i've been using node-serialport for an bunch of projects recently without problems. Thanks to the whole team providing this module to the community! 👍
In a current project i am trying to detect plugging and unplugging of vcp-devices on the fly (FTDI USB VCP (Virtual Com Port)) with node-serialport. For testing purposes i am polling the .list-method via setInterval to detect a device with manufacturer FTDI. If such a device is plugged in, i create a serial port object, attach event handlers and everything just works as expected (until the device gets unplugged...).
Expected behavior
When i unplug the device, i am expecting the .disconnect event to be fired, causing all low-level references (lib_uv filedescriptor?) for this particular VCP to be released. Plugging the device again, i am expecting a positive detection in the .list callback to enable reconnecting this device without a restart of my node application.
Actual behavior
After unplugging the device, the disconnect event gets fired once as expected. After re-pluggin the device, the .list method doesn't show up the device and so a reconnect isn't possible without a OS reboot or using a different USB port.
Additional OS observations
Checking the USB bus devices via the system report on MAC OS after unplugging the device, it still gets listed there, but cannot be found via
ls /dev
. When i replug the device, it gets listed twice in the system report (same productID, vendorID, location ...). It still cannot be found vials /dev
.I tested the same code, provided in this issue on a virtual machine with Windows 7 Professional (64 Bit), this works like a charm!
Is there a chance, to get this running on a MAC too? Do I have to edit the sources manually or to change something in my code? Or might it be a driver/lib_uv related issue?
Sorry for the long post :)
Code to reproduce the issue
Console logs
On windows:
On MAC
The text was updated successfully, but these errors were encountered: