Mosquitto MQTT publish hexadecimal message ?

1,586 views
Skip to first unread message

Martinez Benjamin

unread,
Apr 14, 2017, 3:48:59 AM4/14/17
to MQTT
Hello,
I am facing a problem and maybe someone here will be able to help me.
I am using mosquitto MQTT and I am trying to find a way to give the mosquitto_pub an hexadecimal value, when I send as parameter -m '11223344' it is sending the value in ASCII, same when sending -m 11223344, I also tried to put 11223344 in a file and to send -f myfile but the payload is still in ASCII.
Does anyone have been facing the same problem?

Thanks,

Benjamin.

Paul Fremantle

unread,
Apr 14, 2017, 5:02:10 AM4/14/17
to mq...@googlegroups.com
You can do something like this:

echo -ne "\x45\x23\x43" | mosquitto_pub -h test.mosquitto.org -t 'test/binary' -s

Paul

--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+unsubscribe@googlegroups.com.
To post to this group, send email to mq...@googlegroups.com.
Visit this group at https://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.



--
Paul Fremantle
Doctoral Researcher, University of Portsmouth, School of Computing
Visiting Scientist, Institute of the Architecture of Application Systems, Stuttgart
Visiting Lecturer, Software Engineering Programme, Oxford University
Co-Founder, WSO2
Apache Member and Committer
twitter: pzfreo / skype: paulfremantle / blog: http://pzf.fremantle.org
Reply all
Reply to author
Forward
0 new messages