EDIT: Whoops! Found the appropriate line in the docs: “NOTE: A device can register up to 4 event handlers. This means you can call Particle.subscribe() a maximum of 4 times; after that it will return false.” Well that sucks. How am I supposed to get more than 4 variables from one Photon to another then?
I’ve got two Photons, one is running out in my shed connected to a weather sensor, the other is running indoors connected to an LCD screen.
Originally, I had the one in the shed outputting 4 variables via Particle.Publish - Temp, humidity, pressure, and absolute humidity - sending all four at once every 20 seconds. And the LCD one in the house happily displayed all of them.
Well today I added an anemometer. I made sure to stagger its particle.publish event 10 seconds apart from the other one, because I’m well aware of the 4-per-second limit, and then it publishes once every minute - wind speed, and wind gust. I know these events are publishing just fine without issue, because I can see them appearing on my Particle Web Console.
What isn’t working, is the ability to display them on the indoor photon with the LCD. The original 4 weather variables were showing up just fine, but not the wind speed, even though I could see it being published in the console. I discovered that by rearranging the particle.subscribe code in the setup to a different order, suddenly I was able to see the Wind speed, wind gust, pressure and humidity, but no temperature or absolute humidity.
It’s as though particle.subscribe can only subscribe to a max of 4 variables, but I can’t see anything to indicate as such in the docs.