diff --git a/io/serialport/README.md b/io/serialport/README.md index 95840c34..73266ff3 100644 --- a/io/serialport/README.md +++ b/io/serialport/README.md @@ -61,46 +61,42 @@ When the node-red starts, the flow(program) picks up the pre-programmed serial p This `Serial Control` node provides the serial port control capability to -1. stop the communication and releasing the serial port so, for example the Arduino can upload the new binary without shutting down the nodered. -2. start the communication after stopped with this `Serial Control` node for above reason or the like. -3. change the serial port and the configuration on the run time programatically. -4. query the serial port configuration. +1. change the serial port and its configuration on the run time programatically. +2. stop the communication and releasing the serial port so, for example the Arduino can upload the new binary without shutting down the nodered. +3. start the communication after stopped with this `Serial Control` node for above reason or the like. -In order to control the communication, just send these JSON messages to the control node. - -To stop +
In order to control the communication, just send these JSON messages to the control node.
```json -{ - "stop":"" -} -``` - -To start -```json -{ - "stop":"" -} -``` - -To change the port configuration -```json -{ - "config" : { - "newport": "/dev/tty.usbmodem1234561", + { + "serialport": "/dev/tty.usbmodem1234561", "serialbaud": 115200, "databits": 8, "parity": "none", "stopbits": 1 + "enable": true } -} -``` - -To query the port configuration -```json -{ - "config":"query" -} ``` +changes the serial port and the configuration on the fly. +The following optional parameters will change the configuration only if they are present.
+Any combination of them can be passed to change/control the serial communication
+When the `enable` property is not present, it will default to `true`
++`{"enable":true}` or `{"enable":false}` will start or stop the communication.
+If `enable` is passed along wiht other parameters, the configuration will be changed and either be started or just stopped and ready to start depending on the value.
**Here is the serial control node usage example flow** diff --git a/io/serialport/locales/en-US/25-serial.html b/io/serialport/locales/en-US/25-serial.html index c3e4d9e4..a2836be5 100644 --- a/io/serialport/locales/en-US/25-serial.html +++ b/io/serialport/locales/en-US/25-serial.html @@ -117,11 +117,26 @@ "enable": true } changes the serial port and the configuration on the fly. - The following parameters are optional and will change the configuration only if they are present. - "serialport", "serialbaud", "databits", "parity", "stopbits", "dtr", "rts", "cts", "dsr", "bin", "out" -{"enable":true}
or {"enable":false}
will stop or start the communication. And 'enable' can be passed along with the other configuration parameters as well, which will then change the configuration and either start or just stopped and ready to start.
-
-
+ The following optional parameters will change the configuration only if they are present.
+Any combination of them can be passed to change/control the serial communication
+When the enable
property is not present, it will default to true
+ {"enable":true}
or {"enable":false}
will start or stop the communication.
If enable
is passed along wiht other parameters, the configuration will be changed and either be started or just stopped and ready to start depending on the value.
msg.payload
is the response. It contains the serial port configuration