Git Product home page Git Product logo

iot-center-v2's Introduction

IoT Center v2

This repository contains the IoT Center application that provides a web UI that shows how to use InfluxDB v2 in various use cases. It also contains independent clients that write into InfluxDB.

Features

  • simple device management, automatic registration of devices in InfluxDB
  • arduino, pyton, javasript clients
  • various data visualizations, dashboards

Quick Start

  • Prerequisites
    • node 14 or newer
    • yarn 1.9.4 or newer

Run IoT Center Application

From Source

cd app
yarn install
yarn build
yarn start
open http://localhost:5000

or

docker-compose up
open http://localhost:5000

Docker

Docker images are available on GitHub Packages with nightly tag:

docker pull ghcr.io/bonitoo-io/iot-center-v2/iot-center:nightly

docker run \
  --name iot-center \
  --detach \
  --env INFLUX_URL=http://10.100.10.100:9999 \
  --env INFLUX_TOKEN=my-token \
  --env INFLUX_ORG=my-org \
  --publish 5000:5000 \
  ghcr.io/bonitoo-io/iot-center-v2/iot-center:nightly

Develop and Play with IoT Center Application (hot-swap enabled)

cd app
yarn install
yarn dev

Realtime demo

Only mqtt (locally)

each line in separate terminal, no environment variables has to be set:

cd app/server/mqtt/docker-mosquitto && ./run_mqtt_server.sh
cd app/server && yarn mqtt_dev
cd app/ui && yarn start

Application is running at http://localhost:3000/realtime

Mqtt can be checked with

cd app/server && yarn mqtt_subscriber

Websocket broker (ui side connection) can be checked with

cd app/server && yarn mqtt_subscriber_broker

mqtt with influx

setup

Register account in InfluxDB Cloud 2 if not exists or install local InfluxDB 2 instance

Edit app/dev.sh and set environment values INFLUX_TOKEN, INFLUX_URL, INFLUX_ORG and uncomment MQTT_TOPIC, MQTT_URL (MQTT_URL can't be localhost or 127.0.0.1 to run with real devices)

Install telegraf and copy example configuration:

cd app/server/mqtt
cp -n telegraf.example.conf telegraf.conf

Edit telegraf.conf and set urls, token, organization under [[outputs.influxdb_v2]] and servers, iot_center under [[inputs.mqtt_consumer]] (to be same as in app/dev.sh):

nano telegraf.conf
Run everything

Have MQTT Running public or run locally with command:

cd app/server/mqtt/docker-mosquitto && ./run_mqtt_server.sh

Start telgraf:

cd app/server/mqtt && telegraf --config telegraf.conf

Start app:

cd app && ./dev.sh

Mqtt can be checked with:

cd app/server && yarn mqtt_subscriber

Open browser at http://localhost:3000/realtime:

xdg-open http://localhost:3000/realtime

Environment Installation

  • Install latest node.js
  • Install latest yarn
  • Download this GIT repository
  • Install local InfluxDB 2 instance or register account in InfluxDB Cloud 2 if not exists
  • Create admin token
  • Set environment variable INFLUX_TOKEN with the admin token from the previous point
  • Set environment variable INFLUX_URL (do not use localhost or 127.0.0.1 - IoT Devices need external address)
  • Set environment variable INFLUX_ORG
  • Run IoT Center

License

The project is under the MIT License.

iot-center-v2's People

Contributors

sranka avatar sciator avatar devmirek avatar bednar avatar ivankudibal avatar jstirnaman avatar pierwill avatar vlastahajek avatar

Watchers

James Cloos avatar

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.