# sensorhub-mqtt-server

> A MQTT-broker with wildcard support built for VAC Thuistechnologie

Latest version **0.2.2** (published 2014-08-04) · GPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install sensorhub-mqtt-server
pnpm add sensorhub-mqtt-server
yarn add sensorhub-mqtt-server
bun add sensorhub-mqtt-server
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2014-08-04 |
| First published | 2014-08-04 |
| Weekly downloads | 0 |
| License | GPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Tom de Boer |
| Maintainers | tomdeboer |

## Links

- npm: https://www.npmjs.com/package/sensorhub-mqtt-server
- Repository: https://github.com/tomdeboer/sensorhub-mqtt-server
- Issues: https://github.com/tomdeboer/sensorhub-mqtt-server/issues
- npm.io page: https://npm.io/package/sensorhub-mqtt-server

## Dependencies (3)

- [mqtt](https://npm.io/package/mqtt.md) 0.3.x
- [colors](https://npm.io/package/colors.md) 0.6.x
- [wildemitter](https://npm.io/package/wildemitter.md) 1.x

## Recent versions

- 0.2.2 (latest) — 2014-08-04
- 0.2.1 — 2014-08-04
- 0.2.0 — 2014-08-04

## README

Sensorhub server
====

This is the sensorhub server. In short, it's a MQTT broker. In full, it's a message router with authentication, retain and wildcard support.

The server is part of the sensorhub project at [VAC Thuistechnologie](http://vacbv.nl). The goal of this project is to provide an easy to use, platform independent system for connecting sensors and applications using the lightweight MQTT protocol. Other applications include a websocket bridge, a Philips Hue bridge, a Kadex bridge, a Plugwise bridge and many more. Adding your own is easy and we encourage you to do so.

### Usage
The server is meant to be used as a standalone application. It's therefore not recommended to run it as a node module.

To start the server, simply install the application (using git clone or download as a zip) and running:

	npm start

After the server is started, clients can subscribe and publish messaged like they normally would on a MQTT system. A client on this server can, however, use wildcard to subcribe to messages like so:

	// Subscribe to all topics ending with temperature using a wildcard
	mqttclientlibrary.subscribe("*/temperature");

The client will now be notified of all topics ending with `/temperature`, like `/vac/office/temperature` for example. The content of this message, the payload, is defined by the user; it can be a string, a number or any else, like binary buffer.

### Configuration
On start up, the server will look for two configuration files in the application's root directory. The first is the (obligatory) `config_defaults.json` file. Seconf is the user's `config.json` file. 

The `config_defaults.json` file contains all the default parameters the server needs to start up. Using only the default configuration, the server is fully functional. The defaults file looks like this:

	{
	    "ip"  : "0.0.0.0",
	    "port": 1883,
	    "users": {
	    	"username":"password"
	    }
	}


After loading the default configuration, the server will try and read the `config.json` file, also located in the root folder. The keys in this file will override the ones from de default configuration.


_**Note**: the `config.json` file is ignored by git, so creating or changing the `config.json` file won't show up as a change in the git repository. This is by intention of course, so you can freely change your config file._

##### Authentication

At this point, the server authenticates users via the `config.json` file, where users and passwords are stored using a user-password key-value object. At some point later in time, more advanced authentication methods will be made available.

---
_Source: https://npm.io/package/sensorhub-mqtt-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
