Using MQTT with Meteor

There are a lot of options when using MQTT brokers in conjunction with Meteor. This article lists the pros and cons of various approaches. It assumes a basic background in Meteor and MQTT. If you don't have that http://www.meteor.com has some great tutorials, and https://github.com/mqtt/mqtt.github.io/wiki has a good background on MQTT.

Introduction

My recent talk to the Meteor London Meetup showed me how much interest there is in combining Meteor with the Internet of Things. MQTT seems be gaining a lot of support as a transport between IoT motes and the wider Internet.
Accordingly, I've started to publish a set of packages on Atmosphere, the Meteor package repository, for accessing MQTT via Meteor. However, you need to put the packages together in the right order to get the benefit, so I'm writing this article to illustrate how to use them in concert.

The Cast List

So far, I've released the following Meteor packages for MQTT.

Meteor Package Npm Package Usage
mkarliner:mqtt mqtt.js MQTT client package
mkarliner:mosca mosca MQTT broker
mkarliner:mqtt-regex mqtt-regex

Connecting to a MQTT broker.