Difference between revisions of "MQTT communication applications"

From Banana Pi Wiki
Jump to: navigation, search
(Prepare the MQTT server)
(Blanked the page)
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
=About MQTT=
MQTT today is an important part of the Internet of things, the service of outer complex security functions, architecture design belongs to the data forwarding servers at the same time, for example, an MQTT server, can solve different types of two sets of data exchange system, through subscription and transceiver interface design, it will only responsible for both ends to an exchange of data.
MQTT server mode of transmission can be thought of as everyone through their internal engagement after entering a public chat room, if you want to communicate with others, you can create a chat room (push), you can also add other people chat room (subscription), server regardless of how to communicate between you, it will only help you to the chat room set up and free exchange of information between you can, also have completed the transfer.
for example:
*Xiao Ming want to send a message to the little red, so xiao Ming can create a topic (topic) of the chat room for sending (publish), then the little red to join (subscribe) this topic (topic) of the chat room, so she could get the xiao Ming's information, the old version of the MQTT chat room is public, between each other is free to join others' topic, also is the others can receive xiaoming, privately, but now the MQTT server allows you to define permissions (config), Let xiao Ming's topic only xiao hong can join.
*Code between under this architecture, we are the client code, also do not need to write the server receives the program to another, as long as the two sides agree on the data of the interface agreement is ok, because the communication between the too transparent, so the security so far are too dependent on the surface of certification, will be back to authority and to improve the communication control.
=Prepare the MQTT server=
Use a common MQTT server. If you do not have a public server, click here to enter [http://www.tongxinmao.com/txm/webmqtt.php The communication cat shares the MQTT server online client].Note that the ports of the WS and TCP servers are not the same, so you need to change the server port when you connect
You can also test out the MQTT service directly online, subscribing to your own topic messages and sending your own.
If you don't want to use the Internet's own MQTT server, you can use [https://github.com/BPI-STEAM/BPI-BIT-MicroPython/releases/tag/windows-mosquitto the local mosquitto Windows server environment pack], Just unzip and write out the mosquitos, and the config file is the '''mosquito.conf

Latest revision as of 20:20, 23 February 2019