Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] python woes

oh wow,  client-id I thought .. never mind.. that explains a lot.  thank you!

Where is the Paho mail list?

On Wed, Sep 25, 2019 at 2:38 AM Roger Light <roger@xxxxxxxxxx> wrote:
Hi Carl,

Ideally, yes, or asking on the Paho mailing list.

In this case I can tell you the problem is occurring because you have
the same client ID for your second and fourth clients, so when one
connects, the previous one will be disconnected. Client IDs must be
unique on the broker. Try "scoreboard1", "scoreboard2" and it should
be fine.

Regards,

Roger

On Wed, 25 Sep 2019 at 06:57, Carl Karsten <carl@xxxxxxxxxxxxxxxx> wrote:
>
> ah, just found  https://github.com/eclipse/paho.mqtt.python/issues.
>
> Sorry, I bet these issues belong there?
>
>
>
> On Tue, Sep 24, 2019 at 9:40 PM Carl Karsten <carl@xxxxxxxxxxxxxxxx> wrote:
>>
>> if I use this for the pub, everything works fine:
>>
>> publish.single("foo/show", "1", )
>>
>> On Tue, Sep 24, 2019 at 8:06 PM Carl Karsten <carl@xxxxxxxxxxxxxxxx> wrote:
>>>
>>>
>>>
>>>
>>> sudo apt install mosquitto
>>> $ mosquitto -h
>>> mosquitto version 1.5.7
>>>
>>> shell 1:
>>> mosquitto_sub -v -t \#
>>>
>>> shell 2:
>>> import paho.mqtt.client as mqtt
>>>
>>> def show(client, userdata, message):
>>>     print("show")
>>>
>>> client = None
>>>
>>> client = mqtt.Client("scoreboard")
>>> client.connect("localhost")
>>> client.subscribe("foo/#")
>>> client.message_callback_add("foo/show", show)
>>> client.loop_forever(retry_first_connection=True)
>>>
>>> shell #3
>>> mosquitto_pub -t foo/show -m 1
>>> # messages show up in #1 and 2
>>>
>>> shell 4:
>>> import paho.mqtt.client as mqtt
>>>
>>> client = None
>>>
>>> client = mqtt.Client("scoreboard")
>>> client.connect("localhost")
>>> client.loop_start()
>>>
>>> client.publish("foo/show","1")
>>>
>>> Shows up in #1, and now #2 seems un responsive
>>>
>>> --
>>> Carl K
>>
>>
>>
>> --
>> Carl K
>
>
>
> --
> Carl K
> _______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://www.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://www.eclipse.org/mailman/listinfo/mosquitto-dev


--
Carl K

Back to the top