You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Hiran Chaudhuri <hi...@gmx.net> on 2019/05/03 21:46:51 UTC

Troubleshoot MQTT

Hi there,

I am trying to connect to MQTT appliances (McLighting and
HomeAssistant) to talk to each other. Knowing about the ASF's software
quality my choice for a MQTT broker resulted in ActiveMQ. I am now
running the vromero/activemq-artemis docker image - so I guess the
setup is valid.

Both McLighting and HomeAssistant have been configured to talk to
<ip>:61613, and checking with curl it looks like access to
http://<ip>:61613 works (curl connects but gets hung waiting for a
response - which I consider being ok).

But how do I verify McLighting as MQTT producer actually sends a
message?
How do I verify that HomeAssistant registered to receive such messages?
The Artemis Management Console seems to show me nothing related to MQTT
- or really nothing comes in?

Hiran


Re: Troubleshoot MQTT

Posted by Hiran Chaudhuri <hi...@gmx.net>.
So the producer McLighting seems to work after I configured the correct
port. It's messages are visible in the UI, and I created my own
receiver that logs the messages. strange enough I did not see any
errors, but then that is what embedded devices seem to do every now and
then.

Next is to check what HomeAssistant is actually doing.

Hiran


On Sat, 2019-05-04 at 00:41 +0200, Hiran Chaudhuri wrote:
> Thank you for the quick response, Justin.
>
> Yes, I am aware of the Pub/Sub model, but not sure where in the
> management console I would be supposed to see topics or messages.
>
> What I did not was to create my own Java MQTT client and learned it
> can
> publish to tcp://<ip>:1883 rather than tcp://<ip>:61613. Also the
> management console now shows .../addresses/$sys.mqtt.retain.<my
> topic>/queues/multicast/$sys.mqtt.retain.<my topic>. As soon as I
> select that and hit the Browse button I can see the one message my
> test
> client sent.
>
> With that knowledge I will now try to configure the McLighting
> publisher.
>
> Hiran
>
>
> On Fri, 2019-05-03 at 17:03 -0500, Justin Bertram wrote:
> > All the information provided in the ActiveMQ Artemis web console is
> > expressed in terms of core resources. Since Artemis supports many
> > different
> > protocols it doesn't make sense to display management information
> > in
> > a
> > protocol-specific way.
> >
> > If you want to confirm a message has been sent you can use the web
> > console
> > to look at the address to where the message was supposedly sent and
> > inspect
> > its attributes.
> >
> > MQTT consumers are represented by queues on an address. If the
> > address
> > where the consumer is connecting has a queue and that queue's
> > consumerCount
> > > 0 then your consumer is connected and waiting for messages.
> >
> > Keep in mind that MQTT uses pub/sub semantics so if your consumer
> > isn't
> > connected when messages are sent then it won't receive them.
> >
> >
> > Justin
> >
> > On Fri, May 3, 2019 at 4:47 PM Hiran Chaudhuri <
> > hiran.chaudhuri@gmx.net>
> > wrote:
> >
> > > Hi there,
> > >
> > > I am trying to connect to MQTT appliances (McLighting and
> > > HomeAssistant) to talk to each other. Knowing about the ASF's
> > > software
> > > quality my choice for a MQTT broker resulted in ActiveMQ. I am
> > > now
> > > running the vromero/activemq-artemis docker image - so I guess
> > > the
> > > setup is valid.
> > >
> > > Both McLighting and HomeAssistant have been configured to talk to
> > > <ip>:61613, and checking with curl it looks like access to
> > > http://<ip>:61613 works (curl connects but gets hung waiting for
> > > a
> > > response - which I consider being ok).
> > >
> > > But how do I verify McLighting as MQTT producer actually sends a
> > > message?
> > > How do I verify that HomeAssistant registered to receive such
> > > messages?
> > > The Artemis Management Console seems to show me nothing related
> > > to
> > > MQTT
> > > - or really nothing comes in?
> > >
> > > Hiran
> > >
> > >
>
>


Re: Troubleshoot MQTT

Posted by Hiran Chaudhuri <hi...@gmx.net>.
Thank you for the quick response, Justin.

Yes, I am aware of the Pub/Sub model, but not sure where in the
management console I would be supposed to see topics or messages.

What I did not was to create my own Java MQTT client and learned it can
publish to tcp://<ip>:1883 rather than tcp://<ip>:61613. Also the
management console now shows .../addresses/$sys.mqtt.retain.<my
topic>/queues/multicast/$sys.mqtt.retain.<my topic>. As soon as I
select that and hit the Browse button I can see the one message my test
client sent.

With that knowledge I will now try to configure the McLighting
publisher.

Hiran


On Fri, 2019-05-03 at 17:03 -0500, Justin Bertram wrote:
> All the information provided in the ActiveMQ Artemis web console is
> expressed in terms of core resources. Since Artemis supports many
> different
> protocols it doesn't make sense to display management information in
> a
> protocol-specific way.
>
> If you want to confirm a message has been sent you can use the web
> console
> to look at the address to where the message was supposedly sent and
> inspect
> its attributes.
>
> MQTT consumers are represented by queues on an address. If the
> address
> where the consumer is connecting has a queue and that queue's
> consumerCount
> > 0 then your consumer is connected and waiting for messages.
>
> Keep in mind that MQTT uses pub/sub semantics so if your consumer
> isn't
> connected when messages are sent then it won't receive them.
>
>
> Justin
>
> On Fri, May 3, 2019 at 4:47 PM Hiran Chaudhuri <
> hiran.chaudhuri@gmx.net>
> wrote:
>
> > Hi there,
> >
> > I am trying to connect to MQTT appliances (McLighting and
> > HomeAssistant) to talk to each other. Knowing about the ASF's
> > software
> > quality my choice for a MQTT broker resulted in ActiveMQ. I am now
> > running the vromero/activemq-artemis docker image - so I guess the
> > setup is valid.
> >
> > Both McLighting and HomeAssistant have been configured to talk to
> > <ip>:61613, and checking with curl it looks like access to
> > http://<ip>:61613 works (curl connects but gets hung waiting for a
> > response - which I consider being ok).
> >
> > But how do I verify McLighting as MQTT producer actually sends a
> > message?
> > How do I verify that HomeAssistant registered to receive such
> > messages?
> > The Artemis Management Console seems to show me nothing related to
> > MQTT
> > - or really nothing comes in?
> >
> > Hiran
> >
> >


Re: Troubleshoot MQTT

Posted by Justin Bertram <jb...@apache.org>.
All the information provided in the ActiveMQ Artemis web console is
expressed in terms of core resources. Since Artemis supports many different
protocols it doesn't make sense to display management information in a
protocol-specific way.

If you want to confirm a message has been sent you can use the web console
to look at the address to where the message was supposedly sent and inspect
its attributes.

MQTT consumers are represented by queues on an address. If the address
where the consumer is connecting has a queue and that queue's consumerCount
> 0 then your consumer is connected and waiting for messages.

Keep in mind that MQTT uses pub/sub semantics so if your consumer isn't
connected when messages are sent then it won't receive them.


Justin

On Fri, May 3, 2019 at 4:47 PM Hiran Chaudhuri <hi...@gmx.net>
wrote:

> Hi there,
>
> I am trying to connect to MQTT appliances (McLighting and
> HomeAssistant) to talk to each other. Knowing about the ASF's software
> quality my choice for a MQTT broker resulted in ActiveMQ. I am now
> running the vromero/activemq-artemis docker image - so I guess the
> setup is valid.
>
> Both McLighting and HomeAssistant have been configured to talk to
> <ip>:61613, and checking with curl it looks like access to
> http://<ip>:61613 works (curl connects but gets hung waiting for a
> response - which I consider being ok).
>
> But how do I verify McLighting as MQTT producer actually sends a
> message?
> How do I verify that HomeAssistant registered to receive such messages?
> The Artemis Management Console seems to show me nothing related to MQTT
> - or really nothing comes in?
>
> Hiran
>
>