您的位置:首页 > 产品设计 > UI/UE

installing mosquitto server and configuring

2013-04-13 16:36 274 查看
This tutorial explains basic steps of installing mosquitto server on openwrt platform. Mosquitto exists in openwrt barrier breaker repository but I decided to crosscompile it. At host computer in openwrt directory call :
uros-petrevski-2:bin uros$ ./scripts/feeds install mosquitto-nossl


This will install version that don’t support ssl layer because we don’t need it. We need server that is fast. Run make menuconfig and under Network select mosquitto nossl as M package.
uros-petrevski-2:bin uros$ make J=4


Then copy mosquitto package to weio. Mosquitto don’t have any dependencies.
uros-petrevski-2:packages uros$ scp /Volumes/openwrt/carambola/bin/ramips/packages/mosquitto-nossl_1.0.3-1_ramips.ipk root@weio.local:/tmp


Now it’s time to install mosquitto
root@Weio:/tmp# opkg install mosquitto-nossl_1.0.3-1_ramips.ipk -d root


If you run mosquitto now it will break :

root@Weio:/tmp# mosquitto
11145: Error: Invalid user 'mosquitto'.


The reason is simple, user is not configured. As user is root we have to declare root user un mosquitto configuration. So edit /etc/mosquitto/mosquitto.conf file and add at user section
user root


If you want to run manually mosquitto (you can see what is happening with clients on the console) you have to do :
root@Weio:/# mosquitto -c /etc/mosquitto/mosquitto.conf


Parameter -c specify path to conf file. However if you want to run automaticaly on startup mosquitto server do following
root@Weio:/# /etc/init.d/mosquitto enable


Once system rebooted you can see mosquitto server running by :
root@Weio:/# ps | grep mosquitto

2570 root       932 S    /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

2574 root      1488 S    grep mosquitto
 http://blog.csdn.net/qiaofeiw/article/details/8760340
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: