LogoLogo
  • KPN THINGS USER GUIDE
    • Introduction
    • Getting started
      • Registration and setup
      • Device simulator app
      • Connect devices
        • SIM cards
        • Supported devices and KPN Devices
        • SODAQ R412M
        • Smartrak
        • Marvin development board
        • LoPy5
        • Arduino MKR WAN 1300/1310
        • Arduin MKR NB 1500
    • All videos
    • Tutorials
      • Configure a flow
      • Connect a HTTPs destination
      • Create a simple IoT web applicationPage
      • Send instruction to LoRa DevicePage
      • Send your data to Azure SQL
      • Technical overview
        • Management data model
        • Uplink communication
        • Downlink communication
        • Location data
      • Accounts and projects
        • Customer accounts and users
        • Projects
        • Customer management
        • Cost overview and contract
    • Frequently asked
      • Multi Factor Authentication
  • GENERAL FUNCTIONS
    • Quick reference videos
    • APIs
  • THE PORTAL EXPLAINED
    • Things Manager
      • Devices
        • Bulk operations
      • Data
        • Device data graph
      • Connectivity
        • LoRa connectivity configuration
      • Bulk reports
    • Things Creator
    • Support
      • News
      • Release notes
      • Real-time status
      • Service reports
      • Documents
      • Support tickets
      • Invoices
      • Contact info
    • Shop
  • BUILDING BLOCKS
    • Devices
      • Sensors
        • KPN Conditionsensor CO2 II
        • KPN Conditionsensor CO2 III
        • KPN Conditionsensor CO2 III motionPage 1
        • KPN FillTag I
        • KPN FillTag II
        • 1M2M ED1608
        • Elsys ERS
        • Device Simulator (Mobile Phone app)
        • Generic Device (Internet connected)
        • Generic LoRa device (preset connectivity)
        • Generic LoRa device (programmable)
        • Generic M2M device
        • Generic M2M device (with Internet connection)
      • Trackers
        • KPN Global Tracker Autonomous
        • KPN Global Tracker Wired
        • KPN LocationTag I
        • KPN LocationTag II
        • KPN LocationTag II v2
        • KPN LocationTag II v2 Expert Mode
        • KPN LocationTag II v3
        • KPN LocationTag III (with GPS)
        • KPN LocationTag III (without GPS)
        • KPN LocationTag III v2
        • KPN LocationTag III v2 Buffer
        • KPN LocationTag III v3
        • KPN LocationTag III v4
        • KPN LocationTag V
        • KPN LocationTag VI
        • KPN LocationTag WS
        • Streamline LoRa
        • Streamline M2M
        • Viloc
      • Routers
      • Gateways
        • KPN FSK Basestation
      • Device SDK
    • Connectivity
      • Connecting LoRa devices
        • LoRa connectivity configuration
      • Connecting M2M devices
      • Connecting Internet devices
      • Connecting MQTT Devices
    • Data Processing
      • ThingsML and SenML
        • ThingsML
        • SenML
          • Understanding and Interpreting SenML Data
          • Changes in KPN SenML
      • Device Twin
      • Decoders and encoders
        • Common measurements list
        • Decoder migrations
        • DIY Decoder
          • DIY decoder scripts
      • Merger
      • Device data
      • Devices
    • Destinations
      • HTTPS destination
      • MQTT broker
      • Cumulocity IoT Platform
      • Azure Event Hubs
      • Azure IoT Hub
      • Test Endpoint
      • ThingsBoard
      • Datacake
      • AWS Lambda
      • Google Cloud Run functions
  • IOT LINE UP
    • Freemium
      • Test SIM cards
    • Explorer
    • Modular
    • Tailored
    • Terms and Conditions
Powered by GitBook

© 2024 KPN - All rights reserved.

On this page
  • Internet Device registration
  • HTTPS
  • The request
  • The response
  • MQTT

Was this helpful?

Export as PDF
  1. BUILDING BLOCKS
  2. Connectivity

Connecting Internet devices

If your device does not support one of our integrated connectivity forms, like LoRa or M2M, you can connect your device directly to KPN Things over the Internet.

PreviousConnecting M2M devicesNextConnecting MQTT Devices

Last updated 9 days ago

Was this helpful?

If your device does not support one of our integrated connectivity forms, like or , you can connect your device directly to KPN Things over the Internet.

Internet Device registration

To register the device you need to fill the following details:

  • DvnUUID - UUID to uniquely identify the Device data coming in.

  • Shared Secret - The pre-shared password used for authorizing ingestion of IoT data from the device by the system.

When generating your own DvnUUID we advice to use a .

HTTPS

Internet-connected devices can send their data using HTTPS.

The request

Base URL: https://prod.dm.kpnthings.com

POST /ingestion/ip/senml/v1 HTTP/1.1
Things-Message-Token: <messageToken>
Content-Length: <nrBytes>

[{"bn":"urn:dev:DVNUUID:<dvnuuid>:","bt":<timestamp>},<measurements>]

Body

Base time

The base time bt in the SenML pack is optional, because not all devices keep track of the absolute time. If Things Data Management receives a message without base time, the moment that the message is received will be filled in as base time.

Things Message token

For device authentication we introduce a pre-shared secret for each device. This secret is used by the device to generate message tokens that are SHA256-hashes which are send in the Things-Message-Token header of the request. This token can be used by Things to validate the source of the message. At the same time it prevents tampering with the measurement values.

The secret should be at least 30 characters long and no more then 100, is case sensitive and can contain all ASCII characters: ^[0-9a-zA-Z]{30,100}$

The pre-shared secret is used directly for message token calculation. There is no challenge protocol or no session keys, because we rely on the secure channel for complete integrity.

The message token is calculated as following:

messageToken = sha256({requestBody}{sharedSecret})

The requestBody used for the hash should be identical as the body send in the HTTPS request. Preferably strip the from all white space characters before putting it in the hash and the HTTPS request.

The response

When you send data to KPN Things using a HTTP request, the HTTP response is used to transmit a possible downlink message to your device. Only if a downlink message is in status Executing it will be send, and only one downlink message is send at a time.

A downlink message will be structured as SenML in JSON format. Learn more about downlink communication.

Response code

Using the HTTP response code you can debug some common problems:

202

🟢 The message was received and accepted for further processing.

400

🔴 The received message was not correctly structured.

Check whether all required headers are present and whether the request body is correctly formatted.

401

🔴 The Things Message Token could not be verified.

Check the shared secret and the hashing method in your device.

404

🔴 The provided device identifier was not recognized. Check whether the identifier is correct and known in the Things Portal.

MQTT

The body of the HTTP request should be a valid SenML pack. For more information see the .

Read all about on the next page.

LoRa
M2M
Version 4 UUID
SenML documentation
the use and possibilities of MQTT ingestion