# Particle.variable(...) limitations and best approach to read multiple variables from different electron boards

**URL:** <https://community.particle.io/t/particle-variable-limitations-and-best-approach-to-read-multiple-variables-from-different-electron-boards/25031>\
**Category:** Cloud\
**Created:** [August 10, 2016, 11:41pm UTC](https://community.particle.io/t/particle-variable-limitations-and-best-approach-to-read-multiple-variables-from-different-electron-boards/25031 "2016-08-10T23:41:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![butilbenceno](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@butilbenceno](https://community.particle.io/u/butilbenceno)\
**Post date:** [August 10, 2016, 11:41pm UTC](https://community.particle.io/t/particle-variable-limitations-and-best-approach-to-read-multiple-variables-from-different-electron-boards/25031/1 "2016-08-10T23:41:51Z")

</div>

Hi Particle Community,

Please help me to figure this out… I have a few electron boards, all of them are intended to run the same software, each will be installed on different units and ultimately each will pull individual set of data to be accessible through the particle cloud.

My original plan was to use particle.variable(…), but I just realized that for more than 100 variables per electron (integers 16-bit each), that might not fly at all.

What would be your suggestion, how should I wrap up the 100+ variables so they become accessible through the cloud? and how can I access them from a webpage?

Regards,  
Jorge

---

<div class="post-metadata">

**Author:** ![Ric](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ric/32/514_2.png) [@Ric](https://community.particle.io/u/Ric)\
**Post date:** [August 10, 2016, 11:53pm UTC](https://community.particle.io/t/particle-variable-limitations-and-best-approach-to-read-multiple-variables-from-different-electron-boards/25031/2 "2016-08-10T23:53:30Z")

</div>

Can you elaborate on why you need 100 16 bit variables for each electron? One way around this problem might be to convert the integers to a String, and combine them since a Particle variable can be 622 bytes long. Several of these String variables might get you to what you need.

---

<div class="post-metadata">

**Author:** ![butilbenceno](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@butilbenceno](https://community.particle.io/u/butilbenceno)\
**Post date:** [August 11, 2016, 12:00am UTC](https://community.particle.io/t/particle-variable-limitations-and-best-approach-to-read-multiple-variables-from-different-electron-boards/25031/3 "2016-08-11T00:00:57Z")

</div>

Thanks Ric,  
Actually while waiting, I was writing that exact approach, my concern now would be, if the other end performs https:// GETs frequently, regardless if the variables change or not, would that imply data consumption on my electron on every GET call?.

---

<div class="post-metadata">

**Author:** ![Ric](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ric/32/514_2.png) [@Ric](https://community.particle.io/u/Ric)\
**Post date:** [August 11, 2016, 12:10am UTC](https://community.particle.io/t/particle-variable-limitations-and-best-approach-to-read-multiple-variables-from-different-electron-boards/25031/4 "2016-08-11T00:10:01Z")

</div>

Yeah, I’m pretty sure that any data transfer from the Electron is going to incur data usage. That’s why using GETs for this purpose is probably not a good idea. Without knowing more about what you’re trying to do, it’s hard to give you specific advice, but you might think about using Particle.publish (the data is only 255 bytes though), and only publish when the data changes. Of course, if you’re combining multiple ints into one string, then any time any one of those ints changes, the whole variable would be different thus invoking a publish.

---

<div class="post-metadata">

**Author:** ![butilbenceno](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@butilbenceno](https://community.particle.io/u/butilbenceno)\
**Post date:** [August 11, 2016, 6:27pm UTC](https://community.particle.io/t/particle-variable-limitations-and-best-approach-to-read-multiple-variables-from-different-electron-boards/25031/5 "2016-08-11T18:27:30Z")

</div>

Thanks Ric, I know I was a little bit vague with my explanation, but my approach is also very general.  
Anyway, you still guide me to the right answer.  
Look, seems like these two tutorials are exactly what I was looking for:

> [@Tutorial: Getting Started with Spark.publish()](https://community.particle.io/t/tutorial-getting-started-with-spark-publish/3422):
>
> Here’s a tutorial to get you started using Spark.publish(). Let’s imagine you want to monitor your core’s uptime, that is, how many hours, minutes, and seconds since the last time the core was reset or powered-up and view it on a web page that you can leave open all the time. You can use the millis() function to measure time and for this example, you can ignore the fact that it can wrap-around back to zero after many days. So you need two things, code for your Spark core and code for a web page…

> [@Using Spark.publish() with Simple JSON Data](https://community.particle.io/t/using-spark-publish-with-simple-json-data/3469):
>
> Let’s say you have looked at the [Getting Started with Spark.publish()](https://community.spark.io/t/tutorial-getting-started-with-spark-publish/3422) tutorial, but you need to send data that needs more processing once it gets to its destination on the web. You have a lot of choices for the data format, but one simple choice is to use [JSON, the JavaScript Object Notation](http://json.org) which let you send property names and values in an easy to read and easy parse to format. You may have noticed in fact that the data returned by listening to the event stream from a published event is alr…

---

<div class="post-metadata">

**Author:** ![will](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/will/32/23374_2.png) [@will](https://community.particle.io/u/will)\
**Post date:** [August 11, 2016, 8:47pm UTC](https://community.particle.io/t/particle-variable-limitations-and-best-approach-to-read-multiple-variables-from-different-electron-boards/25031/6 "2016-08-11T20:47:55Z")

</div>

Wow! That’s a lot of data!

I believe there is a [limit of 12 Particle.variable()](https://docs.particle.io/reference/firmware/photon/#particle-variable-)'s in a firmware function, so you wouldn’t be able to register 100 of them. You would be able to use the Particle pub/sub system, though, to publish variables via the API so that can be stored/captured/consumed.
