MQTT publish rate of Photon

Hello all,

I know a Particle.publish() can publish 1/sec but want to know what is the publishing rate of photon if I use client.publish() in MQTT library to publish on MQTT broker.

I don’t think there is any other limit than network throughput vs. buffer size.

Recently I used an accelerometer with photon running at 100 Hz. Every output value was sent to MQTT broker to see the result. However when I compared the result from MQTT broker with serial monitor many entries were missed. Does it not show that Photon is not able to publish the result at faster rate?

That would greatly depend on the MQTT library which was contributed and isn’t Particle’s code.
The underlying TCP layer is definetly fast enough for several KB/s

Look here

1 Like

Does this mean that I have to write my own library for faster performance?

Not necessarily, you could take a look at the existing library, locate the possible bottle neck and work around that.
And if you manage to do that, file a pull-request on the original library repo :wink:

1 Like

Thanks a lot!

You could also raise this problem on the library repo as an issue. Maybe the original contributor can help too.

Great suggestion. I will do that.