1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

Upgrade to latest underlying npm to support node8.x LTS

This commit is contained in:
Dave Conway-Jones 2017-11-04 17:12:48 +00:00
parent fce96ff196
commit 388ad11b72
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
4 changed files with 21 additions and 18 deletions

View File

@ -12,7 +12,7 @@
<script type="text/x-red" data-help-name="serial in"> <script type="text/x-red" data-help-name="serial in">
<p>Reads data from a local serial port.</p> <p>Reads data from a local serial port.</p>
<p>Can either <ul><li>wait for a "split" character (default \n). Also accepts hex notation (0x0a).</li> <p>Can either <ul><li>wait for a "split" character (default \n). Also accepts hex notation (0x0d).</li>
<li>Wait for a timeout in milliseconds for the first character received</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> <li>Wait to fill a fixed sized buffer</li></ul></p>
<p>It then outputs <code>msg.payload</code> 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>
@ -154,6 +154,14 @@
<div class="form-tips" id="tip-bin" hidden><span data-i18n="serial.tip.timeout"></span></div> <div class="form-tips" id="tip-bin" hidden><span data-i18n="serial.tip.timeout"></span></div>
</script> </script>
<script type="text/x-red" data-help-name="serial-port">
<p>Provides configuration options for a serial port.</p>
<p>The search button should return a list of available serial ports to choose from, or you
can type in the location if known.</p>
<p>The input can be split on a fixed character, after a timeout, or after a fixed number of characters.</p>
<p>If using a character, it can be specified as either the character, the escaped shortcut (e.g. \n), or the hex code (e.g. 0x0d).</p>
</script>
<script type="text/javascript"> <script type="text/javascript">
RED.nodes.registerType('serial-port',{ RED.nodes.registerType('serial-port',{
category: 'config', category: 'config',

View File

@ -211,11 +211,11 @@ module.exports = function(RED) {
var olderr = ""; var olderr = "";
var setupSerial = function() { var setupSerial = function() {
obj.serial = new serialp(port,{ obj.serial = new serialp(port,{
baudrate: baud, baudRate: baud,
databits: databits, dataBits: databits,
parity: parity, parity: parity,
stopbits: stopbits, stopBits: stopbits,
parser: serialp.parsers.raw, //parser: serialp.parsers.raw,
autoOpen: true autoOpen: true
}, function(err, results) { }, function(err, results) {
if (err) { if (err) {
@ -256,9 +256,9 @@ module.exports = function(RED) {
obj._emitter.emit('data',d[z]); obj._emitter.emit('data',d[z]);
} }
}); });
obj.serial.on("disconnect",function() { // obj.serial.on("disconnect",function() {
RED.log.error(RED._("serial.errors.disconnected",{port:port})); // RED.log.error(RED._("serial.errors.disconnected",{port:port}));
}); // });
} }
setupSerial(); setupSerial();
return obj; return obj;

View File

@ -4,16 +4,11 @@ node-red-node-serialport
<a href="http://nodered.org" target="_new">Node-RED</a> nodes to talk to <a href="http://nodered.org" target="_new">Node-RED</a> nodes to talk to
hardware Serial ports. hardware Serial ports.
**Note** : The version 0.1.x of this package requires underlying serialport
v2.0.x
Earlier versions of node.js, as found on default Debian install on a Raspberry Pi, require an
updated version of npm. See below. Or you can install the older version of
this node - node-red-node-serialport@0.0.5
Install Install
------- -------
This node is usually installed by default in Node-RED so should not need to be installed manually.
Run the following command in your Node-RED user directory (typically `~/.node-red`): Run the following command in your Node-RED user directory (typically `~/.node-red`):
npm i node-red-node-serialport npm i node-red-node-serialport

View File

@ -1,9 +1,9 @@
{ {
"name" : "node-red-node-serialport", "name" : "node-red-node-serialport",
"version" : "0.4.4", "version" : "0.6.0",
"description" : "Node-RED nodes to talk to serial ports", "description" : "Node-RED nodes to talk to serial ports",
"dependencies" : { "dependencies" : {
"serialport" : "~4.0.7" "serialport" : "^6.0.4"
}, },
"repository" : { "repository" : {
"type":"git", "type":"git",
@ -12,7 +12,7 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"keywords": [ "node-red", "serial" ], "keywords": [ "node-red", "serial" ],
"node-red": { "node-red": {
"version": ">=0.14.0", "version": ">=0.16.0",
"nodes": { "nodes": {
"serialport": "25-serial.js" "serialport": "25-serial.js"
} }