Multiple readings

Hi! i am trying to take in readings from a sensor and then send that data over to cloud. this process is fine. But to limit the transactions i want to send 10 readings at a time. I dont completely understand how to do that in the flow based environment, is it global variables i need to use ?

Probably not, but it is impossible to say without knowing more information. How are you collecting the data and how do you collect the ten readings together and send them?

We are collecting the sensor data with a variable from the rev pi/ raspberry pi which is the input node. we are trying to add the data to a file node, but we do not know how to loop it, the data just gets appended to the file and the flow goes through to the last node which is the node that sends the data over to the cloud. we dont understand how we can append 10 readings to the file as a batch and only then send that batch over to the cloud. when we try to work our logic with a function it only processes one reading.

maybe the batch node ? (no need for files etc)

1 Like

If I understand the problem fully I think maybe a Join node configured as below might be better, that will accept 10 incoming messages and then pass them on as an array which you can then use to build the data to send to the cloud

You might want to provide a timeout value too so that if the sensor readings stop for some reason then it will send as many as it currently has rather than waiting for the system to recover.

1 Like

This seems to work. great reply! thanks :slight_smile:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.