Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 721 Bytes

README.md

File metadata and controls

39 lines (30 loc) · 721 Bytes

mqtt-mongo-recorder

This NodeJS application listens to MQTT messages and records them to MongoDB

Example

Clone the repository

$ git clone https://github.com/dennisdegreef/mqtt-mongo-recorder.git
$ cd mqtt-mongo-recorder
$ npm install

Start up the server by editing the config.js first to suit your needs

$ $EDITOR config.js
$ node server.js

Or by using environment variables

$ MQTT_HOSTNAME="192.168.0.1" node server.js

Publish some MQTT messages to try it out (I use mosquitto server for this, but whatever MQTT server should work)

$ mosquitto_pub -m "bar" -t "foo"

Let's see what's in here

$ mongo
> use mqtt
> db.message.find();