惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
L
LangChain Blog
C
Check Point Blog
博客园 - 【当耐特】
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
美团技术团队
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
S
SegmentFault 最新的问题
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
腾讯CDC
B
Blog
G
Google Developers Blog
The Cloudflare Blog
P
Proofpoint News Feed

博客园 - 广交天下好友

给 IIS 配置 HTTPS maui发布安卓系统 MAUI 运行环境注意事项 MQTT项目应用 网络方面小知识 电脑小知识 Redis操作篇 Modbus 软件安装注册码 wpf 关闭热重载 重装vs2022 nuget添加包报错: Unexpected character encountered while parsing value: �. Path '', line 0, position 0. WPF 踩过的坑 vs2019 未能加载文件或程序集“System.Data.SQLite”或它的某一个依赖项。试图加载格式不正确的程序。 sql 备忘录 Excel 其它操作 护眼颜色调整 练习第一篇 Python Requests使用 第一篇 C#模拟http请求抓取数据 asp.net webService添加头文件验证 好文记录地址 关于邮件发送和邮件附件接收方面 sql 查询时间当前时间少7天 20190729研究和学习篇 C# Timer同步和异步使用 马肯9450命令回传 上海公积金社保业务办理
MQTT
广交天下好友 · 2026-08-22 · via 博客园 - 广交天下好友

Mosquitto 安装

Eclipse Mosquitto版本 去官网下载 Windows 安装包:https://mosquitto.org/download/

下载 mosquitto-2.x.x-install-windows-x64.exe,安装时选择安装为服务(Install as a Windows service)。

image

用管理员运行windows powershell

输入 net start mosquitto 

image

image

# 或  net stop mosquitto 

2. 配置

编辑配置文件 D:\Program Files\Mosquitto\mosquitto.conf

# 监听端口

listener 1883

# 允许匿名连接(开发阶段)

allow_anonymous true

# 如果后续需要账号密码认证:

# allow_anonymous false

# password_file C:\mosquitto\config\pwfile

 # WebSockets 支持(可选,方便前端调试)

listener 9001

protocol websockets

订阅话题

订阅sub = subscribe):
& "D:\Program Files\Mosquitto\mosquitto_sub.exe" -t "test/topic" -v
& "D:\Program Files\Mosquitto\mosquitto_sub.exe" -t "speek/topic" -v

发布话题

发布pub = publish):
& "D:\Program Files\Mosquitto\mosquitto_pub.exe" -t "test/topic" -m "出发"
& "D:\Program Files\Mosquitto\mosquitto_pub.exe" -t "speek/topic" -m "说话了"

区别就在 sub 和 pub 两个字母。记住:sub 收,pub 发

打开两个windows powershell

image

image

image