From aoxoaWiki
Jump to navigationJump to search


Just some notes for now

Eclipse Mosquitto

run broker software on a computer: say


  mosquitto_pub -d -t msg/box -m "hello world"

Remotely - Subscribe:

  mosquitto_sub -h -d -t msg/box

Remotely - Publish:

  mosquitto_pub -h -d -t msg/box -m "hello from remote"

can name msg/box whatever you want (but needs to use same name to communicate with each other)

some useful info here:

also here

Debugging - subscribe to all channels on a server

  mosquitto_sub -v -t '#'

Debugging Connections Etc

Edit the mosquitto.conf file and set up debugging level (all for everything) and logging destinations. Then restart the mosquitto server. If you log to 'topic' then you can subscribe to the $SYS/# topic to view logging output elsewhere (not so sure about this last statement)

  vi /etc/mosquitto/mosquitto.conf
  log_type all
  log_dest stdout
  log_dest topic

  mosquitto -c /etc/mosquitto/mosquitto.conf &

Install Mosquitto on Raspberry Pi


  sudo wget
  sudo apt-key add mosquitto-repo.gpg.key
  cd /etc/apt/sources.list.d/
  sudo wget
  sudo apt-get update
  sudo apt-get install mosquitto mosquitto-clients
  sudo /etc/init.d/mosquitto stop

If we are going to link C or C++ code to Mosquitto, we need the development libraries

  sudo apt-get install libmosquitto-dev libmosquittopp-dev

Back to Main Page . .