GithubHelp home page GithubHelp logo

fujexo / sensor-network Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 2.0 81 KB

Small setup of a little sensor network using Grafana, MQTT, InfluxDB and some ESP8266 with DHT22 sensors

C++ 44.98% Python 54.50% Dockerfile 0.52%
esp8266 mqtt influxdb grafana

sensor-network's Introduction

Travis Badge

Code is WIP!!!

Please see the Wiki for more information

Hardware setup

Wire the DHT22

10kOhm Resistor from VCC to DATA DATA Pin to Pin D4 on a NodeMCU board

   _ _ __ _ _
  |          |
  |  DHT 22  |
  |          |
  ||--|--|--||

VCC DATA NC GND

Flash the code to the sensors

Choose the correct board in platform.ini. Examples are "nodemcu" or "d1_mini". Edit the settings in src/config.h (example in src/config.h.example). Each sensor has to have a distinguished name which has to match in the Grafana .json). Flash the code to the board with the "PlatformIO: Upload" button in the gui or do it via cli with:

platformio run -t upload

Code setup

Create and edit your configuration

  • Clone this repo to /etc/docker/compose/sensor-network
  • cd /etc/docker/compose/sensor-network
  • cp .env.example .env
  • Edit .end to fit your needs

Ports to open if you use a firewall

  • 3000 (Grafana - show graphs) HTTP
  • 1883 (Mosquitto - incoming data) MQTT

Configure Grafana

Login to grafana and the template examples/dht22.jason

Add data source in Grafana (after logging in with the credentials in .env)

Name: DS_SENSORS (has to match the .jason datasource) Type: InfluxDB URL: http://influxdb:8086 Access: proxy Database: same as INFLUX_DABA in .env User: same as INFLUX_USER in .env Password: same as INFLUX_PASS in .env

Tips and Tricks

Systemd

Based on https://gist.github.com/mosquito/b23e1c1e5723a7fd9e6568e5cf91180f

  • ln -s examples/docker-compose.service /etc/systemd/system/[email protected]
  • systemctl daemon-reload
  • systemctl enable docker-compose@sensor-network
  • systemctl start docker-compose@sensor-network

sensor-network's People

Contributors

eni23 avatar fujexo avatar oxivanisher avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

eni23 oxivanisher

sensor-network's Issues

Sensor stops working - No more Data

Sometimes, the sensors stop working.

This issue should be removed when Deep Sleep is implemented, as the ESP will reboot after the sleep cycle

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.