How to send a large amount of data via MQTT? #2715
-
I need to send a large amount of data via MQTT, up to 2048 bytes! Which function should I use, mg_mqtt_pub() or publish_status()? Do I need to increase any buffers in the library itself? And the second question, how quickly can I send data? For example, can I send 2KB every 1ms? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I don't see any publish_status() function in the Mongoose API publish_status() is not a Mongoose API function but just an example of a function that publish es the status of something in an example of a user application. Guess what function it is using: mongoose/examples/mqtt-dashboard/device/net.c Lines 83 to 110 in c7f9fe4 Please read https://mongoose.ws/documentation/#best-practices We don't have timing limitations in Mongoose, and we don't support multithreading, so there is no way you could send at a faster speed than your loop lets you send. If you refer to the poll manager timeout, it can be as short or as large as your other actions in the same loop allow |
Beta Was this translation helpful? Give feedback.
I don't see any publish_status() function in the Mongoose API
I don't see any example using other function than mg_mqtt_pub()
Please follow the guidelines in the documentation, examples and tutorials available.
publish_status() is not a Mongoose API function but just an example of a function that publish es the status of something in an example of a user application. Guess what function it is using:
mongoose/examples/mqtt-dashboard/device/net.c
Lines 83 to 110 in c7f9fe4