mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
fix pi gpio to catch close timing error
This commit is contained in:
parent
553ae44ccb
commit
bd15c5d6dd
@ -83,9 +83,15 @@ module.exports = function(RED) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
node.child.on('error', function (err) {
|
node.child.on('error', function (err) {
|
||||||
if (err.errno === "ENOENT") { node.error(RED._("rpi-gpio.errors.commandnotfound")); }
|
if (err.code === "ENOENT") { node.error(RED._("rpi-gpio.errors.commandnotfound")+err.path,err); }
|
||||||
else if (err.errno === "EACCES") { node.error(RED._("rpi-gpio.errors.commandnotexecutable")); }
|
else if (err.code === "EACCES") { node.error(RED._("rpi-gpio.errors.commandnotexecutable")+err.path,err); }
|
||||||
else { node.error(RED._("rpi-gpio.errors.error",{error:err.errno})) }
|
else { node.error(RED._("rpi-gpio.errors.error",{error:err.code}),err) }
|
||||||
|
});
|
||||||
|
|
||||||
|
node.child.stdin.on('error', function (err) {
|
||||||
|
if (!node.finished) {
|
||||||
|
node.error(RED._("rpi-gpio.errors.error",{error:err.code}),err);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,11 +204,16 @@ module.exports = function(RED) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
node.child.on('error', function (err) {
|
node.child.on('error', function (err) {
|
||||||
if (err.errno === "ENOENT") { node.error(RED._("rpi-gpio.errors.commandnotfound")); }
|
if (err.code === "ENOENT") { node.error(RED._("rpi-gpio.errors.commandnotfound")+err.path,err); }
|
||||||
else if (err.errno === "EACCES") { node.error(RED._("rpi-gpio.errors.commandnotexecutable")); }
|
else if (err.code === "EACCES") { node.error(RED._("rpi-gpio.errors.commandnotexecutable")+err.path,err); }
|
||||||
else { node.error(RED._("rpi-gpio.errors.error")+': ' + err.errno); }
|
else { node.error(RED._("rpi-gpio.errors.error",{error:err.code}),err) }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
node.child.stdin.on('error', function (err) {
|
||||||
|
if (!node.finished) {
|
||||||
|
node.error(RED._("rpi-gpio.errors.error",{error:err.code}),err);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
node.warn(RED._("rpi-gpio.errors.invalidpin")+": "+node.pin);
|
node.warn(RED._("rpi-gpio.errors.invalidpin")+": "+node.pin);
|
||||||
|
@ -66,8 +66,8 @@
|
|||||||
"invalidinput": "Ungültige Eingabe",
|
"invalidinput": "Ungültige Eingabe",
|
||||||
"needtobeexecutable": "__command__ muss ausführbar sein",
|
"needtobeexecutable": "__command__ muss ausführbar sein",
|
||||||
"mustbeexecutable": "nrgpio muss ausführbar sein",
|
"mustbeexecutable": "nrgpio muss ausführbar sein",
|
||||||
"commandnotfound": "nrgpio-Befehl nicht gefunden",
|
"commandnotfound": "nrgpio-Befehl nicht gefunden ",
|
||||||
"commandnotexecutable": "nrgpio-Befehl nicht ausführbar",
|
"commandnotexecutable": "nrgpio-Befehl nicht ausführbar ",
|
||||||
"error": "Fehler: __error__",
|
"error": "Fehler: __error__",
|
||||||
"pythoncommandnotfound": "nrgpio-Python-Befehl nicht aktiv"
|
"pythoncommandnotfound": "nrgpio-Python-Befehl nicht aktiv"
|
||||||
}
|
}
|
||||||
|
@ -66,8 +66,8 @@
|
|||||||
"invalidinput": "Invalid input",
|
"invalidinput": "Invalid input",
|
||||||
"needtobeexecutable": "__command__ needs to be executable",
|
"needtobeexecutable": "__command__ needs to be executable",
|
||||||
"mustbeexecutable": "nrgpio must to be executable",
|
"mustbeexecutable": "nrgpio must to be executable",
|
||||||
"commandnotfound": "nrgpio command not found",
|
"commandnotfound": "nrgpio command not found ",
|
||||||
"commandnotexecutable": "nrgpio command not executable",
|
"commandnotexecutable": "nrgpio command not executable ",
|
||||||
"error": "error: __error__",
|
"error": "error: __error__",
|
||||||
"pythoncommandnotfound": "nrgpio python command not running"
|
"pythoncommandnotfound": "nrgpio python command not running"
|
||||||
}
|
}
|
||||||
|
@ -66,8 +66,8 @@
|
|||||||
"invalidinput": "入力が不正です",
|
"invalidinput": "入力が不正です",
|
||||||
"needtobeexecutable": "__command__ は実行可能である必要があります",
|
"needtobeexecutable": "__command__ は実行可能である必要があります",
|
||||||
"mustbeexecutable": "nrgpio は実行可能である必要があります",
|
"mustbeexecutable": "nrgpio は実行可能である必要があります",
|
||||||
"commandnotfound": "nrgpio コマンドが見つかりません",
|
"commandnotfound": "nrgpio コマンドが見つかりません ",
|
||||||
"commandnotexecutable": "nrgpio コマンドが実行可能ではありません",
|
"commandnotexecutable": "nrgpio コマンドが実行可能ではありません ",
|
||||||
"error": "エラー: __error__",
|
"error": "エラー: __error__",
|
||||||
"pythoncommandnotfound": "nrgpio python コマンドが実行されていません"
|
"pythoncommandnotfound": "nrgpio python コマンドが実行されていません"
|
||||||
}
|
}
|
||||||
|
@ -65,8 +65,8 @@
|
|||||||
"invalidinput": "입력이 올바르지 않습니다",
|
"invalidinput": "입력이 올바르지 않습니다",
|
||||||
"needtobeexecutable": "__command__ 은 실행가능상태일 필요가 있습니다 ",
|
"needtobeexecutable": "__command__ 은 실행가능상태일 필요가 있습니다 ",
|
||||||
"mustbeexecutable": "nrgpio 은 실행가능상태일 필요가 있습니다 ",
|
"mustbeexecutable": "nrgpio 은 실행가능상태일 필요가 있습니다 ",
|
||||||
"commandnotfound": "nrgpio 커맨드를 찾을수 없습니다",
|
"commandnotfound": "nrgpio 커맨드를 찾을수 없습니다 ",
|
||||||
"commandnotexecutable": "nrgpio 커맨드가 실행가능상태가 아닙니다",
|
"commandnotexecutable": "nrgpio 커맨드가 실행가능상태가 아닙니다 ",
|
||||||
"error": "에러: __error__",
|
"error": "에러: __error__",
|
||||||
"pythoncommandnotfound": "nrgpio python 커맨드가 실행되지 않았습니다"
|
"pythoncommandnotfound": "nrgpio python 커맨드가 실행되지 않았습니다"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-node-pi-gpio",
|
"name": "node-red-node-pi-gpio",
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"description": "The basic Node-RED node for Pi GPIO",
|
"description": "The basic Node-RED node for Pi GPIO",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user