npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sensorhub-mqtt-server

v0.2.2

Published

A MQTT-broker with wildcard support built for VAC Thuistechnologie

Downloads

6

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. 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.