IoT Center: introduction

(The IoT Center application)

 

The Iot Center application manages IoT devices that write data into InfluxDB. IoT Center shows connected devices and measured values from InfluxDB in custom dashboards. It is designed to demonstrate one possible application architecture for a web app using InfluxDB and IoT clients.

Each IoT device measures temperature. Depending on the connected sensors, it can provide additional measurements like humidity, pressure, and CO2 concentration. Each device can either provide static GPS coordinates or actual coordinates from a connected GPS module.

Reading the source code

The IoT Center is designed for demonstration purposes with this guide in mind. To improve readability of the source code, features are developed in separate files with minimum sharing among the components. While a production application would be structured differently, the IoT Center can be used to inspire further development.

The project also includes source code for IoT devices based on Arduino (ESP8266/32) and Raspberry Pi with Python. We will cover device code in later chapters.

Run the IoT Center

Before running the application (the server and web interface), install InfluxDB 2.0.0+. Download the version matching your OS and architecture from the InfluxData downloads page. Configure your username, organization, and token.

For detailed instructions, see Get started with InfluxDB.

Then, clone the IoT Center repository.

git clone https://github.com/bonitoo-io/iot-center-v2.git
cd iot-center-v2
git checkout d93d7d963f23059ce53ac4a3813a1f822f257ba5

Next, install the requirements:

InfluxDB must be running when the IoT Center starts. Start the InfluxDB server by running:

influxd

Configure your environment variables so that IoT Center can communicate with InfluxDB:

export INFLUX_TOKEN=<mysecrettoken>
export INFLUX_ORG=<myorg>
export INFLUX_BUCKET= iot_center # this is set by IoT center by default
export INFLUX_URL= http://localhost:8086 # this is set by IoT center by default

Finally, run the application:

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

For more, see the IoT Center README page.