serialport / node-serialport

Access serial ports with JavaScript. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!

Home Page:https://serialport.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

U-blox on windows closes after connection

slavaGanzin opened this issue · comments

commented

SerialPort Version

10.5.0

Node Version

No response

Electron Version

No response

Platform

No response

Architecture

No response

Hardware or chipset of serialport

No response

What steps will reproduce the bug?

const {SerialPort, ReadlineParser } = require('serialport')
const port = new SerialPort({path: 'COM4', baudRate: 9600});

port.on('data', x => console.log(String(x)))

What happens?

I have a u-blox GPS on COM4. It eventually send a empty packages on start. And @serialport/stream thinks that it need to terminate connection. While it make sense, it silently closes connection without describing reason to.

What should have happened?

I think there should be an option to not terminate connection if data is empty, something like {closeOnEmptyPackages: false}

Additional information

Tried to make a PR, but couldn't compile.

✖  @serialport/list:build
       > @serialport/list@10.5.0 build
       > tsc --build tsconfig-build.json
       
       lib/index.ts(4,10): error TS2305: Module '"commander"' has no exported member 'program'.
       lib/index.ts(8,77): error TS2339: Property 'choices' does not exist on type 'Option'.
       
    ✔  @serialport/parser-readline:build (2s)

    ✖  @serialport/terminal:build
       > @serialport/terminal@10.5.0 build
       > tsc --build tsconfig-build.json
       
       lib/index.ts(3,22): error TS2307: Cannot find module 'enquirer' or its corresponding type declarations.
       lib/index.ts(4,10): error TS2305: Module '"commander"' has no exported member 'program'.
       

Adding a link to #1690 for visibility, as it seems to be related