Cylon.js For MQTT
Cylon.js (http://cylonjs.com) is a JavaScript framework for robotics, physical computing, and the Internet of Things (IoT).
This repository contains the Cylon.js adaptor/driver for the MQTT messaging protocol. It uses the MQTT.js node module (https://github.com/adamvr/MQTT.js) created by @adamvr and @mcollina, thank you!
Want to use Ruby on robots? Check out our sister project Artoo (http://artoo.io)
Want to use the Go programming language to power your robots? Check out our sister project Gobot (http://gobot.io).
How to Install
Install cylon-mqtt
through NPM:
$ npm install cylon cylon-mqtt
Before using cylon-mqtt
, you'll need to have a MQTT broker running in order to connect/publish/subscribe to messages.
A good, simple broker is mosca. The developers have a tutorial on using Mosca as a standalone service.
How to Use
There's two different ways to use the cylon-mqtt
module.
You can use the connection object only, in which case you have pub/sub access to all available MQTT channels:
Cylon;
Or, you can use the device object, which restricts your interaction to a single MQTT channel. This can make it easier to keep track of different channels.
Cylon
Simple
var Cylon = ; Cylonstart;
Arduino Blink
var Cylon = ; Cylonstart;
For more examples, please see the examples
folder.
How to Connect
var Cylon = ; Cylonstart;
Authentication
mqtt: { adaptor: "mqtt", host: "mqtt://localhost:1883",
username: "iamuser", password: "sosecure" },
Documentation
We're busy adding documentation to cylonjs.com. Please check there as we continue to work on Cylon.js.
Thank you!
Contributing
For our contribution guidelines, please go to https://github.com/hybridgroup/cylon/blob/master/CONTRIBUTING.md .
Release History
For the release history, please go to https://github.com/hybridgroup/cylon-mqtt/blob/master/RELEASES.md .
License
Copyright (c) 2014-2016 The Hybrid Group. Licensed under the Apache 2.0 license.