-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
818f2cc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context, this is the line that's causing the problem when Conbee II seems to crash: https://github.com/serialport/node-serialport/blob/main/packages/stream/lib/index.ts#L352
This is the error I get from the library:
Unfortunately not very informative, and looks like a hardware issue, but there's still some possibility that it's triggered by ZH, although I can't immediately see how, just that it only happens after the refactor was introduced.
When the disconnect happens, the library emits a
close
event that includes aDisconnectError
as the 1st parameter: https://github.com/serialport/node-serialport/blob/main/packages/stream/lib/index.ts#L330Although it would still hide the underlying issue, it should be possible to adapt
onPortClose
to detect when the disconnect happens and try to reopen the port (or give up).