Installing MQTT Broker(Mosquitto) and Pi-Hole on AML-S905X-CC (Le Potato)

by suriono in Circuits > Raspberry Pi

100 Views, 0 Favorites, 0 Comments

Installing MQTT Broker(Mosquitto) and Pi-Hole on AML-S905X-CC (Le Potato)

Screenshot 2025-02-17 214316.png

This guide demonstrates how to install MQTT and Pi-Hole on a Debian-based AML-S905X-CC (Le Potato) single-board computer.


MQTT can be installed on other operating systems like Debian Raspberry Pi, Ubuntu, macOS, and Windows, but this guide focuses on the Le Potato.


MQTT resources: mqtt.org

Install Pi-Hole

Use this link below to install Pi-Hole on AML-S905X-CC (Le Potato)


SSH to the Pi-Hole

terminal-window.png
  1. Obtain the IP address of the Pi-Hole, in my case it is 192.168.0.122.
  2. Open a command or a terminal window from any computer in the house with a connection to the home network.
  3. ssh to the Pi-Hole IP address, in my case:
  4. ssh <username>@192.168.0.122, where <username> is the username of the Pi-Hole, and 192.168.0.122 is an example IP address of my Pi-Hole.
  5. When prompt: "Are you sure you want to continue connecting (yes/no/[fingerprint])?", type "yes"
  6. When prompt for password, enter the password to the Pi-Hole.
  7. Run the following lines on the terminal window:
  8. sudo apt update && sudo apt upgrade
  9. sudo apt install -y mosquitto mosquito-clients
  10. sudo systemctl enable mosquitto.service
  11. sudo mosquitto_passwd -c /etc/mosquitto/passwd <MQTT USERNAME>
  12. Assign a new < MQTT USERNAME>, this the username for MQTT projects.
  13. When prompt for a password, enter a new MQTT password for MQTT projects.
  14. Edit the /etc/mosquitto/mosquitto.conf file:
  15. Add the following line at the top of the file:
  16. per_listener_settings true
  17. Add the following lines at the bottom of the file:
  18. allow_anonymous false
  19. listener 1883
  20. password_file /etc/mosquito/passwd
  21. Run the following lines on the terminal window:
  22. sudo systemctl restart mosquito

Now the Pi-Hole server also serves as the home MQTT Broker server, which both are lightweights.

Remember the IP address, MQTT username, and MQTT password. They will be used for all MQTT projects.

MQTT Internet Access

To allow your MQTT Broker server accessible via internet, the Port Forwarding needs to be enable:

  1. Go to your router settings.
  2. Go to the Internet section to find your home IP address or obtained from https://whatismyipaddress.com/
  3. Go to the Port Forwarding, more likely inside the NAT Forwarding section.
  4. Use step no. 2 to enter the Port Forwarding IP address
  5. Set the service name to MQTT
  6. Set the external Port to 1883
  7. Set the internal Port to 1883
  8. Set the Protocol to TCP
  9. Check the Enable this entry if this checkbox is available
  10. Click Save.

Now you can access your home MQTT Broker server from the internet using the IP address from the step no.2 with port number 1883.

MQTT Projects

Explore my MQTT projects, or browse other MQTT projects online.