node-red-node-pi-gpio 2.0.0-beta → 2.0.0

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
@@ -5,7 +5,7 @@ module.exports = function(RED) {
5
5
  var exec = require('child_process').exec;
6
6
  var spawn = require('child_process').spawn;
7
7
 
8
- var testCommand = __dirname+'/testgpio.py'
8
+ var testCommand = __dirname+'/testgpio'
9
9
  var gpioCommand = __dirname+'/nrgpio';
10
10
  var allOK = true;
11
11
 
@@ -56,7 +56,7 @@ module.exports = function(RED) {
56
56
  for (var i = 0; i < d.length; i++) {
57
57
  if (d[i] === '') { return; }
58
58
  if (node.running && node.buttonState !== -1 && !isNaN(Number(d[i])) && node.buttonState !== d[i]) {
59
- node.send({ topic:"pi/"+node.pin, payload:Number(d[i]) });
59
+ node.send({ topic:"gpio/"+node.pin, payload:Number(d[i]) });
60
60
  }
61
61
  node.buttonState = d[i];
62
62
  node.status({fill:"green",shape:"dot",text:d[i]});
@@ -97,7 +97,7 @@ module.exports = function(RED) {
97
97
  if (node.intype == "up") { val = 1; }
98
98
  if (node.intype == "down") { val = 0; }
99
99
  setTimeout(function() {
100
- node.send({ topic:"pi/"+node.pin, payload:val });
100
+ node.send({ topic:"gpio/"+node.pin, payload:val });
101
101
  node.status({fill:"grey",shape:"dot",text:RED._("rpi-gpio.status.na",{value:val})});
102
102
  },250);
103
103
  }
@@ -225,7 +225,7 @@ module.exports = function(RED) {
225
225
  var node = this;
226
226
 
227
227
  if (allOK === true) {
228
- node.child = spawn(gpioCommand+".py", ["mouse",node.butt]);
228
+ node.child = spawn(gpioCommand, ["mouse",node.butt]);
229
229
  node.status({fill:"green",shape:"dot",text:"rpi-gpio.status.ok"});
230
230
 
231
231
  node.child.stdout.on('data', function (data) {
@@ -276,7 +276,7 @@ module.exports = function(RED) {
276
276
  var node = this;
277
277
 
278
278
  var doConnect = function() {
279
- node.child = spawn(gpioCommand+".py", ["kbd","0"]);
279
+ node.child = spawn(gpioCommand, ["kbd","0"]);
280
280
  node.status({fill:"green",shape:"dot",text:"rpi-gpio.status.ok"});
281
281
 
282
282
  node.child.stdout.on('data', function (data) {
@@ -1,73 +1,75 @@
1
- "rpi-gpio" : {
2
- "label" : {
3
- "gpiopin" : "GPIO",
4
- "selectpin" : "Auswahlstift",
5
- "resistor" : "Widerstand?",
6
- "readinitial" : "Anfangsstatus des Pins bei Implementierung/Neustart lesen?",
7
- "type" : "Typ",
8
- "initpin" : "Pin-Status initialisieren?",
9
- "debounce" : "Debounce",
10
- "freq" : "Frequenz",
11
- "button" : "Knopf",
12
- "pimouse" : "Pi-Maus",
13
- "pikeyboard" : "Pi-Tastatur",
14
- "left" : "Links",
15
- "right" : "Rechts",
16
- "middle" : "Mitte"
17
- },
18
- "resistor" : {
19
- "none" : "keine",
20
- "pullup" : "pullup",
21
- "pulldown" : "Pulldown"
22
- },
23
- "digout" : "Digitale Ausgabe",
24
- "pwmout" : "PWM-Ausgabe",
25
- "servo" : "Servo-Ausgabe",
26
- "initpin0" : "Anfangsstand des Pin-Niedrig (0)",
27
- "initpin1" : "Anfangsebene von Pin-High (1)",
28
- "left" : "links",
29
- "right" : "rechts",
30
- "middle" : "Mitte",
31
- "any" : "beliebig",
32
- "pinname" : "Pin",
33
- "alreadyuse" : "bereits im Gebrauch",
34
- "alreadyset" : "bereits festgelegt als",
35
- "tip" : {
36
- "pin" : "<b> Verwender Pins </b>: ",
37
- "in" : "Tipp: Es wird nur die digitale Eingabe unterstützt. Die Eingabe muss 0 oder 1 sein.",
38
- "dig" : "Tipp: Für die digitale Ausgabe muss der Wert 0 oder 1 sein.",
39
- "pwm" : "Tipp: Für die PWM-Ausgabe muss der Wert zwischen 0 und 100 liegen; die Einstellung der Hochfrequenz kann mehr CPU beanspruchen als erwartet.",
40
- "ser" : "<b> Tipp </b>: Für die Servo-Ausgabe muss ein Wert zwischen 0 und 100 eingegeben werden. 50 ist das Zentrum."
41
- },
42
- "types" : {
43
- "digout" : "digitale Ausgabe",
44
- "input" : "Eingabe",
45
- "pullup" : "Eingabe mit Pull-up",
46
- "pulldown" : "Eingabe mit Pull-down",
47
- "pwmout" : "PWM-Ausgabe",
48
- "servo" : "Servo-Ausgabe"
49
- },
50
- "status" : {
51
- "stopped" : "Gestoppt",
52
- "closed" : "geschlossen",
53
- "not-running" : "nicht aktiv",
54
- "not-available" : "nicht verfügbar",
55
- "na" : "N/A: __Wert__",
56
- "ok": "OK"
57
- },
58
- "errors" : {
59
- "ignorenode" : "Raspberry Pi-spezifische Nodes inaktiv",
60
- "version" : "Abrufen der Version von Pi fehlgeschlagen",
61
- "sawpitype" : "Saw-Pi-Typ",
62
- "libnotfound" : "Pi RPi.GPIO-Python-Bibliothek nicht gefunden",
63
- "alreadyset" : "GPIO-Stift __pin__ ist bereits als Typ festgelegt: __type__",
64
- "invalidpin" : "Ungültiger GPIO-Pin",
65
- "invalidinput" : "Ungültige Eingabe",
66
- "needtobeexecutable" : "__command__ muss ausführbar sein",
67
- "mustbeexecutable" : "nrgpio muss ausführbar sein",
68
- "commandnotfound" : "Befehl 'nrgpio' nicht gefunden",
69
- "commandnotexecutable" : "nrgpio-Befehl nicht ausführbar",
70
- "error" : "Fehler: __error__",
71
- "pythoncommandnotfound" : "Befehl 'nrgpio python' nicht aktiv"
1
+ {
2
+ "rpi-gpio": {
3
+ "label": {
4
+ "gpiopin": "GPIO",
5
+ "selectpin": "Pinauswahl",
6
+ "resistor": "Widerstand",
7
+ "readinitial": "Initalzustand des Pins bei Übernahme/Neustart lesen",
8
+ "type": "Typ",
9
+ "initpin": "Pin-Zustand initialisieren",
10
+ "debounce": "Entprellung",
11
+ "freq": "Frequenz",
12
+ "button": "Taste",
13
+ "pimouse": "Pi-Maus",
14
+ "pikeyboard": "Pi-Tastatur",
15
+ "left": "Links",
16
+ "right": "Rechts",
17
+ "middle": "Mitte"
18
+ },
19
+ "resistor": {
20
+ "none": "Kein",
21
+ "pullup": "Pull-Up",
22
+ "pulldown": "Pull-Down"
23
+ },
24
+ "digout": "Digitaler Ausgang",
25
+ "pwmout": "PWM-Ausgang",
26
+ "servo": "Servo-Ausgang",
27
+ "initpin0": "Pin-Initalzustand low (0)",
28
+ "initpin1": "Pin-Initalzustand high (1)",
29
+ "left": "Links",
30
+ "right": "Rechts",
31
+ "middle": "Mitte",
32
+ "any": "Beliebig",
33
+ "pinname": "Pin",
34
+ "alreadyuse": "bereits im Gebrauch",
35
+ "alreadyset": "bereits festgelegt als",
36
+ "tip": {
37
+ "pin": "<b>Verwendete Pins:</b> ",
38
+ "in": "<b>Tipp:</b> Es werden nur die digitale Eingänge unterstützt. Der Eingang muss 0 oder 1 sein",
39
+ "dig": "<b>Tipp:</b> Für den digitalen Ausgang muss der Node-Eingangswert 0 oder 1 sein",
40
+ "pwm": "<b>Tipp:</b> Für die PWM-Ausgabe muss der Node-Eingangswert zwischen 0 und 100 liegen. Hohen Frequenzen können die CPU mehr beanspruchen als erwartet.",
41
+ "ser": "<b>Tipp:</b> Für die Servo-Ausgabe muss der Node-Eingangswert zwischen 0 und 100 eingegeben werden. 50 ist die Mitte."
42
+ },
43
+ "types": {
44
+ "digout": "Digitaler Ausgang",
45
+ "input": "Eingang",
46
+ "pullup": "Eingang mit Pull-Up",
47
+ "pulldown": "Eingabe mit Pull-Down",
48
+ "pwmout": "PWM-Ausgang",
49
+ "servo": "Servo-Ausgang"
50
+ },
51
+ "status": {
52
+ "stopped": "Gestoppt",
53
+ "closed": "Geschlossen",
54
+ "not-running": "Nicht aktiv",
55
+ "not-available": "Nicht verfügbar",
56
+ "na": "Nicht anwendbar: __Wert__",
57
+ "ok": "OK"
58
+ },
59
+ "errors": {
60
+ "ignorenode": "Raspberry-Pi-spezifische Nodes inaktiv gesetzt",
61
+ "version": "Abrufen der Version vom Pi fehlgeschlagen",
62
+ "sawpitype": "Saw-Pi-Typ",
63
+ "libnotfound": "RPi.GPIO-Python-Bibliothek nicht gefunden",
64
+ "alreadyset": "GPIO-Pin __pin__ ist bereits festgelegt als Typ: __type__",
65
+ "invalidpin": "Ungültiger GPIO-Pin",
66
+ "invalidinput": "Ungültige Eingabe",
67
+ "needtobeexecutable": "__command__ muss ausführbar sein",
68
+ "mustbeexecutable": "nrgpio muss ausführbar sein",
69
+ "commandnotfound": "nrgpio-Befehl nicht gefunden",
70
+ "commandnotexecutable": "nrgpio-Befehl nicht ausführbar",
71
+ "error": "Fehler: __error__",
72
+ "pythoncommandnotfound": "nrgpio-Python-Befehl nicht aktiv"
73
+ }
72
74
  }
73
- }
75
+ }
@@ -7,7 +7,7 @@
7
7
  <dt>payload <span class="property-type">number</span></dt>
8
8
  <dd>the payload will be a 1 or a 0.</dd>
9
9
  <dt>topic <span class="property-type">string</span></dt>
10
- <dd>the topic will be set to <code>pi/{the pin number}</code>.</dd>
10
+ <dd>the topic will be set to <code>gpio/{the bcm spio number}</code>.</dd>
11
11
  </dl>
12
12
  <h3>Details</h3>
13
13
  <p>You may also enable the input pullup resistor or the pulldown resistor.</p>
@@ -21,7 +21,7 @@
21
21
  <dt>payload <span class="property-type">数値</span></dt>
22
22
  <dd>ペイロードには、0 または 1 が設定されます。</dd>
23
23
  <dt>topic <span class="property-type">文字列</span></dt>
24
- <dd>トピックには、<code>pi/{ピン番号}</code>が設定されます。</dd>
24
+ <dd>トピックには、<code>gpio/{ピン番号}</code>が設定されます。</dd>
25
25
  </dl>
26
26
  <h3>詳細</h3>
27
27
  <p>入力のプルアップ抵抗またはプルダウン抵抗を有効にすることもできます。</p>
@@ -21,7 +21,7 @@
21
21
  <dt>payload <span class="property-type">수치</span></dt>
22
22
  <dd>페이로드에는, 0 또는 1이 설정됩니다.</dd>
23
23
  <dt>topic <span class="property-type">문자열</span></dt>
24
- <dd>토픽에는, <code>pi/{핀 번호}</code>가 설정됩니다.</dd>
24
+ <dd>토픽에는, <code>gpio/{핀 번호}</code>가 설정됩니다.</dd>
25
25
  </dl>
26
26
  <h3>상세</h3>
27
27
  <p>입력의 풀 업 저항 또는, 풀 다운 저항을 유효화 할 수도 있습니다.</p>
package/nrgpio CHANGED
@@ -1,17 +1,8 @@
1
1
  #!/bin/bash
2
- #
3
- # Copyright JS Foundation and other contributors, http://js.foundation
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- #
2
+
3
+ python_cmd='python3'
4
+ # Fallback to Python 2, if Python 3 is not available
5
+ command -v python3 > /dev/null || python_cmd=`python`
15
6
 
16
7
  BASEDIR=$(dirname $0)
17
- python -u $BASEDIR/nrgpio.py $@
8
+ $python_cmd -u $BASEDIR/nrgpio.py $@
package/nrgpio.py CHANGED
@@ -1,17 +1,3 @@
1
- #!/usr/bin/python
2
- #
3
- # Copyright JS Foundation and other contributors, http://js.foundation
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- #
15
1
 
16
2
  # Import library functions we need
17
3
  import RPi.GPIO as GPIO
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-node-pi-gpio",
3
- "version": "2.0.0-beta",
3
+ "version": "2.0.0",
4
4
  "description": "The basic Node-RED node for Pi GPIO",
5
5
  "dependencies" : {
6
6
  },
@@ -9,7 +9,8 @@
9
9
  },
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "https://github.com/node-red/node-red-nodes/tree/master/hardware/PiGpio"
12
+ "url": "https://github.com/node-red/node-red-nodes.git",
13
+ "directory": "tree/master/hardware/PiGpio"
13
14
  },
14
15
  "keywords": [
15
16
  "node-red", "Pi", "GPIO", "PiGpio"
package/testgpio ADDED
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+
3
+ python_cmd='python3'
4
+ # Fallback to Python 2, if Python 3 is not available
5
+ command -v python3 > /dev/null || python_cmd=`python`
6
+
7
+ BASEDIR=$(dirname $0)
8
+ $python_cmd -u $BASEDIR/testgpio.py $@
package/testgpio.py CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/python
2
1
  import sys
3
2
  try:
4
3
  import RPi.GPIO as GPIO
Binary file