Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Requesting for mosquitto version which supports payload in HEX format

Maybe I'm not understanding correctly, but it sounds like you want to display the binary output of your mosquitto_sub in hex format.  If so just pipe it to another tool that can do so.  For example...

mosquitto_sub -h test.mosquitto.org -t "your-topic-with-binary-data" | xxd

cheers!



On Wed, Nov 22, 2017 at 5:13 AM, Brandon Arrendondo <barrendo@xxxxxxxxx> wrote:
I think you misunderstand Surendra's request.

The output of mosquitto_sub, when receiving a message, is what he
wants a flag to manipulate.  Instead of taking the binary payload and
trying to output in ASCII (resulting in many bad characters dumped to
the terminal), he wants a flag that will cause all payloads received
by mosquitto_sub to be printed in hex output.

It is not an unreasonable request - I have wanted this and have
written my own clients to do this same thing.

Regards,
Brandon

On Wed, Nov 22, 2017 at 4:35 AM, Nicholas Humfrey <njh@xxxxxxxxxx> wrote:
> Hello,
>
> I agree with Adrian - it is not quite clear what you are trying to achieve.
> Do you mean a 'binary' (non-text) payload?
> mosquitto_sub supports binary payloads, it is just that there is no way of
> knowing when one message payload ends and the next begins - unless you can
> be sure the messages don't contain newline characters.
>
>
> Did I imagine that there was a version of mosquitto_sub that supports a '-1'
> option to receive a single message and then exit? That may help with a
> binary message payload.
>
> I wonder if it would be useful to be able to pass an '--exec' command line
> argument to mosquito_sub - which runs the specified command for each message
> received - with the message written to STDIN.
>
>
> nick.
>
>
>
>
> On 2017-11-22 05:06, Adrian Brown wrote:
>>
>> Hi not sure what your question really is but this might help MQTT is a
>> binary it’s payload agnostic so if want to send a payload contain
>> hexadecimal characters you can
>>
>> This might help you if your asking how to take a revived payload and
>> turn it into hex and you don’t have coding experience node red might
>> be a good start
>>
>> Cheers
>> Adrian
>>
>> On Wed, 22 Nov 2017 at 3:57 pm, Surendra Manikandan
>> <surendra.manikandan@xxxxxxxxx> wrote:
>>
>>> Hi Team,
>>> I'm in need of formatting the payload in HEX format in the output of
>>> 'mosquitto_sub' command. Can I get the mosquitto version which
>>> supports formatting payload message?
>>>
>>> Thanks,
>>> Surendra
>>> _______________________________________________
>>> mosquitto-dev mailing list
>>> mosquitto-dev@xxxxxxxxxxx
>>> To change your delivery options, retrieve your password, or
>>> unsubscribe from this list, visit
>>> https://dev.eclipse.org/mailman/listinfo/mosquitto-dev
>>
>>
>> --
>>
>> Regards
>> Adrian Brown
>> _______________________________________________
>> mosquitto-dev mailing list
>> mosquitto-dev@xxxxxxxxxxx
>> To change your delivery options, retrieve your password, or
>> unsubscribe from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/mosquitto-dev
>
> _______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/mosquitto-dev
_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mosquitto-dev


Back to the top