Mosquitto MQTT Broker

Got a feature request? Great! Post your ideas here!

Moderator: Lillian.W@AST

Post Reply
Matt.Steeljaw
Posts: 35
youtube meble na wymiar Warszawa
Joined: Mon Oct 14, 2013 6:59 pm

Mosquitto MQTT Broker

Post by Matt.Steeljaw »

Hi!

I would like to request the mosquitto mqtt broker for asustor 604T.

"Eclipse Mosquitto™ is an open source (EPL/EDL licensed) message broker that implements the MQTT protocol versions 3.1 and 3.1.1. MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model. This makes it suitable for "Internet of Things" messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers like the Arduino."

Source https://mosquitto.org/download/
Suomalainen
Posts: 2
Joined: Mon Apr 20, 2015 7:07 pm

Re: Mosquitto MQTT Broker

Post by Suomalainen »

Hi!
I would be also interested to have MQTT broker on Asustor. It would be a perfect location for MQTT broker in my home network, as Asustor is always on!

Any change to get Mosquitto implemented as an App?
granit
Posts: 3
Joined: Sat Nov 30, 2019 10:01 pm

Re: Mosquitto MQTT Broker

Post by granit »

Hello.
Any news regarding MQTT brokes? Is it possible to install linux distribution on Asustor, like Synology? Due to various issues I've been thinking of throwing my 602t and 6404t out and replacing with serious server with better support. It's only the pain of moving files for days and I'm already used to the interface. After reinstall with new drives I finally got webserver and MariaDB running, and like to connect database with mqtt and tasmota ;)
granit
Posts: 3
Joined: Sat Nov 30, 2019 10:01 pm

Re: Mosquitto MQTT Broker

Post by granit »

Actually, it should be possible to install mosquitto via docker ce app, so can home assistant... Not bad.
If I succeed, I will post an update on this. ;)
granit
Posts: 3
Joined: Sat Nov 30, 2019 10:01 pm

Re: Mosquitto MQTT Broker

Post by granit »

Hi, for some time I have done testing, Asustor works as a charm with Portainer - you have to install containers - I have a setup with mosquitto, influxdb, grafana and node red for home automation, and I am really satisfied.
Dont forget to set proper restart policy so that applications / containers start automatically after power outage or error.
And if you can setup a L2PT vpn on your router (I use mikrotik and unifi) you can access dashboard from outside your home, too!
Thumbs up!
as6404-1.jpg
as6404-1.jpg (172.8 KiB) Viewed 5021 times
as6404-2.jpg
as6404-2.jpg (108.66 KiB) Viewed 5021 times
User avatar
core
Posts: 20
Joined: Sat May 16, 2020 5:12 am

Re: Mosquitto MQTT Broker

Post by core »

After you install Docker-ce from AppCentral, you can get an MQTT broker up and running easily. Below is a script for creating and managing an MQTT container.

mqtt.sh

Code: Select all

#!/bin/sh
#
# manage MQTT
#

NAME=mqtt
MQTT=/volume1/Docker/$NAME
CONFIG=$MQTT/config
MOSQUITTO_CONF=$CONFIG/mosquitto.conf
LOG=$MQTT/log
DATA=$MQTT/data

case "$1" in
  create)
    echo "configure and run MQTT..."
    chown -R root /volume1/Docker
    mkdir -p $CONFIG $LOG $DATA
    touch $MOSQUITTO_CONF
    docker run --name $NAME \
        --restart=always \
        -tid \
        -v $CONFIG:/mqtt/config \
        -v $LOG:/mqtt/log \
        -v $DATA:/mqtt/data \
        -p 1883:1883 -p 8883:8883 \
        toke/mosquitto
    ;;
  start)
    echo "starting MQTT..."
    docker start $NAME
    ;;
  stop)
    echo "stopping MQTT..."
    docker stop $NAME
    ;;
  log)
    echo "MQTT log..."
    docker logs --tail 50 --follow $NAME
    ;;
  shell)
    echo "MQTT shell..."
    docker exec -it $NAME bash
    ;;
  remove)
    echo "remove MQTT..."
    docker rm $NAME
    ;;
  restart)
    "$0" stop
    "$0" start
    ;;
  destroy)
    "$0" stop
    "$0" remove
    ;;
  *)
    echo "Usage: $0 {create|start|stop|log|shell|remove|restart|destroy}"
    exit 1
esac

Code: Select all

./mqtt.sh create
will give you the default configuration which will automatically re-start when the NAS boots. And the other modes will get you started for basic cases. Of course you don't need a script for one line commands, but this brings it all together to remind you of common Docker container tasks.

You may soon realize you want secured encrypted connections and all that good stuff. I figured out how to do that all manually and isolated it into some helper scripts. It isn't that complicated either but there were gotchas in creating certificates: (1) for the subject CN field use your NAS hostname and (2) the -extensions v3_ca option. Eventually, I'd like to learn how to create a proper App Central front end that would help automate that configuration.
AS6208T + AS6004U
Post Reply

Return to “Feature Requests”