got again a weird problem: our code (on a P1 - 1.5.3 - system mode semiautomatic) uses Particle.publish to transmit state to the server. at startup there is always one publish (which always works) and then we usually execute a function on the device (Particle.function) which will cause another set of Particle.publishes. this first publish is actually in the Particle.function (which might be bad?!) and the second is not but triggered after the function is done.
the weird thing and the reason why i did not looked at this earlier is that after flashing “fresh” code to the device (and restarting) this all works fine. but when the device is just restarted it will not work (“not work” = publish does return “true” but are never received by the particle cloud)
i am going to rewrite this so that there are no publishes in the function (but this will take some time)
am i right to assume this is the problem (Particle.publish in Particle.function)? and blocking a further publishes?
AFAIK there is no 1.5.3 - is it 1.5.2 or 1.5.4-rc.x?
Particle.publish() in setup() or a Particle.function() callback should not be any problem.
However, when you talk about a set of publishes, you may be running into the rate limit of 1 publish per second (with a burst of 4 followed by a 4sec cool down phase).