How to install Mosquitto on the RaspberryPi
Download the latest tar from http://mosquitto.org/download currently mosquitto-0.15.tar.gz
The following instructions are for the Debian install
- sudo apt-get install libwrap0-dev
- tar zxf mosquitto-0.15.tar.gz
- cd mosquitto-0.15
- make
- sudo make install
- sudo ldconfig
Install Instruction Source
And while your waiting for it to install, get the MQTT Library for your Arduino!
HumpA
Humpa:i cannot compile the mosquitto source code as i get the following after make command:
pi@raspberrypi:/usr/nas_upnp/ROBERTO/mosquitto-0.15$ make
for d in lib client src man; do make -C ${d}; done
make[1]: Entering directory `/usr/nas_upnp/ROBERTO/mosquitto-0.15/lib’
gcc -I. -I.. -ggdb -Wall -O2 -I../lib -fPIC -c mosquitto.c -o mosquitto.o
cc1: error: .: Value too large for defined data type
cc1: error: ..: Value too large for defined data type
cc1: error: ../lib: Value too large for defined data type
cc1: error: mosquitto.c: Value too large for defined data type
make[1]: *** [mosquitto.o] Error 1
make[1]: Leaving directory `/usr/nas_upnp/ROBERTO/mosquitto-0.15/lib’
make[1]: Entering directory `/usr/nas_upnp/ROBERTO/mosquitto-0.15/client’
cc -I../lib -Wall -ggdb -c -o pub_client.o pub_client.c
cc1: error: ../lib: Value too large for defined data type
cc1: error: pub_client.c: Value too large for defined data type
make[1]: *** [pub_client.o] Error 1
make[1]: Leaving directory `/usr/nas_upnp/ROBERTO/mosquitto-0.15/client’
make[1]: Entering directory `/usr/nas_upnp/ROBERTO/mosquitto-0.15/src’
gcc -I. -I.. -ggdb -Wall -O2 -I../lib -I. -DVERSION=”\”0.15\”" -DTIMESTAMP=”\”2012-06-10 21:49:28+0200\”" -DWITH_BROKER -c mosquitto.c -o mosquitto.o
cc1: error: .: Value too large for defined data type
cc1: error: ..: Value too large for defined data type
cc1: error: ../lib: Value too large for defined data type
cc1: error: .: Value too large for defined data type
cc1: error: mosquitto.c: Value too large for defined data type
make[1]: *** [mosquitto.o] Error 1
make[1]: Leaving directory `/usr/nas_upnp/ROBERTO/mosquitto-0.15/src’
make[1]: Entering directory `/usr/nas_upnp/ROBERTO/mosquitto-0.15/man’
make[1]: Nothing to be done for `all’.
make[1]: Leaving directory `/usr/nas_upnp/ROBERTO/mosquitto-0.15/man’
pi@raspberrypi:/usr/nas_upnp/ROBERTO/mosquitto-0.15$
Hello Roberto,
It looks like you are trying to MAKE from a network location, I suggest you copy mosquitto-0.15 to /home/pi and try again… I think that will solve your problem.
Cheers
HumpA
Thanks a lot. I did’nt even know it is not possible to compile on a mounted remote device …
I started mosquito but when i try moquitto_pub client i get this error
pi@raspberrypi:~/mosquitto-0.15/client$ ./mosquitto_sub -d -l
./mosquitto_sub: error while loading shared libraries: libmosquitto.so.0: cannot open shared object file: No such file or directory
the same error also without parameters
Sorry sorry.
Of course it was a question of PATH /usr/lib include …
Thanks again
Cool glad you worked it out! Good luck with your project
trying to install mosquitto on my Raspberry Pi….I got it, but I had to disable TLS-PSK in the configs (which is fine for now) – anybody know of a good ssl package for the Pi if I decide to recompile ?
btw, instructions above for the Pi were perfect (other than the error for no ssl) – thanks !
–Matt