windows下搭建MQTT服务器


一、下载mosquitto

点击下载安装程序 下载地址

windows下搭建MQTT服务器

 

 

二、配置mosquitto

1. 安装路径打开命令行界面

windows下搭建MQTT服务器

 

 

2. 设置user及password

执行:mosquitto_passwd.exe -c pwfile.example -u vic
设置用户名:vic      设置密码:123456

windows下搭建MQTT服务器

 

 

3. 配置文件检查

mosquitto.exe -c mosquitto.conf 
    未报错说明配置正常

4. 设置端口

默认端口:1883
    启动:mosquitto.exe
    指定端口启动:mosquitto.exe -p 10086

5. 订阅者

mosquitto_sub.exe -h 127.0.0.1 -p 10086 -t topicTest01 -u vic -P 123456

6. 发布者

mosquitto_pub.exe -h 127.0.0.1 -p 10086 -u admin -P 111 -t topicTest01 -m “hello world”

7. 命令行测试

windows下搭建MQTT服务器

三、MQTTX

1. 连接服务器

windows下搭建MQTT服务器

 

 

2. 订阅topic

windows下搭建MQTT服务器

 

 

3. 发布消息

windows下搭建MQTT服务器

 

原创文章,作者:3628473679,如若转载,请注明出处:https://blog.ytso.com/269688.html

(0)
上一篇 2022年6月22日
下一篇 2022年6月22日

相关推荐

发表回复

登录后才能评论