How to publish more than one value?


#1

Looking at this post:

I can see in the image01, 3 stacks in each bar (Temp, pH and Ammonia). Does this suggest that you can publish 3 values at once?

I ask because I would like to publish 2 values at once (Humidity and Temperature). Right now I publish humidity and then delay for 15 seconds and then publish temperature and then delay 15 seconds. After this, I start over again. The delay of 15 seconds is because, I think I read somewhere, that that is the delay one should observe before publishing again.

I looked at the dashboard doc but it is very sparsely populated.

Thanks
Eric


#2

@EricBrian, the limit on publishing is one per second:

NOTE: Currently, a device can publish at rate of about 1 event/sec, with bursts of up to 4 allowed in 1 second. Back to back burst of 4 messages will take 4 seconds to recover.

So your delay can be 1s instead of 15s. You can publish two values at the same time by using a string to combine the values together. However, that requires converting the string back to the original values on the subscribing end. :smile:


#3

Thanks for this. Can you tell me the source? Maybe it will answer the other questions I have. Thanks.


#4

http://docs.particle.io/photon/firmware/#spark-publish

:wink: