简体   繁体   English

使用 MQTT 进行设备通信

[英]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.

相关问题 MQTT双向通讯 - MQTT Two way communication MQTT发布/订阅通信格式 - MQTT pub/sub communication format 树莓派、MQTT 或 TCP/IP 之间的通信 - Communication Between Raspberry Pi, MQTT or TCP/IP 无法使用 MQTT 从 esp8266 向 Raspberry (Broker) 发送发布消息。 获取套接字错误<Random Device Id> , 断开 - Unable to send publish messages from esp8266 to Raspberry (Broker) using MQTT. Getting Socket Error <Random Device Id>, Disconnecting 设备连接 MQTT Broker 时获取设备配置 - Get device configuration when device connects to MQTT Broker 如何使用Django Rest框架在Django服务器和我的设备之间进行实时通信 - How to do Real time communication between Django server and my device, using django rest framework 无法将 Arduino ClearCore 设备连接到树莓派上托管的 MQTT 服务器 - Unable to connect Arduino ClearCore device to MQTT server hosted on raspberry pi 对于受限设备,为什么AMQP客户端应用程序不如MQTT客户端好? - For constrained device why AMQP client application is not good as like as MQTT client? 在Raspberry Pi,Arduino和JavaScript之间使用MQTT - Using MQTT between Raspberry Pi, Arduino and JavaScript 需要一些帮助,以便Google设备(Android Pie)与Google Cloud Platform上的服务器之间的MQTT通信 - Need some help for MQTT communcation between android device( Android pie) and server on Google cloud plateform
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM