installing mosquitto server and configuring

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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值