使用mosquitto搭建MQTT服务器环境

参考Windows下搭建MQTT服务器

  1. 下载安装mosquitto
  1. 配置
mosquitto_passwd.exe -c d:/pwfile.example admin

mosquitto_sub.exe -h 127.0.0.1 -p 7788 -u admin -P 123456 -v -t sensor
mosquitto_pub.exe -h 127.0.0.1 -p 7788 -u admin -P 123456 -t sensor -m "消息测试"

  1. 测试运行
    3cdb900ef8c4227e49a17e4f3e44b881

  2. 可视化MQTT客户端工具
    MQTTX下载地址

  • 创建连接
    image

  • 订阅主体消息
    image

  • 监听消息测试
    image

posted @ 2026-09-01 11:23  windlog  阅读(7)  评论(0)    收藏  举报