core to Pi node-red-nodes info updates

to be more consistent style
This commit is contained in:
Dave Conway-Jones 2016-02-12 13:14:12 +00:00
parent 5a95e9c404
commit dd250a77bc
12 changed files with 46 additions and 49 deletions

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-rbe",
"version" : "0.1.2",
"version" : "0.1.3",
"description" : "A Node-RED node that provides report-by-exception (RBE) and deadband capability.",
"dependencies" : {
},

View File

@ -39,7 +39,7 @@
<script type="text/x-red" data-help-name="rbe">
<p>Report by Exception node - only passes on data if it has changed.</p>
<p>The node can either block until the <b>msg.payload</b> is
<p>The node can either block until the <code>msg.payload</code> is
different to the previous one - <b>rbe</b> mode. This works on numbers, strings, and simple objects.</p>
<p>Or it can block until the value changes by a specified amount - <b>deadband</b> mode.</p>
<p>In deadband mode the incoming payload must contain a parseable <i>number</i> and is
@ -48,7 +48,7 @@
<p>It can also ignore outlier values - <b>narrowband</b> mode.</p>
<p>In narrowband mode the incoming payload is blocked if it is more than + or - the band gap
away from the previous value. Useful for ignoring outliers from a faulty sensor for example.</p>
<p><b>Note:</b> This works on a per <b>msg.topic</b> basis. This means that a single rbe node can
<p><b>Note:</b> This works on a per <code>msg.topic</code> basis. This means that a single rbe node can
handle multiple topics at the same time.</p>
</script>

View File

@ -37,9 +37,9 @@
</script>
<script type="text/x-red" data-help-name="arduino in">
<p>Arduino input node. Connects to local Arduino and monitors the selected pin for changes. Uses <a href="http://firmata.org/" target="_new"><i>Firmata</i>.</a></p>
<p>Arduino input node. Connects to a local Arduino and monitors the selected pin for changes. Uses <a href="http://firmata.org/" target="_new"><i>Firmata</i>.</a></p>
<p>The Arduino must be loaded with the Standard Firmata sketch available in the Arduino examples.</p>
<p>You can select either Digital or Analogue input. Outputs the value read as <b>msg.payload</b> and the pin number as <b>msg.topic</b>.</p>
<p>You can select either Digital or Analogue input. Outputs the value read as <code>msg.payload</code> and the pin number as <code>msg.topic</code>.</p>
<p>It only outputs on a change of value - fine for digital inputs, but you can get a lot of data from analogue pins which you must then handle.</p>
<p>You can set the sample rate from 20 to 65535 mS.</p>
</script>
@ -93,9 +93,11 @@
</script>
<script type="text/x-red" data-help-name="arduino out">
<p>Arduino output node. Connects to local Arduino and writes to the selected digital pin. Uses <a href="http://firmata.org/" target="_new"><i>Firmata</i>.</a></p>
<p>Arduino output node. Connects to local Arduino and writes to the selected digital
pin. Uses <a href="http://firmata.org/" target="_new"><i>Firmata</i>.</a></p>
<p>The Arduino must be loaded with the Standard Firmata sketch available in the Arduino examples.</p>
<p>You can select Digital, Analogue (PWM) or Servo type outputs. Expects an integer numeric value in <b>msg.payload</b>. The pin number is set in the properties panel.</p>
<p>You can select Digital, Analogue (PWM) or Servo type outputs. Expects an integer numeric
value in <code>msg.payload</code>. The pin number is set in the properties panel.</p>
</script>
<script type="text/javascript">

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-arduino",
"version" : "0.0.3",
"version" : "0.0.4",
"description" : "A Node-RED node to talk to an Arduino running firmata",
"dependencies" : {
"arduino-firmata" : "0.3.3"

View File

@ -24,9 +24,9 @@
</script>
<script type="text/x-red" data-help-name="ledborg">
<p>PiBorg LedBorg LED output node. Expects a <b>msg.payload</b> with a three digit rgb triple, from <b>000</b> to <b>222</b>.</p>
<p>PiBorg LedBorg LED output node. Expects a <code>msg.payload</code> with a three digit rgb triple, from <b>000</b> to <b>222</b>.</p>
<p>See <i><a href="http://www.piborg.com/ledborg/install" target="_new">the PiBorg site</a></i> for more information.</p>
<p>You can also use a <b>msg.payload</b> in the standard hex format "#rrggbb".</p>
<p>You can also use a <code>msg.payload</code> in the standard hex format "#rrggbb".</p>
<p>You can use the @cheerlight colour names - red, green, blue, cyan, magenta,
yellow, orange, pink, purple, white, oldlace (warmwhite), and also amber and black (off).</p>
<p>You may also supply a comma separated rrr,ggg,bbb where each value can be between 0 and 255.</p>

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-ledborg",
"version" : "0.0.13",
"version" : "0.0.14",
"description" : "A Node-RED node to control a PiBorg LedBorg board for a Raspberry Pi.",
"dependencies" : {
},

View File

@ -30,9 +30,10 @@
</script>
<script type="text/x-red" data-help-name="ping">
<p>Pings a machine and returns the trip time in mS.</p>
<p>Pings a machine and returns the trip time in mS as <code>msg.payload</code>.</p>
<p>Returns <b>false</b> if no response received within 5 seconds, or if the host is unresolveable.</p>
<p>Default ping is every 20 seconds but can be configured.</p>
<p><code>msg.topic</code> contains the target host ip.
</script>
<script type="text/javascript">

View File

@ -1,5 +1,5 @@
/**
* Copyright 2013 IBM Corp.
* Copyright 2013,2016 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,46 +16,35 @@
module.exports = function(RED) {
"use strict";
var spawn = require('child_process').spawn;
var plat = require('os').platform();
var dns = require("dns")
var ping = require ("net-ping");
function PingNode(n) {
RED.nodes.createNode(this,n);
this.host = n.host;
this.timer = n.timer * 1000;
this.session = ping.createSession();
var node = this;
node.tout = setInterval(function() {
var ex;
if (plat == "linux") { ex = spawn('ping', ['-n', '-w', '5', '-c', '1', node.host]); }
else if (plat.match(/^win/)) { ex = spawn('ping', ['-n', '1', '-w', '5000', node.host]); }
else if (plat == "darwin") { ex = spawn('ping', ['-n', '-t', '5', '-c', '1', node.host]); }
else { node.error("Sorry - your platform - "+plat+" - is not recognised."); }
var res = false;
var line = "";
//var regex = /from.*time.(.*)ms/;
var regex = /=.*[<|=]([0-9]*).*TTL|ttl..*=([0-9\.]*)/;
ex.stdout.on('data', function (data) {
line += data.toString();
});
//ex.stderr.on('data', function (data) {
//console.log('[ping] stderr: ' + data);
//});
ex.on('close', function (code) {
var m = regex.exec(line)||"";
if (m !== '') {
if (m[1]) { res = Number(m[1]); }
if (m[2]) { res = Number(m[2]); }
}
var msg = { payload:false, topic:node.host };
if (code === 0) { msg = { payload:res, topic:node.host }; }
try { node.send(msg); }
catch(e) {}
dns.lookup(node.host, function(err, address, family) {
if (typeof address === 'undefined') { address = node.host; }
node.session.pingHost(address, function(error, target, sent, rcvd) {
var msg = { payload:false, topic:target };
if (error) {
msg.error = error.toString();
} else {
msg.payload = rcvd - sent;
}
node.send(msg);
node.session.close();
});
});
}, node.timer);
this.on("close", function() {
if (this.tout) { clearInterval(this.tout); }
if (node.tout) { clearInterval(this.tout); }
if (node.session) { node.session.close(); }
});
}
RED.nodes.registerType("ping",PingNode);

View File

@ -1,7 +1,8 @@
node-red-node-ping
==================
A <a href="http://nodered.org" target="_new">Node-RED</a> node to ping a remote server, for use as a keep-alive check.
A <a href="http://nodered.org" target="_new">Node-RED</a> node to ping a
remote server, for use as a keep-alive check.
Install
-------
@ -18,12 +19,14 @@ The fix is to allow it as follows
sudo setcap cap_net_raw=ep /bin/ping
sudo setcap cap_net_raw=ep /bin/ping6
Usage
-----
Pings a machine and returns the trip time in mS.
Pings a machine and returns the trip time in mS as **msg.payload**.
Returns boolean **false** if no response received within 5 seconds, or if the host is unresolveable.
Returns boolean `false` if no response received, or if the host is unresolveable.
**msg.wrror** will contain any error message if necessary.
**msg.topic** contains the ip address of the target host.
Default ping is every 20 seconds but can be configured.

View File

@ -1,8 +1,9 @@
{
"name" : "node-red-node-ping",
"version" : "0.0.7",
"version" : "0.0.9",
"description" : "A Node-RED node to ping a remote server, for use as a keep-alive check.",
"dependencies" : {
"net-ping":"1.1.*"
},
"repository" : {
"type":"git",

View File

@ -30,7 +30,7 @@
<p>Can either <ul><li>wait for a "split" character (default \n). Also accepts hex notation (0x0a).</li>
<li>Wait for a timeout in milliseconds for the first character received</li>
<li>Wait to fill a fixed sized buffer</li></ul></p>
<p>It then outputs <b>msg.payload</b> as either a UTF8 ascii string or a binary Buffer object.</p>
<p>It then outputs <code>msg.payload</code> as either a UTF8 ascii string or a binary Buffer object.</p>
<p>If no split character is specified, or a timeout or buffer size of 0, then a stream of single characters is sent - again either as ascii chars or size 1 binary buffers.</p>
</script>
@ -68,8 +68,9 @@
<script type="text/x-red" data-help-name="serial out">
<p>Provides a connection to an outbound serial port.</p>
<p>Only the <b>msg.payload</b> is sent.</p>
<p>Only the <code>msg.payload</code> is sent.</p>
<p>Optionally the new line character used to split the input can be appended to every message sent out to the serial port.</p>
<p>Binary payloads can be sent by using a Buffer object.</p>
</script>
<script type="text/javascript">

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-serialport",
"version" : "0.1.0",
"version" : "0.1.1",
"description" : "Node-RED nodes to talk to an serial port",
"dependencies" : {
"serialport" : "2.0.*"