Skip to content

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

License

Notifications You must be signed in to change notification settings

dennisdegreef/mqtt-mongo-recorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published