[英]Device communication using MQTT
I plan to use MQTT to provide 2 way data exchange between a PC and Raspberry Pi on the same network.我计划使用 MQTT 在同一网络上的 PC 和 Raspberry Pi 之间提供 2 路数据交换。 I know how MQTT works in terms of subscribe/publish and topics.
我知道 MQTT 在订阅/发布和主题方面是如何工作的。 What I am a little unsure about is whether I need 1 or 2 brokers?
我有点不确定是我需要 1 个还是 2 个经纪人?
As I want to provide 2 way communication do I need a broker on the PC and Raspberry Pi or do I only need one and have a client on each?由于我想提供 2 路通信,我需要 PC 和 Raspberry Pi 上的代理,还是只需要一个并且每个都有一个客户端?
MQTT is a hub/spoke protocol MQTT 是一个集线器/辐条协议
Clients connect to a single broker, where they publish messages to topics and subscribe to those topics to receive messages.客户端连接到单个代理,在那里他们将消息发布到主题并订阅这些主题以接收消息。
There is no direct communication between 2 clients, just messages published to the broker and the broker then distributes those messages to any subscribed clients.两个客户端之间没有直接通信,只是发布到代理的消息,然后代理将这些消息分发给任何订阅的客户端。
There is no need for more than one broker in most cases.在大多数情况下,不需要一个以上的经纪人。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.