Skip to content

MQTT services

Julian Todd edited this page Jun 24, 2019 · 17 revisions

MQTT is a lightweight publish/subscribe messaging protocol applicable to many scenarios such as controlling and monitoring all the equipment in the space.

  • See Sonoff switches for MQTT controlled mains power monitors and switches.
  • See ESP devices for accounts of the ESP8266 and ESP32s in operation

MQTT Broker

There is an MQTT broker running on the RaspberryPi wired into the network in the main room with the DNS name "mqtt.local" and set up from ballina.

It can also be accessed through its own hotspot "DoESLiverpool-MQTT" and stable ip-number "". If you connect your wifi-enabled MQTT devices to this network then they can be taken elsewhere (with a copy of the MQTT-broker) for demonstration purposes. However, for local infrastructure, connections to the main "DoESLiverpool" wifi is preferred


At present the node-red instance is also on the same Rpi with an official 7inch touchscreen capable of showing a small dashboard with multiple tabs that you can swipe between.

You can log on to the Node-red screen using http://mqtt.local:1880 or preview the dashboard at http://mqtt.local:1880/ui which shows on the touchscreen display.

We expect to move the node-red flow system to a different Rpi with its own databases and backups of flows, for the sake of reliability.

Doing MQTT from the command line

Install mosquitto and then try the following commands:

To see all messages, type: mosquitto_sub -v --host mqtt.local --topic '#' (sometimes you need mqtt.localdomain)

To publish a message, type: mosquitto_pub --host mqtt.local --topic this/that/777 -m "Hooray"

Mains controlled devices

See Sonoff switches.

Other MQTT devices

MQTT to voice device

like at:

Galvo level

Also looks like a coffee level pointer. (Currently on loan.)


These don't yet have any MQTT responses, but should do, so we can plot them.

Video analysing devices

We have the tech to convert live stream to data (eg using a camera looking at the coffee pot). This needs to be rebuilt.

Old provisioning of the Rpi (before using ballina technology)

See also

* Install raspbian and update, plugged into ethernet

* sudo raspi-config (to enable ssh and change hostname)

* ifconfig to get the ip number

* from:

* sudo apt-get install mosquitto mosquitto-clients

* sudo apt-get install nodejs

* sudo apt-get install nodered

* sudo node-red  (makes it run prior to reboot)

* sudo systemctl enable nodered.service

* sudo npm i -g npm@2.x

* In localhost:1880 nodered menu manage pallette install, look for dashboard

* sudo apt-get install avahi-daemon

* sudo nano /etc/hosts; change to host name "mqtt"

Install hotspot installer:
* wget -q -O /tmp/raspap && bash /tmp/raspap

* Connect to wifiname=raspi-webgui password=ChangeMe, then Username: admin, password: secret

* Change so that wifiname=mqtt-wifi, password=bubblino; and Auth is admin, arduino

* node-red at
Clone this wiki locally
You can’t perform that action at this time.