mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
reduce Arduino error messages on failed connect
This commit is contained in:
parent
d40f433332
commit
a475b67a19
@ -11,14 +11,19 @@ module.exports = function(RED) {
|
||||
this.device = n.device || null;
|
||||
var node = this;
|
||||
var running = false;
|
||||
var reported = false;
|
||||
|
||||
var startup = function() {
|
||||
node.board = new Board(node.device, function(e) {
|
||||
if ((e !== undefined) && (e.toString().indexOf("cannot open") !== -1) ) {
|
||||
if (!reported) {
|
||||
node.error(RED._("arduino.errors.portnotfound",{device:node.device}));
|
||||
reported = true;
|
||||
}
|
||||
}
|
||||
else if (e === undefined) {
|
||||
running = true;
|
||||
reported = false;
|
||||
node.board.once('ready', function() {
|
||||
node.log(RED._("arduino.status.connected",{device:node.board.sp.path}));
|
||||
if (RED.settings.verbose) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "node-red-node-arduino",
|
||||
"version" : "0.2.0",
|
||||
"version" : "0.2.1",
|
||||
"description" : "A Node-RED node to talk to an Arduino running firmata",
|
||||
"dependencies" : {
|
||||
"firmata" : "^2.0.0"
|
||||
|
Loading…
Reference in New Issue
Block a user