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 +5 -5
- package/locales/de/36-rpi-gpio.json +74 -72
- package/locales/en-US/36-rpi-gpio.html +1 -1
- package/locales/ja/36-rpi-gpio.html +1 -1
- package/locales/ko/36-rpi-gpio.html +1 -1
- package/nrgpio +5 -14
- package/nrgpio.py +0 -14
- package/package.json +3 -2
- package/testgpio +8 -0
- package/testgpio.py +0 -1
- package/node-red-node-pi-gpio-2.0.0.tgz +0 -0
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
|
|
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:"
|
|
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:"
|
|
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
|
|
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
|
|
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
|
-
|
|
2
|
-
"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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>
|
|
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>
|
|
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>
|
|
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
|
-
|
|
4
|
-
#
|
|
5
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
package/testgpio.py
CHANGED
|
Binary file
|