mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
node-red-node-serialport port selection node addition (#1035)
* port select
This commit is contained in:
@@ -93,3 +93,51 @@
|
||||
<p>Optionally the new line character used to split the input
|
||||
can be appended to every message sent out to the serial port.</p>
|
||||
</script>
|
||||
|
||||
<script type="text/html" data-help-name="serial control">
|
||||
<p>Stops, starts the serial communication and changes the serial port configuration.</p>
|
||||
|
||||
<p>This node provides the serial port control capability to</p>
|
||||
<ul>
|
||||
<li>stop the communication and releasing the serial port so, for example the Arduino can upload the new binary without shutting down the nodered.</li>
|
||||
<li>start the communication after stopped with this `Serial Control` node for above reason or the like.</li>
|
||||
<li>change the serial port and the configuration on the run time programatically.</li>
|
||||
<li>query the serial port configuration if empty or no valid configuration parameters are passed.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Inputs</h3>
|
||||
<p>In order to control the communication, just send these JSON messages to the control node.</p>
|
||||
<pre>
|
||||
{
|
||||
"serialport": "/dev/tty.usbmodem1234561",
|
||||
"serialbaud": 115200,
|
||||
"databits": 8,
|
||||
"parity": "none",
|
||||
"stopbits": 1
|
||||
"enable": true
|
||||
}
|
||||
</pre> changes the serial port and the configuration on the fly.
|
||||
<p>The following optional parameters will change the configuration only if they are present.</p>
|
||||
<p>Any combination of them can be passed to change/control the serial communication</p>
|
||||
<ul>
|
||||
<li> serialport </li>
|
||||
<li> serialbaud </li>
|
||||
<li> databits </li>
|
||||
<li> parity </li>
|
||||
<li> stopbits </li>
|
||||
<li> dtr </li>
|
||||
<li> rts </li>
|
||||
<li> cts </li>
|
||||
<li> dsr </li>
|
||||
<li> bin </li>
|
||||
<li> out </li>
|
||||
<li> enable </li>
|
||||
</ul>
|
||||
<p>When the <code>enable</code> property is not present, it will default to <code>true</code></p>
|
||||
<p>
|
||||
<code>{"enable":true}</code> or <code>{"enable":false}</code> will start or stop the communication.</p>
|
||||
<p> If <code>enable</code> is passed along with other parameters, the configuration will be changed and either be started or just be ready to be started(ie. stopped ) depending on its value. </p>
|
||||
|
||||
<h3>Outputs</h3>
|
||||
<p><code>msg.payload</code> is the response. It contains the serial port configuration</p>
|
||||
</script>
|
@@ -68,6 +68,7 @@
|
||||
"closed": "serial port __port__ closed",
|
||||
"list": "Failed to list ports. Please enter manually.",
|
||||
"badbaudrate": "Baudrate is invalid"
|
||||
}
|
||||
},
|
||||
"stopped": "__port__ stopped"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user