serial node: improved settings form and EN help, added DE help (#787)

This commit is contained in:
heikokue 2021-04-27 14:55:54 +02:00 committed by GitHub
parent f9e52c7d7f
commit f78f5ff7bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 188 additions and 43 deletions

View File

@ -117,22 +117,22 @@
<tr>
<td>&nbsp;</td>
<td>
<input type="text" id="node-config-input-serialbaud" style="width:92%">
<input type="text" id="node-config-input-serialbaud" style="width:92% height:28px;">
</td>
<td><select type="text" id="node-config-input-databits" style="width:90%;">
<td><select type="text" id="node-config-input-databits" style="width:90%; height:28px;">
<option value="8">8</option>
<option value="7">7</option>
<option value="6">6</option>
<option value="5">5</option>
</select></td>
<td><select type="text" id="node-config-input-parity" style="width:90%;">
<td><select type="text" id="node-config-input-parity" style="width:90%; height:28px;">
<option value="none" data-i18n="serial.parity.none"></option>
<option value="even" data-i18n="serial.parity.even"></option>
<option value="mark" data-i18n="serial.parity.mark"></option>
<option value="odd" data-i18n="serial.parity.odd"></option>
<option value="space" data-i18n="serial.parity.space"></option>
</select></td>
<td><select type="text" id="node-config-input-stopbits" style="width:60px;">
<td><select type="text" id="node-config-input-stopbits" style="width:60px; height:28px;">
<option value="2">2</option>
<option value="1">1</option>
</select></td>
@ -140,7 +140,7 @@
</div>
<div class="form-row" style="margin-bottom:0px;">
<table width="100%">
<tr style="line-height:4px;">
<tr style="line-height:10px;">
<td style="width:90px;">&nbsp;</td>
<td>DTR</td>
<td>RTS</td>

View File

@ -0,0 +1,106 @@
<script type="text/html" data-help-name="serial in">
<p>Datenempfang von lokaler serieller Schnittstelle.</p>
<h3>Ausgangsdaten</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">string | buffer</span></dt>
<dd>Empfangene Daten von serieller Schnittstelle</dd>
<dt>port <span class="property-type">string</span></dt>
<dd>Name der seriellen Schnittstelle</dd>
</dl>
<p>Der Node kann entweder
<ul>
<li>warten auf ein Aufteilungszeichen (standardmäßig \n).
Escape-Sequenzen (z.B. \n) und Hex-Notation (0x0d) werden ebenso akzeptiert.</li>
<li>warten auf Zeitablauf in Millisekunden seit Empfang des ersten Zeichens.</li>
<li>eine Ruhezeit in Millisekunden seit Empfang des letzten Zeichens abwarten.</li>
<li>warten bis ein Puffer mit fester Größer gefüllt ist.</li>
</ul>
</p>
<p>Dann wird <code>msg.payload</code> entweder als UTF-8 ASCII Zeichenfolge (string) oder
als binäres Buffer-Objekt ausgegeben.</p>
<p><code>msg.port</code> enthält den Namen der ausgewählten seriellen Schnittstelle.</p>
<p>Wenn kein Aufteilungszeichen vorgegeben ist oder ein Zeitlimit oder eine Puffergröße von 0 angegeben ist,
wird ein Strom von einzelnen Zeichen ausgegeben -
wieder entweder als ASCII-Zeichen oder als binärer Buffer, jeweils der Größe 1.</p>
</script>
<script type="text/html" data-help-name="serial out">
<p>Datenversand über lokale serielle Schnittstelle.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">string | buffer</span></dt>
<dd>Zu sendende Daten über serielle Schnittstelle</dd>
<dt class="optional">baudrate <span class="property-type">string</span></dt>
<dd>Baudrate der seriellen Schnittstelle (optional)</dd>
</dl>
<p>Nur <code>msg.payload</code> wird gesendet.</p>
<p>Optional kann die Baudrate geändert werden über <code>msg.baudrate</code></p>
<p>Optional kann das Zeilenvorschub-Zeichen (\n), was zum Aufteilen der Eingangsdaten genutzt wird,
auch jeder zu sendenden Nachricht angefügt werden.</p>
<p>Binäre Nutzdaten (Payload) können unter Verwendung von Buffer-Objekten gesendet werden.</p>
</script>
<script type="text/html" data-help-name="serial request">
<p>Verbindung zu einer seriellen Schnittstelle mit Request/Response-Protokoll (Anfrage/Antwort).</p>
<p>Dieser Node verhält sich wie eine fest gekoppelte Kombination aus einem
<span style="background-color:Gainsboro">serial in</span>- und einem
<span style="background-color:Gainsboro">serial out</span>-Node,
welche sich eine Konfiguration teilen.</p>
<p>Die Anfrage-Nachricht wird über <code>msg.payload</code> so versendet,
wie man es den <span style="background-color:Gainsboro">serial out</span>-Node machen würde.
Die Nachrichten werden an die serielle Schnittstelle nach dem strikten FIFO-Prinzip (First In, First Out) weitergereicht,
d.h. nach jeder gesendeten Anfrage wird auf die Antwort der Gegenstelle gewartet,
bevor mit der nächsten Anfrage fortgefahren wird.
Wenn die Antwort empfangen wurde (mit der selben Logik eines <span style="background-color:Gainsboro">serial in</span>-Nodes)
oder wenn ein Zeitablauf aufgetreten ist, wird eine Nachricht ausgegeben (siehe Ausgangsdaten unten)
mit <code>msg.payload</code>, die empfangene Antwort enthaltend (oder fehlend im Falle eines Zeitablaufs),
und allen anderen unveränderten Eigenschaften der Eingangsnachricht.</p>
<p>Für die Konsistenz mit dem <span style="background-color:Gainsboro">serial in</span>-Node ist
<code>msg.port</code> ebenso auf den Namen der seriellen Schnittstelle gesetzt.</p>
<h3>Eingangsdaten</h3>
<ul>
<li><code>msg.timeout</code> ist die Ablaufzeit (in ms), nach der eine unbeantwortete Eingangsnachricht
an den Ausgang mit <code>msg.status</code>, gesetzt auf <code>"ERR_TIMEOUT"</code>,
und den unbeantworteten Nutzdaten (Payload) weitergereicht wird.
Wenn nicht vorhanden, wird der Standardwert 10000 (10s) verwendet.</li>
<li>Falls <code>msg.count</code> gesetzt ist, überschreibt sie die konfigurierte Zeichenanzahl,
sofern sie kleiner als die konfigurierte ist.</li>
<li><code>msg.waitfor</code> muss ein Einzelzeichen, ein Escape-Code oder eine Hex-Code sein.
Wenn gesetzt, wartet der Node bis zum passenden Zeichen im Datenstrom und startet dann die Ausgabe.</li>
<li>Optional kann die Baudrate geändert werden über <code>msg.baudrate</code></li>
</ul>
<h3>Ausgangsdaten</h3>
<ul>
<li><code>msg.payload</code> ist die Antwort. Wenn keine Antwort erfolgte, ist die Eigenschaft nicht vorhanden.</li>
<li><code>msg.status</code> ist <code>"OK"</code> im Falle einer empfangenen Antwort oder
<code>"ERR_TIMEOUT"</code> im Falle eines Zeitablaufs.</li>
<li>Alle anderen Eigenschaften der Eingangsdaten werden beibehalten.</li>
</ul>
</script>
<script type="text/html" data-help-name="serial-port">
<p>Konfigurationsoptionen einer lokalen seriellen Schnittstelle.</p>
<p>Die Suchschaltfläche sollte eine Liste der verfügbaren seriellen Schnittstellen zur Auswahl zurückgeben.
Alternativ kann der Schnittstellenname direkt eingegeben werden, sofern bekannt.</p>
<p>Die DTR-, RTS-, CTS- und DSR-Einstellugnen können genutzt werden,
um den entsprechenden Flusskontroll-Pin permanent auf High- oder Low-Pegel zu ziehen,
z.B. um angeschlossene Geräte darüber mit Strom zu versorgen.</p>
<p>Der Node kann optional darauf warten, bis ein vorgegebenes Startzeichen empfangen wurde.</p>
<p>Der Node kann entweder
<ul>
<li>warten auf ein Aufteilungszeichen (standardmäßig \n).
Escape-Sequenzen (z.B. \n) und Hex-Notation (0x0d) werden ebenso akzeptiert.</li>
<li>warten auf Zeitablauf in Millisekunden seit Empfang des ersten Zeichens.</li>
<li>eine Ruhezeit in Millisekunden seit Empfang des letzten Zeichens abwarten.</li>
<li>warten bis ein Puffer mit fester Größer gefüllt ist.</li>
</ul>
</p>
<p>Dann wird <code>msg.payload</code> entweder als UTF-8 ASCII Zeichenfolge (string) oder
als binäres Buffer-Objekt ausgegeben.</p>
<p>Wenn kein Aufteilungszeichen vorgegeben ist oder ein Zeitlimit oder eine Puffergröße von 0 angegeben ist,
wird ein Strom von einzelnen Zeichen ausgegeben -
wieder entweder als ASCII-Zeichen oder als binärer Buffer, jeweils der Größe 1.</p>
<p>Optional kann das Zeilenvorschub-Zeichen (\n), was zum Aufteilen der Eingangsdaten genutzt wird,
auch jeder zu sendenden Nachricht angefügt werden.</p>
</script>

View File

@ -13,7 +13,7 @@
"stopbits": "Stoppbits",
"input": "Empfang",
"split": "Aufteilung",
"deliver": "und Ausgabe",
"deliver": "und Ausgabe als",
"output": "Versand",
"request": "Anforderung",
"responsetimeout": "Standardwert Antwort-Zeitablauf",
@ -24,7 +24,7 @@
"startor": ", dann"
},
"placeholder": {
"serialport": "z. B. /dev/ttyUSB0/"
"serialport": "z.B. /dev/ttyUSB0/"
},
"parity": {
"none": "Keine",
@ -45,8 +45,8 @@
"lengths": "in feste Längen von"
},
"output": {
"ascii": "als ASCII-Strings",
"binary": "binäre Buffer"
"ascii": "ASCII-Strings",
"binary": "Binäre Buffer"
},
"addsplit": "Zeichen zu Ausgangsnachrichten hinzufügen",
"tip": {
@ -62,7 +62,7 @@
"errors": {
"missing-conf": "Fehlende serielle Konfiguration",
"serial-port": "Serieller Port",
"error": "Serieller Port __port__ Fehler: __error__",
"error": "Serieller Port __port__ FEHLER: __error__",
"unexpected-close": "Serieller Port __port__ unerwartet geschlossen",
"disconnected": "Serieller Port __port__ getrennt",
"closed": "Serieller Port __port__ geschlossen",

View File

@ -1,56 +1,95 @@
<script type="text/html" data-help-name="serial in">
<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 (0x0d).</li>
<li>Wait for a timeout in milliseconds from the first character received</li>
<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>Receives data via a local serial port.</p>
<h3>Outputs</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">string | buffer</span></dt>
<dd>received data via the serial port</dd>
<dt>port <span class="property-type">string</span></dt>
<dd>name of the serial port</dd>
</dl>
<p>The node can either
<ul>
<li>wait for a "split" character (default \n).
Also accepts escaped shortcut (e.g. \n) or hex notation (0x0d).</li>
<li>wait for a timeout in milliseconds from the first character received.</li>
<li>wait for a silence time in milliseconds after the last character received.</li>
<li>wait to fill a fixed sized buffer.</li>
</ul>
</p>
<p>It then outputs <code>msg.payload</code> as either a UTF-8 ASCII string or a binary buffer object.</p>
<p><code>msg.port</code> is set to the name of the port selected.</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>
<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>
<script type="text/html" data-help-name="serial out">
<p>Provides a connection to an outbound serial port.</p>
<p>Send data via a local serial port.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">string | buffer</span></dt>
<dd>data to be sent via the serial port</dd>
<dt class="optional">baudrate <span class="property-type">string</span></dt>
<dd>baudrate of the serial port (optional)</dd>
</dl>
<p>Only the <code>msg.payload</code> is sent.</p>
<p>Optionally the baudrate can be changed using <code>msg.baudrate</code></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>
<p>Optionally the baudrate can be changed using <code>msg.baudrate</code>.</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/html" data-help-name="serial request">
<p>Provides a connection to a request/response serial port.</p>
<p>This node behaves as a tightly coupled combination of <code>serial in</code> and <code>serial out</code> nodes,
with which it shares the configuration.</p>
with which it shares the configuration.</p>
<p>Send the request message in <code>msg.payload</code> as you would do with a <code>serial out</code> node.
The message will be forwarded to the serial port following a strict FIFO (First In, First Out) queue, waiting for a single response before transmitting the next request.
Once a response is received (with the same logic of a <code>serial in</code> node), or after a timeout occurs, a message is sent to the output (see Outputs below),
with <code>msg.payload</code> containing the received response (or missing in case if timeout) and all other fields preserved.</p>
The message will be forwarded to the serial port following a strict FIFO (First In, First Out) queue,
waiting for a single response before transmitting the next request.
Once a response is received (with the same logic of a <code>serial in</code> node), or after a timeout occurs,
a message is sent to the output (see Outputs below),
with <code>msg.payload</code> containing the received response (or missing in case if timeout) and
all other properties are preserved.</p>
<p>For consistency with the <code>serial in</code> node, <code>msg.port</code> is set to the name of the port selected.</p>
<h3>Inputs</h3>
<ul>
<li>
<code>msg.timeout</code> is the timeout (in ms) after which the incoming message is propagated to the output with <code>msg.status</code> set to <code>"ERR_TIMEOUT"</code> and missing payload.
If not present, the default value is 10000 (10s).
</li>
<li><code>msg.count</code> if set this will override the configured number of characters as long as it is less than the number configured.</li>
<li><code>msg.waitfor</code> single character, escape code, or hex code. If set, the node will wait until it matches that character in the stream and then start the output.</li>
<li>Optionally the baudrate can be changed using <code>msg.baudrate</code></li>
<li><code>msg.timeout</code> is the timeout (in ms) after which the incoming message is propagated
to the output with <code>msg.status</code> set to <code>"ERR_TIMEOUT"</code> and missing payload.
If not present, the default value is 10000 (10s).</li>
<li><code>msg.count</code> if set this will override the configured number of characters
as long as it is less than the number configured.</li>
<li><code>msg.waitfor</code> must be a single character, escape code, or hex code.
If set, the node will wait until it matches that character in the stream and then start the output.</li>
<li>Optionally the baudrate can be changed using <code>msg.baudrate</code></li>
</ul>
<h3>Outputs</h3>
<ul>
<li><code>msg.payload</code> is the response. If no response occured, this field is removed.</li>
<li><code>msg.status</code> is <code>"OK"</code> in case a response is received, or <code>"ERR_TIMEOUT"</code> if a timeout occurs.</li>
<li>Any other field coming from the input will be preserved.</li>
<li><code>msg.payload</code> is the response. If no response occured, this property is removed.</li>
<li><code>msg.status</code> is <code>"OK"</code> in case a response is received,
or <code>"ERR_TIMEOUT"</code> if a timeout occurs.</li>
<li>Any other property coming from the input will be preserved.</li>
</ul>
</script>
<script type="text/html" 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 DTR, RTS, CTS and DSR switches can be used to permanently pull the corresponding flow control pin high or low, e.g. in order to power devices via those pins.</p>
<p>The node can optionally wait until it matches a pre-defined character.
The data can then 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>
<p>Configuration options for a local 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 DTR, RTS, CTS and DSR switches can be used to permanently pull the corresponding flow control pin high or low,
e.g. in order to power devices via those pins.</p>
<p>The node can optionally wait until it matches a pre-defined character.</p>
<p>The serial data reception can either
<ul>
<li>wait for a "split" character (default \n). Also accepts escaped shortcut (e.g. \n) or hex notation (0x0d).</li>
<li>wait for a timeout in milliseconds from the first character received.</li>
<li>wait for a silence time in milliseconds after the last character received.</li>
<li>wait to fill a fixed sized buffer.</li>
</ul>
</p>
<p>It then outputs the received data as either a UTF-8 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>
<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>

View File

@ -45,7 +45,7 @@
"lengths": "into fixed lengths of"
},
"output": {
"ascii": "ascii strings",
"ascii": "ASCII strings",
"binary": "binary buffers"
},
"addsplit": "Add character to output messages",