2015-06-16 11:36:19 +02:00
{
"serial" : {
Serial request (#426)
* serial: simplify serialPool.get
serialPool.get() has a lot of arguments.
Just pass the whole serialConfig object instead.
Also introduce early termination to remove one level of indentation.
(Just set your diff tool to ignore all whitespace changes to see
how very little this patch changes)
* serial: move splitting logic onto serialPool
All SerialIn and SerialOut nodes for a given port
share the same splitting logic as it is indeed
set by the common configuration node.
Move the code from SerialIn into serialPool so that
it can be reused by the serial request node.
Notice how the 'data' event will no longer carry
single bytes, but the whole payload instead.
Also move the output encoding logic into serialPool.
* serial: add serial request node
Add a "serial request" node to handle simple request/response
protocols. This node allows for multiple instances, all
sharing the same underlying device.
Responses coming from the serial line will only be propagated
to the output of the node where the request was originally received
(contrary to the "serial in" nodes which all emit the data
received from the serial line).
Every request received as an input to the node, is transmitted
to the serial line, and a matching response must be received
before the next one can be transmitted.
Any input message received in the meantime is internally enqueued.
The node is essentially a merge of serial in and serial out.
It shares the same configuration with serial in and serial out
for any given port and will not affect the behavior of the
existing nodes.
This means you can use, alongside with the request node:
- as many serial in nodes as you want -- e.g. to "sniff"
- serial out to inject mailicious/tampering data onto the serial
line, skipping the queueing mechanism
* serial request: provide some visual feedback on the node
add status indication:
- yellow "waiting" when a message is enqueued for sending
- green "OK" after an answer is received
- red "timeout" after a timeout occurs
More sofisticated output would include an indication of the number of messages
enqueued and the actual timeout remaining after sending.
* serial request: make default response timeout configurable
Notice it's a global setting (i.e. stored in the configuration node)
as opposed to per-node, but it can be overridden by setting msg.timeout.
* serial request: cosmetic changes
- added documentation about msg.port
- timeout field made wider so to accommodate default value of 10000ms
- replaced harcoded text with localizable strings for
"waiting" and "timeout" messages
* serial: cleanup: remove node.tout
this was probably some leftover code from previous implementations.
Now all timeouts are handled within the connection objects.
* serial: cleanup: set obj.tout to null after clearing it
clearing a Timeout without setting it back to null *might* have
adverse effects on later code which would check its null-ity.
Let's just do it.
* serial: cosmetic: add some comments
* serial request: fix "split on timeout" case
In the case of "split on timeout" case, we're reusing the same
.tout for two different purposes:
1) to send a timeout message, in case no answer is received at all [request]
2) to split messages, after receiving the first character [in+request]
So in the case of serial request, checking whether .tout is already
set is no longer a valid condition for 2).
Let's just check whether i === 1, and clear the timeout set up by 1)
if it's already there.
* serial: add "split on silence" behavior
add a fourth logic to split incoming data into messages.
The existing "split on timeout" logic starts the timeout upon
reception of the first character.
This might lead to unwanted behavior if for instance Node-RED is
restarted, as data might accumulate into OS buffers (see #410).
A different logic might be to only emit a message when enough time
has passed, without any new data being received (line silent), a.k.a.
interbyte timeout.
2018-07-09 12:14:08 +02:00
"status" : {
"waiting" : "waiting" ,
"timeout" : "timeout"
} ,
2015-06-16 11:36:19 +02:00
"label" : {
"serialport" : "Serial Port" ,
"settings" : "Settings" ,
"baudrate" : "Baud Rate" ,
"databits" : "Data Bits" ,
"parity" : "Parity" ,
"stopbits" : "Stop Bits" ,
"input" : "Input" ,
"split" : "Split input" ,
"deliver" : "and deliver" ,
"output" : "Output" ,
Serial request (#426)
* serial: simplify serialPool.get
serialPool.get() has a lot of arguments.
Just pass the whole serialConfig object instead.
Also introduce early termination to remove one level of indentation.
(Just set your diff tool to ignore all whitespace changes to see
how very little this patch changes)
* serial: move splitting logic onto serialPool
All SerialIn and SerialOut nodes for a given port
share the same splitting logic as it is indeed
set by the common configuration node.
Move the code from SerialIn into serialPool so that
it can be reused by the serial request node.
Notice how the 'data' event will no longer carry
single bytes, but the whole payload instead.
Also move the output encoding logic into serialPool.
* serial: add serial request node
Add a "serial request" node to handle simple request/response
protocols. This node allows for multiple instances, all
sharing the same underlying device.
Responses coming from the serial line will only be propagated
to the output of the node where the request was originally received
(contrary to the "serial in" nodes which all emit the data
received from the serial line).
Every request received as an input to the node, is transmitted
to the serial line, and a matching response must be received
before the next one can be transmitted.
Any input message received in the meantime is internally enqueued.
The node is essentially a merge of serial in and serial out.
It shares the same configuration with serial in and serial out
for any given port and will not affect the behavior of the
existing nodes.
This means you can use, alongside with the request node:
- as many serial in nodes as you want -- e.g. to "sniff"
- serial out to inject mailicious/tampering data onto the serial
line, skipping the queueing mechanism
* serial request: provide some visual feedback on the node
add status indication:
- yellow "waiting" when a message is enqueued for sending
- green "OK" after an answer is received
- red "timeout" after a timeout occurs
More sofisticated output would include an indication of the number of messages
enqueued and the actual timeout remaining after sending.
* serial request: make default response timeout configurable
Notice it's a global setting (i.e. stored in the configuration node)
as opposed to per-node, but it can be overridden by setting msg.timeout.
* serial request: cosmetic changes
- added documentation about msg.port
- timeout field made wider so to accommodate default value of 10000ms
- replaced harcoded text with localizable strings for
"waiting" and "timeout" messages
* serial: cleanup: remove node.tout
this was probably some leftover code from previous implementations.
Now all timeouts are handled within the connection objects.
* serial: cleanup: set obj.tout to null after clearing it
clearing a Timeout without setting it back to null *might* have
adverse effects on later code which would check its null-ity.
Let's just do it.
* serial: cosmetic: add some comments
* serial request: fix "split on timeout" case
In the case of "split on timeout" case, we're reusing the same
.tout for two different purposes:
1) to send a timeout message, in case no answer is received at all [request]
2) to split messages, after receiving the first character [in+request]
So in the case of serial request, checking whether .tout is already
set is no longer a valid condition for 2).
Let's just check whether i === 1, and clear the timeout set up by 1)
if it's already there.
* serial: add "split on silence" behavior
add a fourth logic to split incoming data into messages.
The existing "split on timeout" logic starts the timeout upon
reception of the first character.
This might lead to unwanted behavior if for instance Node-RED is
restarted, as data might accumulate into OS buffers (see #410).
A different logic might be to only emit a message when enough time
has passed, without any new data being received (line silent), a.k.a.
interbyte timeout.
2018-07-09 12:14:08 +02:00
"request" : "Request" ,
"responsetimeout" : "Default response timeout" ,
"ms" : "ms" ,
2015-06-16 11:36:19 +02:00
"serial" : "serial" ,
2019-04-04 23:20:21 +02:00
"none" : "none" ,
"start" : "Optionally wait for a start character of" ,
"startor" : ", then"
2015-06-16 11:36:19 +02:00
} ,
"placeholder" : {
"serialport" : "for example: /dev/ttyUSB0/"
} ,
"parity" : {
"none" : "None" ,
"even" : "Even" ,
"mark" : "Mark" ,
"odd" : "Odd" ,
"space" : "Space"
} ,
2019-12-04 15:03:58 +01:00
"linestates" : {
2019-12-04 16:06:40 +01:00
"none" : "auto" ,
2019-12-04 15:03:58 +01:00
"high" : "High" ,
"low" : "Low"
} ,
2015-06-16 11:36:19 +02:00
"split" : {
"character" : "on the character" ,
"timeout" : "after a timeout of" ,
Serial request (#426)
* serial: simplify serialPool.get
serialPool.get() has a lot of arguments.
Just pass the whole serialConfig object instead.
Also introduce early termination to remove one level of indentation.
(Just set your diff tool to ignore all whitespace changes to see
how very little this patch changes)
* serial: move splitting logic onto serialPool
All SerialIn and SerialOut nodes for a given port
share the same splitting logic as it is indeed
set by the common configuration node.
Move the code from SerialIn into serialPool so that
it can be reused by the serial request node.
Notice how the 'data' event will no longer carry
single bytes, but the whole payload instead.
Also move the output encoding logic into serialPool.
* serial: add serial request node
Add a "serial request" node to handle simple request/response
protocols. This node allows for multiple instances, all
sharing the same underlying device.
Responses coming from the serial line will only be propagated
to the output of the node where the request was originally received
(contrary to the "serial in" nodes which all emit the data
received from the serial line).
Every request received as an input to the node, is transmitted
to the serial line, and a matching response must be received
before the next one can be transmitted.
Any input message received in the meantime is internally enqueued.
The node is essentially a merge of serial in and serial out.
It shares the same configuration with serial in and serial out
for any given port and will not affect the behavior of the
existing nodes.
This means you can use, alongside with the request node:
- as many serial in nodes as you want -- e.g. to "sniff"
- serial out to inject mailicious/tampering data onto the serial
line, skipping the queueing mechanism
* serial request: provide some visual feedback on the node
add status indication:
- yellow "waiting" when a message is enqueued for sending
- green "OK" after an answer is received
- red "timeout" after a timeout occurs
More sofisticated output would include an indication of the number of messages
enqueued and the actual timeout remaining after sending.
* serial request: make default response timeout configurable
Notice it's a global setting (i.e. stored in the configuration node)
as opposed to per-node, but it can be overridden by setting msg.timeout.
* serial request: cosmetic changes
- added documentation about msg.port
- timeout field made wider so to accommodate default value of 10000ms
- replaced harcoded text with localizable strings for
"waiting" and "timeout" messages
* serial: cleanup: remove node.tout
this was probably some leftover code from previous implementations.
Now all timeouts are handled within the connection objects.
* serial: cleanup: set obj.tout to null after clearing it
clearing a Timeout without setting it back to null *might* have
adverse effects on later code which would check its null-ity.
Let's just do it.
* serial: cosmetic: add some comments
* serial request: fix "split on timeout" case
In the case of "split on timeout" case, we're reusing the same
.tout for two different purposes:
1) to send a timeout message, in case no answer is received at all [request]
2) to split messages, after receiving the first character [in+request]
So in the case of serial request, checking whether .tout is already
set is no longer a valid condition for 2).
Let's just check whether i === 1, and clear the timeout set up by 1)
if it's already there.
* serial: add "split on silence" behavior
add a fourth logic to split incoming data into messages.
The existing "split on timeout" logic starts the timeout upon
reception of the first character.
This might lead to unwanted behavior if for instance Node-RED is
restarted, as data might accumulate into OS buffers (see #410).
A different logic might be to only emit a message when enough time
has passed, without any new data being received (line silent), a.k.a.
interbyte timeout.
2018-07-09 12:14:08 +02:00
"silent" : "after a silence of" ,
2015-06-16 17:13:55 +02:00
"lengths" : "into fixed lengths of"
2015-06-16 11:36:19 +02:00
} ,
"output" : {
"ascii" : "ascii strings" ,
"binary" : "binary buffers"
} ,
2019-04-04 23:20:21 +02:00
"addsplit" : "Add character to output messages" ,
2015-06-16 11:36:19 +02:00
"tip" : {
Serial request (#426)
* serial: simplify serialPool.get
serialPool.get() has a lot of arguments.
Just pass the whole serialConfig object instead.
Also introduce early termination to remove one level of indentation.
(Just set your diff tool to ignore all whitespace changes to see
how very little this patch changes)
* serial: move splitting logic onto serialPool
All SerialIn and SerialOut nodes for a given port
share the same splitting logic as it is indeed
set by the common configuration node.
Move the code from SerialIn into serialPool so that
it can be reused by the serial request node.
Notice how the 'data' event will no longer carry
single bytes, but the whole payload instead.
Also move the output encoding logic into serialPool.
* serial: add serial request node
Add a "serial request" node to handle simple request/response
protocols. This node allows for multiple instances, all
sharing the same underlying device.
Responses coming from the serial line will only be propagated
to the output of the node where the request was originally received
(contrary to the "serial in" nodes which all emit the data
received from the serial line).
Every request received as an input to the node, is transmitted
to the serial line, and a matching response must be received
before the next one can be transmitted.
Any input message received in the meantime is internally enqueued.
The node is essentially a merge of serial in and serial out.
It shares the same configuration with serial in and serial out
for any given port and will not affect the behavior of the
existing nodes.
This means you can use, alongside with the request node:
- as many serial in nodes as you want -- e.g. to "sniff"
- serial out to inject mailicious/tampering data onto the serial
line, skipping the queueing mechanism
* serial request: provide some visual feedback on the node
add status indication:
- yellow "waiting" when a message is enqueued for sending
- green "OK" after an answer is received
- red "timeout" after a timeout occurs
More sofisticated output would include an indication of the number of messages
enqueued and the actual timeout remaining after sending.
* serial request: make default response timeout configurable
Notice it's a global setting (i.e. stored in the configuration node)
as opposed to per-node, but it can be overridden by setting msg.timeout.
* serial request: cosmetic changes
- added documentation about msg.port
- timeout field made wider so to accommodate default value of 10000ms
- replaced harcoded text with localizable strings for
"waiting" and "timeout" messages
* serial: cleanup: remove node.tout
this was probably some leftover code from previous implementations.
Now all timeouts are handled within the connection objects.
* serial: cleanup: set obj.tout to null after clearing it
clearing a Timeout without setting it back to null *might* have
adverse effects on later code which would check its null-ity.
Let's just do it.
* serial: cosmetic: add some comments
* serial request: fix "split on timeout" case
In the case of "split on timeout" case, we're reusing the same
.tout for two different purposes:
1) to send a timeout message, in case no answer is received at all [request]
2) to split messages, after receiving the first character [in+request]
So in the case of serial request, checking whether .tout is already
set is no longer a valid condition for 2).
Let's just check whether i === 1, and clear the timeout set up by 1)
if it's already there.
* serial: add "split on silence" behavior
add a fourth logic to split incoming data into messages.
The existing "split on timeout" logic starts the timeout upon
reception of the first character.
This might lead to unwanted behavior if for instance Node-RED is
restarted, as data might accumulate into OS buffers (see #410).
A different logic might be to only emit a message when enough time
has passed, without any new data being received (line silent), a.k.a.
interbyte timeout.
2018-07-09 12:14:08 +02:00
"responsetimeout" : "Tip: The default response timeout can be overridden by setting msg.timeout." ,
2019-04-04 23:20:21 +02:00
"split" : "Tip: the \"Split on\" character is used to split the input into separate messages. Can accept chars ($), escape codes (\\n), or hex codes (0x03)." ,
Serial request (#426)
* serial: simplify serialPool.get
serialPool.get() has a lot of arguments.
Just pass the whole serialConfig object instead.
Also introduce early termination to remove one level of indentation.
(Just set your diff tool to ignore all whitespace changes to see
how very little this patch changes)
* serial: move splitting logic onto serialPool
All SerialIn and SerialOut nodes for a given port
share the same splitting logic as it is indeed
set by the common configuration node.
Move the code from SerialIn into serialPool so that
it can be reused by the serial request node.
Notice how the 'data' event will no longer carry
single bytes, but the whole payload instead.
Also move the output encoding logic into serialPool.
* serial: add serial request node
Add a "serial request" node to handle simple request/response
protocols. This node allows for multiple instances, all
sharing the same underlying device.
Responses coming from the serial line will only be propagated
to the output of the node where the request was originally received
(contrary to the "serial in" nodes which all emit the data
received from the serial line).
Every request received as an input to the node, is transmitted
to the serial line, and a matching response must be received
before the next one can be transmitted.
Any input message received in the meantime is internally enqueued.
The node is essentially a merge of serial in and serial out.
It shares the same configuration with serial in and serial out
for any given port and will not affect the behavior of the
existing nodes.
This means you can use, alongside with the request node:
- as many serial in nodes as you want -- e.g. to "sniff"
- serial out to inject mailicious/tampering data onto the serial
line, skipping the queueing mechanism
* serial request: provide some visual feedback on the node
add status indication:
- yellow "waiting" when a message is enqueued for sending
- green "OK" after an answer is received
- red "timeout" after a timeout occurs
More sofisticated output would include an indication of the number of messages
enqueued and the actual timeout remaining after sending.
* serial request: make default response timeout configurable
Notice it's a global setting (i.e. stored in the configuration node)
as opposed to per-node, but it can be overridden by setting msg.timeout.
* serial request: cosmetic changes
- added documentation about msg.port
- timeout field made wider so to accommodate default value of 10000ms
- replaced harcoded text with localizable strings for
"waiting" and "timeout" messages
* serial: cleanup: remove node.tout
this was probably some leftover code from previous implementations.
Now all timeouts are handled within the connection objects.
* serial: cleanup: set obj.tout to null after clearing it
clearing a Timeout without setting it back to null *might* have
adverse effects on later code which would check its null-ity.
Let's just do it.
* serial: cosmetic: add some comments
* serial request: fix "split on timeout" case
In the case of "split on timeout" case, we're reusing the same
.tout for two different purposes:
1) to send a timeout message, in case no answer is received at all [request]
2) to split messages, after receiving the first character [in+request]
So in the case of serial request, checking whether .tout is already
set is no longer a valid condition for 2).
Let's just check whether i === 1, and clear the timeout set up by 1)
if it's already there.
* serial: add "split on silence" behavior
add a fourth logic to split incoming data into messages.
The existing "split on timeout" logic starts the timeout upon
reception of the first character.
This might lead to unwanted behavior if for instance Node-RED is
restarted, as data might accumulate into OS buffers (see #410).
A different logic might be to only emit a message when enough time
has passed, without any new data being received (line silent), a.k.a.
interbyte timeout.
2018-07-09 12:14:08 +02:00
"silent" : "Tip: In line-silent mode timeout is restarted upon arrival of any character (i.e. inter-byte timeout)." ,
2019-04-04 23:20:21 +02:00
"timeout" : "Tip: In timeout mode timeout starts from arrival of first character." ,
"count" : "Tip: In count mode msg.count can override the configured count as long as it smaller than the configured value." ,
"waitfor" : "Tip: Optional. Leave blank to receive all data. Can accept chars ($), escape codes (\\n), or hex codes (0x02)." ,
"addchar" : "Tip: This character is added to every message sent out to the serial port. Usually \\r or \\n."
2015-06-16 11:36:19 +02:00
} ,
"onopen" : "serial port __port__ opened at __baud__ baud __config__" ,
"errors" : {
"missing-conf" : "missing serial config" ,
"serial-port" : "serial port" ,
"error" : "serial port __port__ error: __error__" ,
"unexpected-close" : "serial port __port__ closed unexpectedly" ,
"disconnected" : "serial port __port__ disconnected" ,
"closed" : "serial port __port__ closed"
}
}
2015-11-02 11:40:53 +01:00
}