Mosquitto installation on centos
1.install tools:
yum install gcc gcc-c++
yum install openssl-devel
yum install c-ares-devel
yum install libuuid-devel
yum install wget
yum install cmake
yum install build-essential quilt devscripts
yum install libssl-dev libc-ares-dev uuid-dev daemon openssl-devel
2.download mosquitto:
wget http://mosquitto.org/files/source/mosquitto-1.6.9.tar.gz
tar -zxvf mosquitto-1.6.9.tar.gz
cd mosquitto-1.6.9
make
make install
vim /etc/mosquitto/mosquitto.conf
user root
port 1883
max_connections -1
allow_anonymous true
port 1883
max_connections -1
allow_anonymous true
save it and to run it.
command is :
mosquitto -c /etc/mosquitto/mosquitto.conf
test it:
mosquitto_sub -v -t sensor_sunny
mosquitto_pub -t sensor_sunny -m 12