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

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




Back to the top