One needs the Mosquitto library and headers to compile this source. Ubuntu instructions follow.
sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
sudo apt-get update
sudo apt-get install mosquitto-dev
A simple Makefile is included. Just run make
inside the project directory.
- First, start a Mosquitto broker locally (there is no configuration file yet).
mosquitto &
- Then, run a Mosquitto subscriber to test the publisher example.
mosquitto_sub -t topic
- Finally, run the publisher example, which sends
0
's for 10 seconds with 1 second delay to the local Mosquitto broker in thetopic
topic.
./bin/pub