I have noticed that if I subscribe to an event in the setup function, sometimes over time [days, weeks] it appears that the subscription may have been lost. The external observation is that I have one particle publishing events to a second particle. The second particle acknowledges the receipt of the event with a handshake by publishing an event which the first particle subscribes to. All works for awhile [days,weeks] and then stops working. Reflashing one or both particles fixes the problem. I have not tried the dash board to see if the original event from first particle is successfully published or not.
I presume a subscription would persist through a cloud “restart” or other networking issue?
I am having a similar issue with particle.subscribe. It appears that even a short blip in internet connectivity causes the subscription to be lost forever, until you reset the device.
There was an old firmware bug where the firmware would not notify the cloud of its subscriptions if the device lost its cloud connection and had to start a new session. This is due to the setup function not being run again on disconnect / reconnect. The best solution was to have the firmware send the subscription notifications again on reconnect…
I think we had planned to fix this in firmware (cc @mdma / @BDub), lets see if they have more recent insights.
I thought I had read there was a finite (and small) number of times you could re-run particle.subscribe. Is this not the case? Do you happen to have a link to the logic used to check if the subscription has been lost?
FWIW, I have been waiting for almost a year for this to be fixed. I gave up long ago and just perform a System.reset() if I haven’t heard data from my subscriptions in awhile. Crude, but it overcomes the issue.
I’ve only been using the latest firmware, but still experience the issue. I have implemented a System.reset() in the meantime, but can recreate the issue on demand by dropping network temporarily and re-connecting. Is there something I can do to check if Particle.subscribe is being re-run?