当前位置:网站首页>Learn from Taiji makers - mqtt (V) publish, subscribe and unsubscribe
Learn from Taiji makers - mqtt (V) publish, subscribe and unsubscribe
2022-06-26 02:52:00 【xuechanba】
Tutorial links :http://www.taichi-maker.com/homepage/esp8266-nodemcu-iot/iot-tuttorial/mqtt-tutorial/publish-subscribe-unsubscribe-mqtt-msg/
Learn how the client can publish messages 、 Subscribe to topics and unsubscribe from topics

PUBLISH – Release the news



sometimes , A client to MQTT The interval for the server to publish new messages on the topic is long , Maybe a few days or more , under these circumstances , If our client subscribes to a topic , It may take a long time , So in order to solve this problem , Just set up retainFlag This mechanism , When the client sends to the server PUBLISH In the message , If retainFlag Set to ture when , When the client subscribes to a topic , Will immediately receive this set to ture This message of . In other words, ,MQTT The server will retainFlag Set to true Of PUBLISH The message content is saved , The purpose of preservation is whenever , As long as a client subscribes to this topic message , The server will immediately send the subject message to the client .
SUBSCRIBE – Subscribe to topics

SUBACK – Subscription confirmation

UNSUBSCRIBE – Unsubscribe

The following is the practice .
1、 Client connection MQTT Server side 
2、 Client subscription topics chantui


Again , You can click on several topics .
3、 The client sends a message named chantui The theme of the news release

Click on publish after ,


边栏推荐
- [machinetranslation] - Calculation of Bleu value
- 在 R 中创建非线性最小二乘检验
- Camtasia 2022全新版超清录制电脑视频
- 在同花顺网上开户安全吗?如何网上开一个券商账户
- 如何在 ggplot2 中删除网格线(附示例)
- 程序员的八年工资变动,令网友羡慕不已:你一个月顶我一年工资
- 2022-06-25:给定一个正数n, 表示有0~n-1号任务, 给定一个长度为n的数组time,time[i]表示i号任务做完的时间, 给定一个二维数组matrix, matrix[j] = {a,
- Camtasia 2022全新版超清錄制電腦視頻
- 【flask入门系列】flask处理请求和处理响应
- Little p weekly Vol.10
猜你喜欢

Introduction to bloc: detailed explanation of cube

财富自由技能:把自己产品化

学习太极创客 — MQTT(五)发布、订阅和取消订阅

《你不可不知的人性》经典语录

Oracle连接问题以及解决方案

Interviewer: please name four ways to exchange the values of two variables without using third-party variables

Cow sequencing problem

OpenAPI 3.0 specification - Food Guide

How did the thief unlock the password after the iPhone was stolen? After reading the long knowledge

How do I fix the iPhone green screen problem? Try these solutions
随机推荐
数据库查询语句SQL中like、%、-的区别
学习太极创客 — MQTT(四)服务端连接操作
Camtasia 2022 nouvelle vidéo d'ordinateur d'enregistrement ultra - clair
Multi surveyor Gongshu campus Xiao sir_ Page error in Jenkins
使用 AnnotationDbi 转换 R 中的基因名称
High availability in Internet three highs (high concurrency, high performance and high availability)
A high-frequency interview question from a large factory: tell me about the solution of high and low interface idempotence? Solutions are attached.
网上股票开户安全吗?
UTONMOS坚持“藏品、版权”双优原则助力传统文化高质量发展
A few simple ways for programmers to exercise their waist
Interviewer: please name four ways to exchange the values of two variables without using third-party variables
How to check and cancel subscription auto renewal on iPhone or iPad
《你不可不知的人性》经典语录
【图像过滤】基于matlab GUI图像过滤系统【含Matlab源码 1913期】
Google 推荐在 MVVM 架构中使用 Kotlin Flow
Cox regression model
Multi surveyor Gongshu Xiao sir_ The solution of using websocket error reporting under working directory
R 语言降维的 PCA 与自动编码器
100002nd prime
Redis Lua沙盒绕过命令执行(CVE-2022-0543)