2022-10-04 08:54 PM
I want to use STM32cubemonitor to receive serial port data, the serial port data is four channels. And draw the four-channel data.
I can't find any relevant examples and don't know the implementation to split the data ...
Solved! Go to Solution.
2022-10-12 04:37 AM
Hello @Lep (Community Member)
I'm happy to helped you, and I think that taking the time to learn Node-Red and Javascript is very a good thing, and it's not a waste of time.
However, for your question about displaying the dashboard on another device if I remember, it should be:
http://IP Address:1880/ui
BR
Romain
In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-10-05 12:32 AM
Hello Lep (Community Member)
I don't know how the data of your 4 channels are represented in the payload ?
If you are able to change this representation on your serial interface side, one of the easiest ways is to format your data in csv.
After that, you can use a csv node to split each data in a message.
This resource might inspire you:
https://discourse.nodered.org/t/splitting-payload-from-serial/9356
Best regards,
Romain,
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-10-05 07:12 AM
Thank you.
I am collecting external ADC data, and then inputting it through serial port. 24bits is one channel data, every four is a group(as figure shows). I want to chart the data for each channel, and have the four channels simultaneously do the waveform drawing in real time.
Do you have any relevant examples?
2022-10-05 08:04 AM
Sorry, I do not have any ready-made example.
I can advise you to use a function node, loop through the elements, store each group into a temporary array, convert the array in JSON format.
Thank you to mark my post as answered.
Best regards,
Romain,
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-10-06 04:21 AM
I'm so sorry to trouble you again, but I really don't know what to do, and I can't find any learning materials for this. :loudly_crying_face:
I've been watching javascript and node_red tutorials all afternoon, and I'm pretty new to the programming that functions require....so I'm still out of ideas. I changed the serial port input to the form shown in the figure below. The four values in each line represent the data of four channels. Then I can use the chart to make dynamic waveforms. Can you be more detailed?
2022-10-06 06:23 AM
Hello @Lep (Community Member)
Here attached a very basic flow. The serial data are split with space character \0x20 (because it is the format of your use case)
Then using batch (by 4 elements) and join (into array) node you can send it to csv formater node.
The result is in the debug console in the right.
Here the serial is configured as 115200, 8, 1, n.
Best regards,
Romain
[
{
"id": "230e0643264be2a6",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "9880c74fb5fd3047",
"type": "serial in",
"z": "230e0643264be2a6",
"name": "",
"serial": "c537768eecb1bf9c",
"x": 150,
"y": 220,
"wires": [
[
"dbe44d7b08bfa87c"
]
]
},
{
"id": "9163581ea8fed09e",
"type": "debug",
"z": "230e0643264be2a6",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 830,
"y": 220,
"wires": []
},
{
"id": "d7a21dbe63b020c7",
"type": "csv",
"z": "230e0643264be2a6",
"name": "",
"sep": ",",
"hdrin": false,
"hdrout": "once",
"multi": "mult",
"ret": "
\\n
",
"temp": "",
"skip": "0",
"strings": true,
"include_empty_strings": "",
"include_null_values": "",
"x": 630,
"y": 220,
"wires": [
[
"9163581ea8fed09e"
]
]
},
{
"id": "dbe44d7b08bfa87c",
"type": "batch",
"z": "230e0643264be2a6",
"name": "",
"mode": "count",
"count": "4",
"overlap": "0",
"interval": 10,
"allowEmptySequence": false,
"topics": [],
"x": 310,
"y": 220,
"wires": [
[
"dc238c2f79e7d8d1"
]
]
},
{
"id": "dc238c2f79e7d8d1",
"type": "join",
"z": "230e0643264be2a6",
"name": "",
"mode": "custom",
"build": "array",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "
\\0x20
",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 470,
"y": 220,
"wires": [
[
"d7a21dbe63b020c7"
]
]
},
{
"id": "c537768eecb1bf9c",
"type": "serial-port",
"serialport": "COM49",
"serialbaud": "115200",
"databits": "8",
"parity": "none",
"stopbits": "1",
"waitfor": "",
"dtr": "none",
"rts": "none",
"cts": "none",
"dsr": "none",
"newline": "
\\0x20
",
"bin": "false",
"out": "char",
"addchar": "",
"responsetimeout": "10000"
}
]
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-10-06 06:24 AM
it is probably not the best methods, but it can be a starting point for you.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-10-12 04:04 AM
Thanks again for your help.
Recently, I learned javascript and node red once, and I have basically completed my functions. You have given me a good start to face these problems.
And I have a new problem. I want to display dashboard in my phone, ipad and computer website. What should I do?
2022-10-12 04:37 AM
Hello @Lep (Community Member)
I'm happy to helped you, and I think that taking the time to learn Node-Red and Javascript is very a good thing, and it's not a waste of time.
However, for your question about displaying the dashboard on another device if I remember, it should be:
http://IP Address:1880/ui
BR
Romain
In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-10-12 04:55 AM
Yes, my question is how to find this address or how do I set this address.
I found a related instructional video on Youtube, but I don't know how he did it and how the address was set.
(17) STM32CubeMonitor in practice - How to do a remote monitoring - YouTube