Does MY_DEVICES in Particle.subscribe() even work? doesn't seem to for me

I was trying to send a measurement from one of my Photons to another, with the 0.4.9 firmware, and was using the MY_DEVICES in the Particle.subscribe for security purposes. The measurement that gets sent controls a pump, so I don’t want anyone to just be able to send bogus measurements. Although don’t you need my access token to publish to my devices?

When I had the MY_DEVICES argument in my

Particle.subscribe(“whatever”, eventHandler, MY_DEVICES);

my Photon wasn’t receiving the Particle.publish() events from my other device. I removed the MY_DEVICES and it works fine, obviously. What gives?

Did you publish with the PRIVATE flag? -
https://docs.particle.io/reference/firmware/photon/#particle-publish-

3 Likes

Hmm, posting a "question" and not awaiting an answer ... :confused:
Why bother answering then?

1 Like

Adding the PRIVATE flag to the Particle.Publish() indeed fixed the problem.

@ScruffR, I don’t know how to respond.

Not with a flag, I’d say.

And with a “Thank you, Kenneth!” who bothered to answer in his free time (as we Elites are all voluntary donating our personal free time to the community) although this was a question that would have been easily answered by one look in the docs.
The like buttons are there for a reason too - the expression of appreciation is the only thing we get as reward from the community, and if we don’t even get this, what’s our effort worth then?

1 Like

Alright, thanks.

1 Like