cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a method to plot 2D data?

Brad H.
Associate II

In my application I am working with navigation data and would like to visualize coordinates in 2D, is there a way to do this yet?

1 ACCEPTED SOLUTION

Accepted Solutions
stephane.legargeant
ST Employee

Hello BradH

Do you mean plotting on a map ? I would suggest to check the node-RED library : https://flows.nodered.org/ Some nodes like node-red-contrib-web-worldmap could be useful.

In general, it is good to search on node-RED forum/site to find ideas to create flows.

One nice point of STM32CubeMonitor is the capability to use existing nodes from Node-RED community. You can install additional nodes with the menu "manage palette". (If the menu is not visible, you need to install nodejs and npm on your computer)

You can extract the data from the processing node to standard nodes like gauges with the subflow "single data".

See https://wiki.st.com/stm32mcu/wiki/STM32CubeMonitor:How_to_send_data_to_a_gauge

Stephane

View solution in original post

6 REPLIES 6
stephane.legargeant
ST Employee

Hello BradH

Do you mean plotting on a map ? I would suggest to check the node-RED library : https://flows.nodered.org/ Some nodes like node-red-contrib-web-worldmap could be useful.

In general, it is good to search on node-RED forum/site to find ideas to create flows.

One nice point of STM32CubeMonitor is the capability to use existing nodes from Node-RED community. You can install additional nodes with the menu "manage palette". (If the menu is not visible, you need to install nodejs and npm on your computer)

You can extract the data from the processing node to standard nodes like gauges with the subflow "single data".

See https://wiki.st.com/stm32mcu/wiki/STM32CubeMonitor:How_to_send_data_to_a_gauge

Stephane

Brad H.
Associate II

I was just looking for an equivalent of the basic 2D plot from STM Studio, however that worldmap looks fantastic! I'm not familiar with node-RED yet. I'll try to get that worldmap running. Thanks!

I was just looking for an equivalent of the basic 2D plot from STM Studio, however that worldmap looks fantastic! I'm not familiar with node-RED yet. I'll try to get that worldmap running. Thanks!

I have been able to get the map to show up, but I can't get any coordinates working. That worldmap requires input of the form msg.payload = { "name":"Jason", "lat":51.05, "lon":-1.35 }, is the "single value" node capable of creating this from myVariables? It looks like there is more to it.

Hello

"single value" node will extract one variable. If you want to have coordinates, you need to combine 2 information.

I assume you are reading latitude and longitude in 2 separate variables, and you need to combine it.

What can be done is :

  • store the "lon" data inside the flow data ( connect a "change" node to the first "single value" output and set "flow.lon" to "msg.payload" )
  • store the "lat" data inside the flow data ( use a "change" node to the second "single value" and set "flow.lat" to "msg.payload" )
  • use a "template" node to build the worlmap payload. Use the template: { "name":"Jason", "lat":{{flow.lat}}, "lon":{{flow.lon}} }.

This will allow to combine the latest values together and provide both to the worldmap.

Stephane

Just what I needed, thank you!

For other looking to make this work: make sure the output of the change node is type "msg." rather than string. The template node should use the format "Mustache template" and output "Parsed JSON".