Skip to content
No description, website, or topics provided.
Python Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
mqtt-influxdb
mqtt-mongodb
mqtt-redis
rest-mongodb
.gitignore
README.md

README.md

Store metrics from EdgeX Foundry in DBs

Subscribe MQTT topic and then store in InfluxDB Cloud

The docker image build with mqtt-influxdb/docker/Dockerfile does:

  1. Store values in InfluxDB using Telegraf with MQTT Consumer.

The prebuilt image available on Docker Hub kurokobo/edgex-lab-telegraf.

But most cases you have to replace telegraf.conf with your own configuration because currently PWS does not support external volumes.

To run this on PWS, update your telegraf.conf and vars.yml, then invoke followings:

$ cd mqtt-influxdb/docker
$ docker build . -t <username>/edgex-lab-telegraf:1.13.0
$ docker push k<username>/edgex-lab-telegraf:1.13.0
$ cd ../
$ cf push --vars-file vars.yml 

To run this locally, update your telegraf.conf and .env, then invoke followings:

$ cd mqtt-influxdb/docker
$ docker build . -t <username>/edgex-lab-telegraf:1.13.0
$ docker run -d --env-file ../.env edgex-lab-telegraf:1.13.0

Subscribe MQTT topic and then store in MongoDB

The python application mqtt-mongodb/rest_to_mongodb.py does:

  1. Subscribe specified MQTT broker and its topic.
  2. Store incoming values in specified MongoDB.

To run this on PWS, update your vars.yml and invoke followings:

$ cd mqtt-mongodb
$ cf push --vars-file vars.yml 

To run this locally, update your .env and invoke followings:

$ cd mqtt-mongodb
$ python mqtt_to_mongodb.py

Listen as REST endpoint and then store in MongoDB

The python application rest-mongodb/rest_to_mongodb.py does:

  1. Wait HTTP POST using Flask.
  2. Store POSTed values in specified MongoDB.

To run this on PWS, update your vars.yml and invoke followings:

$ cd rest-mongodb
$ cf push --vars-file vars.yml 

To run this locally, update your .env and invoke followings:

$ cd rest-mongodb
$ python rest_to_mongodb.py

Subscribe MQTT topic and then store in Redis

The python application mqtt-redis/rest_to_redis.py does:

  1. Subscribe specified MQTT broker and its topic.
  2. Store incoming values in specified MongoDB.

Prease note this application store only newest value of each sensor types. This behavior is completely different from other mqtt-* series in this repository.

To run this on PWS, update your vars.yml and invoke followings:

$ cd mqtt-redis
$ cf push --vars-file vars.yml 

To run this locally, update your .env and invoke followings:

$ cd mqtt-redis
$ python mqtt_to_redis.py
You can’t perform that action at this time.