interaction by command line with mosquitto broker

4,719 views
Skip to first unread message

Ernesto Garcia

unread,
Mar 22, 2012, 6:00:01 AM3/22/12
to mq...@googlegroups.com
Hi,

I'm doing some test with mosquitto broker.

I want to interact with the broker by command line. I mean, connect by telnet as: telnet 192.168.1.1 1883.

I did that, but after establish the connection i don't know which command send or the format.

I get a error messages "Socket read error on client (null), disconnecting."


Could someone help me ?

--
Ernesto

DPS - LWK

unread,
Mar 22, 2012, 6:05:27 AM3/22/12
to mq...@googlegroups.com
would mosquitto_sub and mosquitto_pub do what you need?
http://mosquitto.org/man/mosquitto_pub-1.html
http://mosquitto.org/man/mosquitto_sub-1.html

Matt

> --
> To learn more about MQTT please visit http://mqtt.org
>
> To post to this group, send email to mq...@googlegroups.com
> To unsubscribe from this group, send email to
> mqtt+uns...@googlegroups.com
>
> For more options, visit this group at
> http://groups.google.com/group/mqtt

Ernesto Garcia

unread,
Mar 22, 2012, 6:42:58 AM3/22/12
to mq...@googlegroups.com
Thanks, but i need the way to interact by telnet. This is because i need to see the network dialog between the broker and the client.

Also i have to know where i can modify the transport protocol. I mean, i want to change TCP for UDP. I know UDP is unreliable, but i 'm doing some test about it.

Your help would be very  appreciated.

Ernesto

2012/3/22 DPS - LWK <dps...@gmail.com>



--
Ernesto

Nicholas O'Leary

unread,
Mar 22, 2012, 6:46:08 AM3/22/12
to mq...@googlegroups.com
Hi Ernesto,

MQTT is a binary protocol - telnet is not going to help you understand it.

I suggest you look at the protocol specification -
http://mqtt.org/documentation - to learn about the protocol packet
format and flows.
You can also use a tool like wireshark to see the packets on the wire.

Regards,
Nick

Roger Light

unread,
Mar 22, 2012, 6:50:06 AM3/22/12
to mq...@googlegroups.com
On Thu, Mar 22, 2012 at 10:46 AM, Nicholas O'Leary
<nick....@gmail.com> wrote:

> You can also use a tool like wireshark to see the packets on the wire.

And there are even Wireshark plugins for MQTT:

http://false.ekta.is/2011/06/mqtt-dissector-decoder-for-wireshark/
https://github.com/menudoproblema/Wireshark-MQTT

Cheers,

Roger

Ernesto Garcia

unread,
Mar 22, 2012, 6:51:49 AM3/22/12
to mq...@googlegroups.com
Thanks a lot Nicholas.

And about using UDP instead TCP. It is possible, where i have to modiy in order to get it works with UDP ?

thanks again.

Ernesto

2012/3/22 Nicholas O'Leary <nick....@gmail.com>



--
Ernesto

Ernesto Garcia

unread,
Mar 22, 2012, 6:56:11 AM3/22/12
to mq...@googlegroups.com
Thanks a lot Nicholas.

And about using UDP instead TCP. It is possible, where i have to modiy in order to get it works with UDP ?

thanks again.

Ernesto

2012/3/22 Nicholas O'Leary <nick....@gmail.com>
Hi Ernesto,



--
Ernesto

Ernesto Garcia

unread,
Mar 22, 2012, 6:59:03 AM3/22/12
to mq...@googlegroups.com
Thanks Roger. I will do this.

I would like know if there is a way to use UDP instead TCP for mosquitto broker.

Could you tell me how i can get it ?

Thanks.



2012/3/22 Roger Light <ro...@atchoo.org>
--
To learn more about MQTT please visit http://mqtt.org

To post to this group, send email to mq...@googlegroups.com
To unsubscribe from this group, send email to
mqtt+uns...@googlegroups.com

For more options, visit this group at
http://groups.google.com/group/mqtt



--
Ernesto

Arlen Nipper

unread,
Mar 22, 2012, 10:18:20 AM3/22/12
to mq...@googlegroups.com
MQTT was designed to use TCP for the underlying transport mechanism of the protocol. Due to this fact, you can't use UDP for the transport. If you really do need to use UDP for some reason you might try looking at the MQTTs (MQTT for Sensors) protocol specification.

Cheers, Arlen
Reply all
Reply to author
Forward
0 new messages