Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Mosquitto pub/sub problem

Here is my logs doing exactly the same stuff. Do you also have the server log? As you can see it works perfectly for me with no issues.

Paul

==============

mosquitto_sub -d -t sensors/value

Client mosqsub/16156-pauls-air sending CONNECT

Client mosqsub/16156-pauls-air received CONNACK

Client mosqsub/16156-pauls-air sending SUBSCRIBE (Mid: 1, Topic: sensors/value, QoS: 0)

Client mosqsub/16156-pauls-air received SUBACK

Subscribed (mid: 1): 0

Client mosqsub/16156-pauls-air received PUBLISH (d0, q0, r0, m0, 'sensors/value', ... (4 bytes))

test

Client mosqsub/16156-pauls-air sending PINGREQ

Client mosqsub/16156-pauls-air received PINGRESP

=============

mosquitto_pub -d -t sensors/value -m "test"

Client mosqpub/16180-pauls-air sending CONNECT

Client mosqpub/16180-pauls-air received CONNACK

Client mosqpub/16180-pauls-air sending PUBLISH (d0, q0, r0, m1, 'sensors/value', ... (4 bytes))

Client mosqpub/16180-pauls-air sending DISCONNECT

==============

1398854480: mosquitto version 1.2.90 (build date 2013-11-07 13:52:25+0000) starting

1398854480: Using default config.

1398854480: Opening ipv4 listen socket on port 1883.

1398854480: Opening ipv6 listen socket on port 1883.

1398854490: New connection from ::1 on port 1883.

1398854490: New client connected from ::1 as mosqsub/16156-pauls-air (c1, k60).

1398854503: New connection from ::1 on port 1883.

1398854503: New client connected from ::1 as mosqpub/16180-pauls-air (c1, k60).

============






On 30 April 2014 11:14, Guy Dillen <guy.dillen@xxxxxxxxx> wrote:
Hi Roger,

I first started the subscriber:
root@clanton:~# mosquitto_sub -d -t sensors/value
Client mosqsub/2614-clanton sending CONNECT
Client mosqsub/2614-clanton received CONNACK
Client mosqsub/2614-clanton sending SUBSCRIBE (Mid: 1, Topic:
sensors/value, QoS: 0)
Client mosqsub/2614-clanton sending PINGREQ
Client mosqsub/2614-clanton received PINGRESP

And then try sending messages:

root@clanton:~/mosquitto-1.3.1# mosquitto_pub -d -t sensors/value -m "test"
Client mosqpub/2617-clanton sending CONNECT
Client mosqpub/2617-clanton received CONNACK
Client mosqpub/2617-clanton sending PUBLISH (d0, q0, r0, m1,
'sensors/value', ... (4 bytes))
Client mosqpub/2617-clanton sending DISCONNECT
root@clanton:~/mosquitto-1.3.1# mosquitto_pub -d -t sensors/value -m "test"
Client mosqpub/2626-clanton sending CONNECT
Client mosqpub/2626-clanton received CONNACK
Client mosqpub/2626-clanton sending PUBLISH (d0, q0, r0, m1,
'sensors/value', ... (4 bytes))
Client mosqpub/2626-clanton sending DISCONNECT
root@clanton:~/mosquitto-1.3.1#

Still the same the messages don¹t arrive at the subscription part.

Guy





On 30/04/14 11:25, "Roger Light" <roger@xxxxxxxxxx> wrote:

>Hi Guy,
>
>You need to run the subscribe before the publish, otherwise it isn't
>there to receive the message. If there are no subscribers on a topic
>the message isn't stored in case any connect.
>
>For 1.3.1 you need c-ares installed. On Debian based systems this is
>available by installing the packages
>
>libc-ares-dev
>libc-ares2
>
>Alternatively you could compile with
>
>make WITH_SRV=no
>
>Regards,
>
>Roger
>
>
>On Wed, Apr 30, 2014 at 10:15 AM, Guy Dillen <guy.dillen@xxxxxxxxx> wrote:
>> Hi Roger,
>>
>> Thanks.
>>
>> Please see repost:
>>
>> root@clanton:~# mosquitto_pub -d -t sensors/value -m "test"
>> Client mosqpub/1869-clanton sending CONNECT
>> Client mosqpub/1869-clanton received CONNACK
>> Client mosqpub/1869-clanton sending PUBLISH (d0, q0, r0, m1,
>> 'sensors/value', ... (4 bytes))
>> Client mosqpub/1869-clanton sending DISCONNECT
>>
>> root@clanton:~# mosquitto_sub -d -t sensors/value
>> Client mosqsub/1884-clanton sending CONNECT
>> Client mosqsub/1884-clanton received CONNACK
>> Client mosqsub/1884-clanton sending SUBSCRIBE (Mid: 1, Topic:
>> sensors/value, QoS: 0)
>>
>>
>>
>> I tried building 1.3.1 but gives build errors:
>>
>> root@clanton:~/mosquitto-1.3.1# make
>> make: Warning: File `config.mk' has modification time 2724955 s in the
>> future
>> set -e; for d in lib client src; do make -C ${d}; done
>> make[1]: Entering directory `/home/root/mosquitto-1.3.1/lib'
>> make[1]: Warning: File `../config.mk' has modification time 2724955 s in
>> the future
>> cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK
>> -DWITH_THREADING -DWITH_SRV -c mosquitto.c -o mosquitto.o
>> In file included from mosquitto.c:46:0:
>> mosquitto_internal.h:51:20: fatal error: ares.h: No such file or
>>directory
>>  #  include <ares.h>
>>                     ^
>> compilation terminated.
>> make[1]: *** [mosquitto.o] Error 1
>> make[1]: Leaving directory `/home/root/mosquitto-1.3.1/lib'
>> make: *** [mosquitto] Error 2
>>
>> Thanks.
>>
>> Guy
>>
>> On 30/04/14 11:04, "Roger Light" <roger@xxxxxxxxxx> wrote:
>>
>>>Hi Guy,
>>>
>>>
>>>> mosquitto_pub -d -m "Test" -t sensors/value
>>>>
>>>>
>>>> Output:
>>>>
>>>> Client mosqsub/1896-clanton sending CONNECT
>>>> Client mosqsub/1896-clanton received CONNACK
>>>> Client mosqsub/1896-clanton sending SUBSCRIBE (Mid: 1, Topic:
>>>>sensors/value,
>>>> QoS: 0)
>>>>
>>>>
>>>> Anyone an idea what goes wrong here?
>>>
>>>You've posted the wrong output - both _sub and _pub have the same
>>>process id (1896) which isn't possible.
>>>
>>>Could you repost?
>>>
>>>I'd suggest building 1.3.1 as well, rather than 1.2.3.
>>>
>>>Cheers,
>>>
>>>Roger
>>>_______________________________________________
>>>mosquitto-dev mailing list
>>>mosquitto-dev@xxxxxxxxxxx
>>>https://dev.eclipse.org/mailman/listinfo/mosquitto-dev
>>
>>
>> _______________________________________________
>> mosquitto-dev mailing list
>> mosquitto-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/mosquitto-dev
>_______________________________________________
>mosquitto-dev mailing list
>mosquitto-dev@xxxxxxxxxxx
>https://dev.eclipse.org/mailman/listinfo/mosquitto-dev


_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mosquitto-dev



--
Paul Fremantle
Part-time PhD student - School of Computing
twitter: pzfreo / skype: paulfremantle / blog: http://pzf.fremantle.org
CTO and Co-Founder, WSO2
OASIS WS-RX TC Co-chair, Apache Member
07740 199 729

Back to the top