DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Building Time-Series Applications With Java and InfluxDB
  • Beyond Clicking Buttons: Build a Browser Agent That Verifies Its Results With Playwright MCP
  • Distributing Massive AI Models With Network-Layer Multicast
  • Securing Branch Networks With Firewalls, VPNs, IDS/IPS, and Identity-Based Access

Trending

  • Common Pitfalls in RAG Applications: What to Avoid When Using Vector Search and Embeddings
  • Pipelines on Fire: Why Your CI/CD Tools Are the New Cyber Battlefield
  • Agentic Systems and Design Patterns
  • Can Your Team Name the Work It Already Runs With AI?
  1. DZone
  2. Data Engineering
  3. Databases
  4. Enabling The Things Network for InfluxDB

Enabling The Things Network for InfluxDB

Want to bring The Things Network's IoT data-gathering capabilities to a time series database that can handle it? Here's how to connect it to InfluxDB.

By 
David G. Simmons user avatar
David G. Simmons
DZone Core CORE ·
May. 28, 18 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
8.9K Views

Join the DZone community and get the full member experience.

Join For Free

I’ve been on the road a bit lately. Ok, so a lot. I spent a week at KubeCon EU demoing InfluxDB and IoT at the EclipseIoT booth, and then I spent a week presenting at the ICTP Workshop on monitoring Radiation data via LoRa networks. I’m sure that all sounds ridiculously exciting to you. It was more exhausting than anything. As a side note, I managed to walk a total of 25 miles over 2 days during those trips, which is personally pretty amazing.

While I was instructing at the ICTP workshop — and let me say that it was both an honor and a privilege to be around the incredibly smart attendees under the auspices of the United Nations — I was asked if it was possible to connect The Things Network, which the workshop was using to collect sensor data, to InfluxDB. I figured it would be, and that it wouldn’t be that hard, but I was a little shocked at how simple it really was! Here’s the rundown.

First, I installed InlfuxDB, Telegraf, etc. on a server in the ICTP Lab. Next, I had to configure the Telegraf instance to read from the TTN (The Things Network) server. Luckily, it is a simple MQTT broker, so all I had to do was edit the telegraf.conf file and add the following section:

[[inputs.mqtt_consumer]]
    servers = ["tcp://eu.thethings.network:1883"]
    qos = 0
    connection_timeout = "30s"
    topics = [ "+/devices/+/up" ]
    client_id = ""
    username = “username"
    password = “password"
    data_format = "json"


A restart of Telegraf, and suddenly, a ton of data was streaming from their sensors! Of course, you’ll have to use real values for your own username and password.

I wish that this was a longer blog post, but it’s hard to stretch this out much more given how easy it was to integrate TTN with InfluxDB. The really neat thing about the Telegraf MQTT plugin is that it automatically ‘flattened’ the JSON payload from the TTN MQTT broker and imported the resultant data into InfluxDB with no additional effort on my part.

If you’re using TTN, and you want an easy way to analyze and visualize your data, try pulling it into InfluxDB! It’s super easy, super fast, and gives you access to data analysis and dashboarding very quickly.

InfluxDB Network

Published at DZone with permission of David G. Simmons. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Building Time-Series Applications With Java and InfluxDB
  • Beyond Clicking Buttons: Build a Browser Agent That Verifies Its Results With Playwright MCP
  • Distributing Massive AI Models With Network-Layer Multicast
  • Securing Branch Networks With Firewalls, VPNs, IDS/IPS, and Identity-Based Access

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook