1459 views|6 replies

407

Posts

7

Resources
The OP
 

【Distributed temperature and humidity collection system】+MQTT debugging [Copy link]

 

When debugging MQTT, because multiple modules and the same program were used, it was found that during the debugging process, when one module was online, it would squeeze out the connection of another module MQTT. After searching some posts and looking at the protocol, I finally figured out why.

There is a client ID. All modules are a program. The macro-defined ID is the same. After associating with the MAC address, the problem is solved. Please record it.

Before change:

#define MQTT_DEMO_CLIENT_ID "wm_mqtt_client"

mqtt_init(&mqtt_demo_mqtt_broker, MQTT_DEMO_CLIENT_ID);

After change:

mqtt_init(&mqtt_demo_mqtt_broker, deviceName);

deviceName is a MAC address string

This post is from DigiKey Technology Zone

Latest reply

It is equivalent to being directly disconnected by the broker. Unless you reconnect, there will be no communication.   Details Published on 2022-10-20 11:36

赞赏

1

查看全部赞赏

 
 

6818

Posts

11

Resources
2
 
Thanks for sharing, this helps a lot.
This post is from DigiKey Technology Zone
 
 
 

6062

Posts

4

Resources
3
 

The clientID is a unique identifier for the device and must be globally unique. If different devices use the same clientID to connect to the IoT platform at the same time, the device that connects first will be forcibly disconnected.

This post is from DigiKey Technology Zone
 
 
 

6742

Posts

2

Resources
4
 

[Will it squeeze out the connection of another module MQTT] Is this an operation performed by the server?

This post is from DigiKey Technology Zone

Comments

Of course, how can the client know?  Details Published on 2022-10-20 10:08
 
 
 

6062

Posts

4

Resources
5
 
This post was last edited by damiaa on 2022-10-20 10:12
wangerxian posted on 2022-10-20 09:41 [Will it squeeze out the connection of another module MQTT] Is it an operation performed by the server?

That should be the broker . How can the client know that someone is impersonating them ?

This post is from DigiKey Technology Zone

Comments

It is equivalent to being directly disconnected by the broker. Unless you reconnect, there will be no communication.  Details Published on 2022-10-20 11:36
 
 
 

27

Posts

0

Resources
6
 
Thanks for sharing!
This post is from DigiKey Technology Zone
 
 
 

6742

Posts

2

Resources
7
 
damiaa posted on 2022-10-20 10:08 wangerxian posted on 2022-10-20 09:41 [Will it squeeze out the connection of another module MQTT] Is it an operation done by the server? Then it should be b ...

It is equivalent to being directly disconnected by the broker. Unless you reconnect, there will be no communication.

This post is from DigiKey Technology Zone
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list