How to include \r in the mqtt message?
helpme1 opened this issue · comments
helpme1 commented
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?
shirou commented
Sorry for very late response 😢
I change to read Bytes()
not Text()
. And, perhaps it may work with using tr
to write \r
.
echo "FOO _ BAR"| tr "_" "\r" | ./mqttcli pub -t "foo/bar" -s