garrows / browser-serialport

Robots in the browser. Just like node-serialport but for browser/chrome apps.
MIT License
205 stars 73 forks source link

Failure to connect to port #37

Closed ClausM closed 9 years ago

ClausM commented 9 years ago

When I start my chrome app 1) sometimes I get a failure to connect error 2) and sometimes I get a malformed header error connection failure

Are there ways to intercept these errors? Or if I am not asking the question correctly, please tell me what information to provide?

jacobrosenthal commented 9 years ago

Is this a general question about Chrome Serial API? You need to do what the error says, you haven't checked the chrome.runtime.lastError for your error and handled appropriately. See for an example https://github.com/garrows/browser-serialport/blob/master/index.js#L192-L200