2

I have used HTTP/s based REST API for IoT application and it works well but consumes more data bandwidth and power. Also, the server resources consumed are too high for the long polling-based method. For the above reasons, I am planning to skip the RESTful API method and would like to give MQTT a try. I haven't implemented MQTT before but read enough to give t a try. The following are a few questions I would like to get a recommendation for. Also please correct me if the reason I am switching to MQTT is wrong and there are different reasons to use MQTT.

  • Device alive was detected with a long polling method previously, using MQTT it has built-in function KeepAlive which sends PINGREQ and PINGRESP packets. Is the KeepAlive method more data-hungry than the long polling method?

  • MQTT uses 3 types of QoS; Level 0: Fire and forget, Level 1: Delivered at least once (you may receive multiple times), Level 2: delivered only once (based on 4 step handshake). I want to receive the message only once(if the message is sent one time only), as duplicates can falsely trigger my application. Do I have to enable QoS 2 which is 4 step handshake and the message is sent only once or QoS 1 is fine? If Qos 1 is fine won't it affect my application at large scale when I have 1000's of devices and messages may receive multiple times? Is a 4-way handshake done every time a message is received for QoS 2? Is it comparatively slower than the REST implementation?

  • I want to update my device which was previously done by sending a binary file over HTTP, do I need to make a topic named something like update and fetch update binary from that topic or I need to implement plain HTTP client to receive a device update? I haven't seen device update over MQTT commonly used, is there some reason that approach isn't used?

  • Let's say I have billing system based data bytes transferred/received, which protocol would be suitable among MQTT and RESTFUL AP based HTTPs considering data transferred is in optimised manner.

I think the above questions may end up not up to point but would like to get recommendations for the doubt. Thank you in advance for your help.

hardillb
  • 12,813
  • 1
  • 21
  • 34
Alan
  • 21
  • 1

0 Answers0