Collecting IoT Data in InfluxDB D AV I D G . S I M M O N S S E N - - PowerPoint PPT Presentation

collecting iot data in influxdb
SMART_READER_LITE
LIVE PREVIEW

Collecting IoT Data in InfluxDB D AV I D G . S I M M O N S S E N - - PowerPoint PPT Presentation

Collecting IoT Data in InfluxDB D AV I D G . S I M M O N S S E N I O R D E V E L O P E R E VA N G E L I S T @ D AV I D G S I O T Who, What and Why is InfluxData Founded in 2013 Delivering a modern open- source platform for metrics


slide-1
SLIDE 1

D AV I D G . S I M M O N S S E N I O R D E V E L O P E R E VA N G E L I S T @ D AV I D G S I O T

Collecting IoT Data in InfluxDB

slide-2
SLIDE 2

Who, What and Why is InfluxData

slide-3
SLIDE 3

Overview

ü Founded in 2013 ü Delivering a modern open- source platform for metrics and events ü Guiding principles:

  • Developer Happiness
  • Ease of Development + Scale

Out

  • Time to Awesome

ü Results

  • 70,000+ Active Servers
  • 300+ Customers
slide-4
SLIDE 4

Events and Metrics (Time-Series Data) | Time-Series

Orders, Customers etc. (Data with Relationships) | SQL Web pages, Documents, etc.(Text Data) | Search Volume/Variety of Data. (Big Data) | Big Data

Specialized Platforms

slide-5
SLIDE 5

High volumes of streaming data Support for Time-based Functions Need for Scalability and Availability

What makes

time series

1 2 3

different?

slide-6
SLIDE 6

InfluxData Open Source Projects

*Note: Clustering only in Commercial Offerings

slide-7
SLIDE 7

IoT Data Layer

slide-8
SLIDE 8

IoT Data Needs

  • IoT data MUST be
  • Timely – ingestion rates and query efficiency is key
  • Accurate – data integrity and platform reliability is important
  • Actionable – data visualization, anomaly detection & alerting are essential
  • Deployable in the datacenter and at the edge
  • IoT deployments are struggling to find efficient, scalable, data

platform that meets all of these criteria

slide-9
SLIDE 9

IoT Platform Needs

  • Extensive protocol support for data ingestion
  • BLE, Zigbee, Zwave, CoAP

, MQTT, MODBUS

  • Robust offline data capability
  • Normalization of data
  • Storage for local data
  • Local event processing engine
  • Hardware-agnostic, scalable architecture
  • Comprehensive analytics and visualization tools

Source: https://www.networkworld.com/article/3247801/internet-of- things/the-top-5-user-requirements-of-iot-edge-platforms.html

slide-10
SLIDE 10

Protocol Support

  • Telegraf has over 150 plugins
  • More every release
  • Many IoT-Specific plugins
  • MQTT
  • RabbitMQ
  • Particle.io
  • Many more to come
  • CoAP
  • PPMP
slide-11
SLIDE 11

Robust Offline Data Capability

  • Normalization of data
  • Use Kapacitor for data normalization
  • Storage for local data
  • Store locally on the edge
  • Forward upstream to cloud
  • Downsample before forwarding to reduce bandwidth usage
  • Local Even Processing Engine
  • Use Kapacitor for event processing
slide-12
SLIDE 12

Hardware Agnostic, Scalable

  • Runs on x86 and ARM
  • Runs on servers and embedded platforms
  • Single code-base
  • Simple deployment
slide-13
SLIDE 13

Comprehensive Analytics and Visualization

  • Use Chronograf for visualization
  • Also compatible with Grafana
  • Analytics via visualization, Kapacitor or CQs
  • Forward data to external analytics platforms
slide-14
SLIDE 14

What Does an IoT Data Solution Need?

  • In the Cloud
  • High-capacity data ingestion
  • Flexible Data retention policies
  • Not all data needs to be around forever!
  • Dashboarding and visualization
  • Alerting
  • Response to data events
slide-15
SLIDE 15

What Does an IoT Data Solution Need?

  • At the edge
  • Same needs as the cloud +
  • Small, lightweight, yet powerful
  • Data downsampling
  • Multi-protocol ingestion
slide-16
SLIDE 16

An IoT Architecture

  • Run the same stack on the edge as the cloud
  • Lower cost of development
  • Faster Time to Awesome™
  • Flexible deployment
  • Location-specific analytics
  • Shop-floor Dashboard
  • Backend Dashboard
slide-17
SLIDE 17

IoT Edge Monitoring

  • Monitor the sensors
  • Monitor the network
  • Did the sensor die, or was it the wireless connection?
  • Monitor the platform
  • Battery?
  • CPU?
  • Storage?
slide-18
SLIDE 18

Edge Dashboard

slide-19
SLIDE 19

What is Time Series Data?

slide-20
SLIDE 20
  • Relationships between

different kinds of data

  • Transactional
  • Frequently updated

Relational Data

slide-21
SLIDE 21
  • Document storage
  • JSON Objects
  • NoSQL Databases

Document Data

slide-22
SLIDE 22
  • Data over time
  • Stock prices
  • Event Data
  • event@time
  • Sensor Readings
  • temperature@time

Time Series Data

slide-23
SLIDE 23

Why is IoT Data Time Series Data?

  • <sensor>@<time>
  • The @time component!
  • Temperature reading, valve

flow-rate, etc.

  • IoT Data is time series

data

  • See above.

<sensor>@<time>

slide-24
SLIDE 24

Installing InfluxDB

slide-25
SLIDE 25
  • Install Homebrew
  • /usr/bin/ruby -e "$(curl -fsSL

https://raw.githubusercontent.com/Homebrew/install/mast er/install)”

  • Install InfluxDB
  • brew install influxdb chronograf telegraf kapacitor
  • Enable InfluxDB
  • brew services start influxdb

Mac OS X

slide-26
SLIDE 26
  • https://docs.influxdata.com/influxdb/v1.5/introdu

ction/installation/

  • curl -sL https://repos.influxdata.com/influxdb.key |

sudo apt-key add –

  • source /etc/lsb-release
  • echo "deb https://repos.influxdata.com/${DISTRIB_ID,,}

${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

  • sudo apt-get install influxdb chronograf telegraf

kapacitor

  • systemctl enable influxdb

Linux

slide-27
SLIDE 27
  • https://portal.influxdata.com/downloads
  • Not well supported and not recommended for production

Windows

slide-28
SLIDE 28
  • Go to http://localhost:8888/
  • Graphical front-end to InfluxDB, Chronograf, and Kapacitor

Running InfluxDB

slide-29
SLIDE 29

Getting Data In

slide-30
SLIDE 30

How does InfluxData help?

  • Extremely efficient data collection
  • High-volume data collection
  • IoT generates huge volumes of data very quickly
  • Being able to ingest, analyze and query that data is key to IoT success
  • Ease of Deployment
  • Easy to deploy InfluxDB and the TICK stack for data collection, analysis

and action

  • Very low time to value – Time To Awesome™
  • Dashboards and visualization
  • Easy to build useful, easy to read dashboards.
slide-31
SLIDE 31

Getting Data from IoT Device to InfluxDB Line Protocol

<measurement>[,<tag>=<value>[,<tag>=<value>]] <field>=<value>[,<field>=<value>] [<timestamp>]

Element Optional/Required Description Type

Measurement Required The measurement name. InfluxDB accepts one measurement per point. String Tag Set Optional All tag key-value pairs for the point. Tag keys and tag values are both strings. Field Set

  • Required. Points must have at least 1 field.

All field key-value pairs for the point. Field keys are strings. Field values can be floats, integers, strings, or booleans. Timestamp

  • Optional. InfluxDB uses the server’s local

nanosecond timestamp in UTC if the timestamp is not included with the point. The timestamp for the data

  • point. InfluxDB accepts one

timestamp per point. Unix nanosecond timestamp. Specify alternative precisions with the HTTP API.

On success, the response.status should be 204.

slide-32
SLIDE 32

Getting Data from IoT Device to InfluxDB

  • Using Telegraf Plugins
  • Enormous list of available plugins
  • https://github.com/influxdata/telegraf/tree/master/plugins/inputs
  • IoT Plugins
  • AMQP (RabbitMQ) Plugin
  • http_listener – Telegraf plugin for line-protocol
  • Mqtt_consumer – subscribe to mqtt topics and add messages to

InfluxDB

  • New plugin for Particle.io webhooks available!
slide-33
SLIDE 33

Analyzing Your Data

slide-34
SLIDE 34

Analyzing Your Data

“The more simple your data, the more complex the analysis you can run.”

– Sarah Cooper, AWS IoT Solutions

slide-35
SLIDE 35

Visualize Your Data on Dashboards

slide-36
SLIDE 36

Look For Hidden Gems

slide-37
SLIDE 37

“It’s amazing what you can discover when you can actually see your data!”

slide-38
SLIDE 38

Get InfluxDB

https://influxdata.com

slide-39
SLIDE 39

How Can InfluxData Fit Into My IoT Architecture?

slide-40
SLIDE 40

An IoT Architecture

InfluxData

  • Telegraf
  • Data Collection
  • InfluxDB
  • Short-term storage
  • Long-term storage
  • Kapacitor
  • Local Alerts
  • System-wide alerts
  • Chronograf
  • Dashboards
slide-41
SLIDE 41

Getting Data Out

slide-42
SLIDE 42

Event Processing Engine

  • Kapacitor
  • Data co-processing engine
  • Downsampling, etc.
  • Anomaly detection
  • Alerting
slide-43
SLIDE 43

Kapacitor Alerting

  • Alert Types
  • Threshold Alert
  • Deadman Alert
  • Alerts based on Calculated Value
  • Alert Mechanisms
  • TCP/HTTP
  • Pager Duty
  • MQTT
slide-44
SLIDE 44

Kapacitor Alert - Calculated Value

var parseTemp = '’’ {{ if (gt ( index .Fields "max.value" ) 90.0 ) }} #ff0000 {{ else if (gt ( index .Fields "max.value" ) 88.0 ) }} #ff4000 {{ else if (gt ( index .Fields "max.value" ) 86.0 ) }} #ff8000 {{ else if (gt ( index .Fields "max.value" ) 84.0 ) }} #ffbf00 {{ else if (gt ( index .Fields "max.value" ) 82.0 ) }} #ffff00 {{ else if (gt ( index .Fields "max.value" ) 80.0 ) }} #bfff00 … {{ else }} #bf00ff {{ end }}'''

slide-45
SLIDE 45

Kapacitor Alert - MQTT

trigger |alert() .mqtt('colorChange') .brokerName('127.0.0.1') .topic(message)

slide-46
SLIDE 46

Join Our Community

  • On the Web

https://community.influxdata.com

  • On GitHub

https://github.com/influxdata

  • On Slack

https://gophersinvite.herokuapp.com #influxdb

  • On Twitter:

@InfluxDB and @davidgsIoT

slide-47
SLIDE 47

Questions?

slide-48
SLIDE 48

Thank You

davidgs@influxdb.com @davidgsIoT