It is currently Wed Oct 21, 2020 7:23 am
All times are UTC + 8 hours

Mosquitto MQTT Broker

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

Mosquitto MQTT Broker

Postby Matt.Steeljaw » Mon Jun 12, 2017 5:24 am

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/
Matt.Steeljaw
 
Posts: 35
Joined: Mon Oct 14, 2013 6:59 pm

Re: Mosquitto MQTT Broker

Postby Suomalainen » Wed Oct 24, 2018 4:50 am

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?
Suomalainen
 
Posts: 2
Joined: Mon Apr 20, 2015 7:07 pm

Re: Mosquitto MQTT Broker

Postby granit » Sat Nov 30, 2019 10:18 pm

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

Postby granit » Sun Dec 01, 2019 1:55 am

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

Postby granit » Sun May 03, 2020 5:59 pm

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 719 times

as6404-2.jpg
as6404-2.jpg (108.66 KiB) Viewed 719 times
granit
 
Posts: 3
Joined: Sat Nov 30, 2019 10:01 pm

Re: Mosquitto MQTT Broker

Postby core » Fri Jun 12, 2020 5:19 pm

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
User avatar
core
 
Posts: 18
Joined: Sat May 16, 2020 5:12 am

Return to Feature Requests

  • You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot post attachments in this forum
  • Who is online

    Users browsing this forum: No registered users and 10 guests

cron