Nodeschool Public Materials
Publish your own packages to the world's most popular software ecosystem with npm Pro.Get started »


0.7.7 • Public • Published

LWMQN Network

mqtt-shepherd is a network server and manager for the lightweight MQTT machine network (LWMQN)

Greenkeeper badge NPM version NPM downloads Travis branch Coverage Status Gitter js-standard-style pr-welcoming-image

What is LWMQN

Lightweight MQTT machine network (LWMQN) is an open source project that follows part of OMA LWM2M v1.0 specification to meet the minimum requirements of machine network management.

Server-side and Client-side Libraries:

  • LWMQN project provides you with this machine-side mqtt-node library and a server-side mqtt-shepherd library to build your machine network with JavaScript and node.js easily.


  • Communication based on MQTT protocol and Mosca broker.
  • Embedded persistence (NeDB) and auto-reloads Client Devices at boot-up.
  • Build your IoT network with or without cloud services.
  • LWM2M-like interfaces for Client/Server interaction.
  • Hierarchical Smart Object data model (IPSO), which leads to a comprehensive and consistent way in describing real-world gadgets.
  • Easy to query resources on a Client Device with the URI-style path, and everything has been well-organized to ease the pain for you to create RPC interfaces for your webapps, such as RESTful and websocket-based APIs.
  • LWMQN Server is your local machine gateway and application runner. But if you like to let your machines go up cloud, why not? It's node.js!

Acronyms and Abbreviations

  • Server: LWMQN server
  • Client or Client Device: LWMQN client (machine)
  • MqttShepherd: Class exposed by require('mqtt-shepherd')
  • MqttNode: Class to create a software endpoint(proxy) of a remote Client Device on the server
  • qserver: Instance of MqttShepherd Class
  • qnode: Instance of MqttNode Class


Currently Node.js 8.x LTS or higher is required.

$ npm install mqtt-shepherd

Basic Usage

var MqttShepherd = require('mqtt-shepherd');
var qserver = new MqttShepherd();   // create a LWMQN server
qserver.on('ready', function () {
    console.log('Server is ready.');
    // when server is ready, allow devices to join the network within 180 secs
qserver.start(function (err) {      // start the sever
    if (err)
// That's all to start a LWMQN server.
// Now qserver is going to automatically tackle most of the network managing things.



Licensed under MIT.




npm i mqtt-shepherd

DownloadsWeekly Downloads






Unpacked Size

206 kB

Total Files


Last publish


  • avatar
  • avatar