MQTT on QNAP via Moquette

Message Queuing Telemetry Transport (MQTT) is a lightweight pub/sub messaging protocol designed for minimal bandwidth and device resource requirements. This makes it ideal for IoT projects, where you generally have limited processing power and memory space (read more about MQTT).

There are several MQTT broker/server implementations out there (hopefully exhaustive list), however most of then cannot be ran on my QNAP TS221 Network Attached Storage because it uses a custom version of Linux and it is run by an ARM processor.

On the other hand, Moquette is a MQTT broker written in Java, so I gave it a try.

  1. Install the Java Runtime Environment for ARM – for some reason I could not find it in the App Center, so I had to download the package from here (dead link) and install it via the Install Manually button.
  2. SSH into the QNAP (guide)
  3. Follow the steps listed in the Moquette repo
    1. wget https://bintray.com/artifact/download/andsel/generic/distribution-0.8-bundle-tar.tar.gz –no-check-certificate
    2. tar xvfz distribution-0.8-bundle-tar.tar.gz
    3. By default Moquette uses port 8080 for WebSocket which is also used by the QNAP administration interface, so I changed the Moquette port to 9090 by navigating to /config and setting websocket_port to 9090 in moquette.conf
    4. navigate to /bin and run moquette.sh
  4. By now you should have a working MQTT broker, you can test it with this online tool.
  5. Optionally you can configure your moquette.sh to be run at startup

4 comments on “MQTT on QNAP via Moquette

  1. moosila August 8, 2018 02:13

    You are the best, I’m a newbie to all these… but your article was very neat and clear. I got it run first shot. Thanks a lot. Appreciate your time spent on this…

  2. moosila1 August 8, 2018 02:14

    You are the best, I’m a newbie to all these… but your article was very neat and clear. I got it run first shot. Thanks a lot. Appreciate your time spent on this…

  3. BestMyrtis August 16, 2018 04:21

    I have noticed you don’t monetize your website, don’t waste your traffic,
    you can earn extra bucks every month. You can use the best adsense alternative for any
    type of website (they approve all websites), for more info simply search in gooogle:
    boorfe’s tips monetize your website

  4. Ty September 21, 2019 23:25

    Where exactly is this file that I need to edit? I connect to my qnap via SSH & can’t find it.
    Thanks!

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>