https://github.com/mqtt/mqtt.github.io/wiki/libraries?spm=a2c4g.11186623.2.5.5YAnRSgit
https://mosquitto.org/
make & make install
github
adduser mosquitto
mosquitto -c /etc/mosquitto/test.conf -d mosquitto_passwd -b /etc/mosquitto/test.pwfile dev1 123 mosquitto_passwd -b /etc/mosquitto/test.pwfile admin 123 mosquitto_passwd -b /etc/mosquitto/test.pwfile mqtt_server 123 mosquitto_sub -u admin -P 123 -d -t 'device/#' mosquitto_pub -u dev1 -P 123 -d -t 'device/dev1/report_info' -m 'xxx' -r 保留retained
retained保留消息
broker保存最后一次topic的保留消息,每当有客户端订阅这个topic,都会收到保留消息
删除保留消息:
方式1:发送空消息体的保留消息;
方式2:发送最新的保留消息覆盖以前的(推荐);网络
增长用户 mosquitto_passwd -b /etc/mosquitto/test.pwfile 11010611100000000008 ryrnog
app
删除用户 mosquitto_passwd -D /etc/mosquitto/test.pwfile 11010611100000000008
oop
从新load
kill -1 $pid
发送SIGHUP信号,让mosquitto从新load confui
mosquittoconf
log_dest file /var/log/mosquitto/mosquitto.log
出现Unable to open log file /var/log/mosquitto/mosquitto.log for writing问题
chmod 777 /var/log/mosquitto/code
https://github.com/mgdm/Mosquitto-PHPserver
pecl install Mosquitto-alpha /usr/local/php/etc/php.ini extension=mosquitto.so