I am using a command-line mqtt client. https://github.com/shirou/mqttcli
I would like to publish a message with \r carriage return character inside. Below is what I did.
mqtt-cli mqtt.test.com topic "mqtt_msg 1\r"
However, the carriage return character is not sent. Instead, the ASCII "\r" characters are sent. How can I put the \r carriage return inside the mqtt message?
Try this.
mqtt-cli mqtt.test.com topic "mqtt_msg 1\\r"
You need to add the extra \
as escape character.