Skip to content

Node.js accessory code that receives mqtt data and stores it in influxdb data buckets.

Notifications You must be signed in to change notification settings

astianmuchui/mqtt-influx-streamer-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MQTT TO INFLUXDB STREAMING

Node.js accessory code that receives mqtt data and stores it in influxdb data buckets.

Usage

First, create a .env file in your project from the .env.sample provided above then populate the variables

cp .env.sample .env

The general usage is as follows

import Streamer from "path/to/main.js"

const my_mqtt_config = {
    url: process.env.BROKER_URL,
    username: process.env.MQTT_USERNAME,
    password: process.env.MQTT_PASSWORD,
    topic: process.env.MQTT_TOPIC
};

const my_influx_config = {
    token: process.env.INFLUXDB_TOKEN,
    url: process.env.INFLUX_URL,
    org: 'my_org',
    bucket: 'my_bucket'
};

const measurement = 'some_measurement';
const tags = ['tag1', 'tag2', 'tag3'];
const fields = ['field1', 'field2', 'field3'];

const streamer = new Streamer(my_mqtt_config, my_influx_config, measurement, tags, fields);

About

Node.js accessory code that receives mqtt data and stores it in influxdb data buckets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published