Problem in MQTT

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem in MQTT

Jump to solution
7,223 Views
prasanthapplied
Contributor III

Dear all,

        I'm using IMXRT1064 development board and i want to use lwip mqtt example. So i tried an example which was given in SDK. While running the board getting DHCP IP and it resolves MQTT broker ip then subscribed a topic. But after that the connection gets failed. The serial window comes like

Initializing PHY...

************************************************
 MQTT client example
************************************************
Getting IP address from DHCP...

IPv4 Address     : 10.10.37.1
IPv4 Subnet mask : 255.255.0.0
IPv4 Gateway     : 10.10.0.202

Resolving "test.mosquitto.org"...
Connecting to MQTT broker at 5.196.95.208...
MQTT client "lwip_client-123" connected.
Subscribing to the topic "lwip_topic/#" with QoS 0...
Subscribing to the topic "lwip_other/#" with QoS 1...
Subscribed to the topic "lwip_topic/#".
Going to publish to the topic "lwip_topic/100"...
Subscribed to the topic "lwip_other/#".
Published to the topic "lwip_topic/100".
Received 18 bytes from the topic "lwip_topic/100": "message from board"
MQTT client "lwip_client-123" not connected.
Connecting to MQTT broker at 5.196.95.208...
MQTT client "lwip_client-123" connected.
Subscribing to the topic "lwip_topic/#" with QoS 0...
Subscribing to the topic "lwip_other/#" with QoS 1...
MQTT client "lwip_client-123" not connected.
Connecting to MQTT broker at 5.196.95.208...
MQTT client "lwip_client-123" connected.
Subscribing to the topic "lwip_topic/#" with QoS 0...
Subscribing to the topic "lwip_other/#" with QoS 1...
MQTT client "lwip_client-123" not connected.

after sending one or two messages it continuously says not connected. So whats may gives a problem. Please help me to find the solution?

Thanks & Regards,

Prasanth

Labels (1)
0 Kudos
Reply
1 Solution
6,708 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi prasanth R,

   I think it is also related to the web, or the MQTT broker side stability.

   Because, sometimes, when I can't connect the mqtt, I find even the mqtt.fx also lost the connection:

pastedImage_1.png

   I think, this is also the problem why the SDK author can't reproduce our problems in the previous time.

   So, maybe you also can create your own MQTT stable broker, and test it again on your side.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
---------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
22 Replies
284 Views
prasanthapplied
Contributor III

Dear Kerry,

        How long will you need to test the code?

Prasanth

0 Kudos
Reply
284 Views
prasanthapplied
Contributor III

Okay Sure.

0 Kudos
Reply