apt-get update
apt-get install mosquitto
apt-get install mosquitto mosquitto-clients
log_type error
log_type warning
log_type notice
log_type information
connection_messages true
log_timestamp true
include_dir /etc/mosquitto/conf.d
root@raspberrypi:~# /etc/init.d/mosquitto start
[ ok ] Starting mosquitto (via systemctl): mosquitto.service.
Open up two more terminal windows.
In Terminal window 1 type:
mosquitto_sub -d -t hello/world
n Terminal window 2 type: mosquitto_pub -d -t hello/world -m "Hello from Terminal window 2!"
请教一下,mosquitto的配置文件怎么设置可以改 端口和IP? 我现在是 如下图的IP,造成用访问主机IP地址无法连接服务器.
netstat -ntulp |grep 1883
我试过在 mosquitto.conf中加入listener 1883 0.0.0.0 没效果啊
listener 1883
allow_anonymous true