Haibo Huang | 24c77a1 | 2020-04-29 13:49:57 -0700 | [diff] [blame] | 1 | # MQTT in curl |
| 2 | |
Haibo Huang | 24c77a1 | 2020-04-29 13:49:57 -0700 | [diff] [blame] | 3 | ## Usage |
| 4 | |
| 5 | A plain "GET" subscribes to the topic and prints all published messages. |
| 6 | Doing a "POST" publishes the post data to the topic and exits. |
| 7 | |
| 8 | Example subscribe: |
| 9 | |
| 10 | curl mqtt://host/home/bedroom/temp |
| 11 | |
| 12 | Example publish: |
| 13 | |
| 14 | curl -d 75 mqtt://host/home/bedroom/dimmer |
| 15 | |
| 16 | ## What does curl deliver as a response to a subscribe |
| 17 | |
| 18 | It outputs two bytes topic length (MSB | LSB), the topic followed by the |
| 19 | payload. |
| 20 | |
| 21 | ## Caveats |
| 22 | |
| 23 | Remaining limitations: |
| 24 | - No username support |
| 25 | - Only QoS level 0 is implemented for publish |
| 26 | - No way to set retain flag for publish |
| 27 | - No username/password support |
| 28 | - No TLS (mqtts) support |
| 29 | - Naive EAGAIN handling won't handle split messages |