cancel
Showing results for 
Search instead for 
Did you mean: 

How to write variable from flow in cube-monitor?

KJeps.2
Associate II

I think this page would have the content:

https://wiki.st.com/stm32mcu/wiki/STM32CubeMonitor:How_to_write_a_variable_from_flow

It seems that hashKey value can not be read out somewhere?

{"variablelist":[{"address":"{{flow.current_limit_adr}}","name":"current_limit","type":5,"checked":true,"$$hashKey":"object:604","value":"{{payload}}","validity":true}],"accesspoint":0}

(I know how to use the write panel - but need to set 1 variable with value from flow)

1 ACCEPTED SOLUTION

Accepted Solutions
stephane.legargeant
ST Employee

Hello

To write data by flow, the following payload must be sent to probe out node ,with the topic “write�? :

{

   "variablelist": [

       {

           "address": "0x20000060",

           "type": 4,

           "value": "xxxx"

       }

   ],

   "accesspoint": 0

}

 The question has been asked in this topic : https://community.st.com/s/question/0D53W000000ayg1SAA/hello-how-is-it-possible-to-change-a-variable-by-pressing-a-buttoni-just-can-change-a-variable-by-using-the-write-panel-butregards

The post explains with details how to write variable from the flow without using the write-panel. It should answer you point.

We are preparing a wiki page, but it is not finalized yet. So there is just a placeholder right now on the wiki.

best regards

Stephane

View solution in original post

11 REPLIES 11
stephane.legargeant
ST Employee

Hello

To write data by flow, the following payload must be sent to probe out node ,with the topic “write�? :

{

   "variablelist": [

       {

           "address": "0x20000060",

           "type": 4,

           "value": "xxxx"

       }

   ],

   "accesspoint": 0

}

 The question has been asked in this topic : https://community.st.com/s/question/0D53W000000ayg1SAA/hello-how-is-it-possible-to-change-a-variable-by-pressing-a-buttoni-just-can-change-a-variable-by-using-the-write-panel-butregards

The post explains with details how to write variable from the flow without using the write-panel. It should answer you point.

We are preparing a wiki page, but it is not finalized yet. So there is just a placeholder right now on the wiki.

best regards

Stephane

KJeps.2
Associate II

Thanks.... I only forgot the "write" topic :(

"$$hashKey":"object:604"

"validity":true

These 2 is for no use?

/Kasper

You don't need to take care of "$$hashKey" and "validity" to write from flow.

Stephane

KJeps.2
Associate II

Got it - and stuff is working.

This is really a good and powerfull tool you have produced here - Thank you!!

Just as a feedback, i had some problems with adding 2 variables blocks to select different variables, then it uses the same exe config, and mixes up the variables between them.... i ended up using only one variables block and manual parse them out.

On the other hand i could have made several variabel blocks, and connect direct to chart.

/Kasper

Hello,

I follow the instruction and i receive this error:

 "Bad parameter (7)"

msg : string[264]

"Unsuccessful write (Bad parameter (7)) on 48FF6E064986484820270787, for data = "{\n \"variablelist\": [\n {\n \"address\": \"0x20000000\",\n \"type\": 3,\n \"value\": \"3678\"\n }\n ],\n \"accesspoint\": 0\n}": write"

Do you know what's wrong with it? I check the address and i type and they are correct.

Hello

I thing the \n in the log are strange.

Can you compare with the wiki example here : STM32CubeMonitor:How to write a variable from flow - stm32mcu ?

Take care to set the output of "template" node to "parsed JSON".

If not ok, can you insert a debug node after "set topic" node to see what is sent to the node "myProbe_Out" ?

Please let us know the result.

Best regards

Stephane

Hello,

I do the same work as the link, this is my basic flow .

thank you 0693W00000GXfGyQAL.png

Do you mean that it is still not working ?

If it is not working, could you share your flow with me ? (at least export the nodes on the top part)

Best regards

Stephane

Hello

@stephane.legargeant​, it still not working .