Publish and Subscribe Issues

I would think that when I call particle.subscribe() with the device-id of interest, that would serve to push that ID to the cloud.

Yes, but then you could only subscribe to one device per handler slot (max. 4)
The much more flexible solution is what @Ric already proposed and allows for a virtually unlimited number of events to subscribe to - you just need to agree on one prefix and a set of suffixes.

1 Like

You can still subscribe to other people’s events, but you’ll have to do the specific ID filtering yourself. So just subscribe to “temp”, and then filter out the IDs you’re interested in on the receiving end.

1 Like

If I subscribe to other people’s events via CLI I get to see all that info (like Device-ID). But if I do a particle.subscribe() on the photon, then I think my handler function only sees the event name and the associated data field - right? I don’t yet have a photon, but that’s what it looks like from the docs.

That is correct. You only get the event name and data in your handler, not the other associated data that you see in the CLI.

1 Like