node-red-node-serialport port selection node addition (#1035)

* port select
This commit is contained in:
Yoonseok Hur
2023-11-23 19:22:47 +09:00
committed by GitHub
parent 81501dfbdf
commit 2ddb6037c6
5 changed files with 301 additions and 100 deletions

View File

@@ -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>

View File

@@ -68,6 +68,7 @@
"closed": "serial port __port__ closed",
"list": "Failed to list ports. Please enter manually.",
"badbaudrate": "Baudrate is invalid"
}
},
"stopped": "__port__ stopped"
}
}