node-red-node-pi-gpio 2.0.5 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/36-rpi-gpio.js CHANGED
@@ -83,9 +83,15 @@ module.exports = function(RED) {
83
83
  });
84
84
 
85
85
  node.child.on('error', function (err) {
86
- if (err.errno === "ENOENT") { node.error(RED._("rpi-gpio.errors.commandnotfound")); }
87
- else if (err.errno === "EACCES") { node.error(RED._("rpi-gpio.errors.commandnotexecutable")); }
88
- else { node.error(RED._("rpi-gpio.errors.error",{error:err.errno})) }
86
+ if (err.code === "ENOENT") { node.error(RED._("rpi-gpio.errors.commandnotfound")+err.path,err); }
87
+ else if (err.code === "EACCES") { node.error(RED._("rpi-gpio.errors.commandnotexecutable")+err.path,err); }
88
+ else { node.error(RED._("rpi-gpio.errors.error",{error:err.code}),err) }
89
+ });
90
+
91
+ node.child.stdin.on('error', function (err) {
92
+ if (!node.finished) {
93
+ node.error(RED._("rpi-gpio.errors.error",{error:err.code}),err);
94
+ }
89
95
  });
90
96
  }
91
97
 
@@ -198,11 +204,16 @@ module.exports = function(RED) {
198
204
  });
199
205
 
200
206
  node.child.on('error', function (err) {
201
- if (err.errno === "ENOENT") { node.error(RED._("rpi-gpio.errors.commandnotfound")); }
202
- else if (err.errno === "EACCES") { node.error(RED._("rpi-gpio.errors.commandnotexecutable")); }
203
- else { node.error(RED._("rpi-gpio.errors.error")+': ' + err.errno); }
207
+ if (err.code === "ENOENT") { node.error(RED._("rpi-gpio.errors.commandnotfound")+err.path,err); }
208
+ else if (err.code === "EACCES") { node.error(RED._("rpi-gpio.errors.commandnotexecutable")+err.path,err); }
209
+ else { node.error(RED._("rpi-gpio.errors.error",{error:err.code}),err) }
204
210
  });
205
211
 
212
+ node.child.stdin.on('error', function (err) {
213
+ if (!node.finished) {
214
+ node.error(RED._("rpi-gpio.errors.error",{error:err.code}),err);
215
+ }
216
+ });
206
217
  }
207
218
  else {
208
219
  node.warn(RED._("rpi-gpio.errors.invalidpin")+": "+node.pin);
@@ -66,8 +66,8 @@
66
66
  "invalidinput": "Ungültige Eingabe",
67
67
  "needtobeexecutable": "__command__ muss ausführbar sein",
68
68
  "mustbeexecutable": "nrgpio muss ausführbar sein",
69
- "commandnotfound": "nrgpio-Befehl nicht gefunden",
70
- "commandnotexecutable": "nrgpio-Befehl nicht ausführbar",
69
+ "commandnotfound": "nrgpio-Befehl nicht gefunden ",
70
+ "commandnotexecutable": "nrgpio-Befehl nicht ausführbar ",
71
71
  "error": "Fehler: __error__",
72
72
  "pythoncommandnotfound": "nrgpio-Python-Befehl nicht aktiv"
73
73
  }
@@ -66,8 +66,8 @@
66
66
  "invalidinput": "Invalid input",
67
67
  "needtobeexecutable": "__command__ needs to be executable",
68
68
  "mustbeexecutable": "nrgpio must to be executable",
69
- "commandnotfound": "nrgpio command not found",
70
- "commandnotexecutable": "nrgpio command not executable",
69
+ "commandnotfound": "nrgpio command not found ",
70
+ "commandnotexecutable": "nrgpio command not executable ",
71
71
  "error": "error: __error__",
72
72
  "pythoncommandnotfound": "nrgpio python command not running"
73
73
  }
@@ -66,8 +66,8 @@
66
66
  "invalidinput": "入力が不正です",
67
67
  "needtobeexecutable": "__command__ は実行可能である必要があります",
68
68
  "mustbeexecutable": "nrgpio は実行可能である必要があります",
69
- "commandnotfound": "nrgpio コマンドが見つかりません",
70
- "commandnotexecutable": "nrgpio コマンドが実行可能ではありません",
69
+ "commandnotfound": "nrgpio コマンドが見つかりません ",
70
+ "commandnotexecutable": "nrgpio コマンドが実行可能ではありません ",
71
71
  "error": "エラー: __error__",
72
72
  "pythoncommandnotfound": "nrgpio python コマンドが実行されていません"
73
73
  }
@@ -65,8 +65,8 @@
65
65
  "invalidinput": "입력이 올바르지 않습니다",
66
66
  "needtobeexecutable": "__command__ 은 실행가능상태일 필요가 있습니다 ",
67
67
  "mustbeexecutable": "nrgpio 은 실행가능상태일 필요가 있습니다 ",
68
- "commandnotfound": "nrgpio 커맨드를 찾을수 없습니다",
69
- "commandnotexecutable": "nrgpio 커맨드가 실행가능상태가 아닙니다",
68
+ "commandnotfound": "nrgpio 커맨드를 찾을수 없습니다 ",
69
+ "commandnotexecutable": "nrgpio 커맨드가 실행가능상태가 아닙니다 ",
70
70
  "error": "에러: __error__",
71
71
  "pythoncommandnotfound": "nrgpio python 커맨드가 실행되지 않았습니다"
72
72
  }
package/nrgpio CHANGED
@@ -1,6 +1,12 @@
1
1
  #!/bin/bash
2
2
 
3
3
  python_cmd='python3'
4
+
5
+ revision=$(awk -F': ' '/^Revision/ {print $2; exit}' /proc/cpuinfo)
6
+ if [[ -n "$revision" && ${#revision} -eq 4 ]]; then
7
+ export RPI_LGPIO_REVISION="800012"
8
+ fi
9
+
4
10
  # Fallback to Python 2, if Python 3 is not available
5
11
  command -v python3 > /dev/null || python_cmd='python'
6
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-node-pi-gpio",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "The basic Node-RED node for Pi GPIO",
5
5
  "dependencies" : {
6
6
  },
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "author": {
19
19
  "name": "Dave Conway-Jones",
20
- "email": "ceejay@vnet.ibm.com",
20
+ "email": "dceejay@gmail.com",
21
21
  "url": "http://nodered.org"
22
22
  },
23
23
  "license": "Apache-2.0",
package/testgpio CHANGED
@@ -1,8 +1,14 @@
1
1
  #!/bin/bash
2
2
 
3
- python_cmd='python3'
3
+ python_cmd=python3
4
+
5
+ revision=$(awk -F': ' '/^Revision/ {print $2; exit}' /proc/cpuinfo)
6
+ if [[ -n "$revision" && ${#revision} -eq 4 ]]; then
7
+ export RPI_LGPIO_REVISION="800012"
8
+ fi
9
+
4
10
  # Fallback to Python 2, if Python 3 is not available
5
- command -v python3 > /dev/null || python_cmd='python'
11
+ command -v python3 > /dev/null || python_cmd=python
6
12
 
7
13
  BASEDIR=$(dirname $0)
8
14
  $python_cmd -u $BASEDIR/testgpio.py $@