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
  • Portal configuration
  • How to enable MQTT for a device
  • Connecting your MQTT device to KPN Things
  • Connecting to the KPN Things MQTT connector
  • Sending an uplink
  • Sending a downlink

Was this helpful?

Export as PDF
  1. BUILDING BLOCKS
  2. Connectivity

Connecting MQTT Devices

PreviousConnecting Internet devicesNextData Processing

Last updated 12 days ago

Was this helpful?

As a prerequisite to use MQTT with KPN Things, you need either a or a .

Integrating your device using MQTT is easy as it relies on standard publish and subscription methods. After ingestion, data will be processed and delivered using the . Downlinks towards a device can be specified using the Portal or available API's.

This page deals with sending data into the Things processing engine. .

Portal configuration

How to enable MQTT for a device

Login to :

  1. Find an M2M enabled Device (e.g. a type "Own M2M") in your Devices list. Open the Device details page by clicking on the Device.

  2. On the Device details page you will see a link in the top-right corner: "Activate MQTT service". Click the link.

  3. You should see a message "MQTT Service was successfully activated." and the MQTT tab will appear, showing the MQTT details.

  4. This is the only time you will be able to read (and copy) the generated password, so make sure you note it down. If you need to, you can edit the MQTT configuration to set a different (generated) password.

  5. Use the credentials to configure your Device and you are good to go!

Connecting your MQTT device to KPN Things

KPN Things provides an MQTT connector that can be used to publish uplinks from your MQTT device to the KPN Things platform and receive downlinks from the KPN Things platform. Note that the KPN Things MQTT connector is not a full MQTT broker. It can only be used to send uplinks to and receive downlinks from the KPN Things platform. Uplinks published by your device will not be visible to other devices that connect to the MQTT connector. Likewise, downlinks sent to your device will only be visible to your device.

The KPN Things MQTT connector supports MQTT 3.1, MQTT 3.1.1 and MQTT 5.0.

Connecting to the KPN Things MQTT connector

For M2M devices that use a KPN Things SIM card (using APN kpnthings2.m2m), the MQTT connector can be accessed using the MQTT protocol on 10.151.236.154 port 1883. Note that even though the MQTT protocol is unencrypted, your connection to KPN Things is secure because your device has a direct encrypted connection to KPN Things through the mobile network.

If your device does not use a KPN Things SIM card and you have configured it as an Internet device in KPN Things Portal, you can only access the MQTT connector using MQTTS on connect.mqtt.kpnthings.com port 8883.

When connecting to the MQTT connector, you must provide the username and password that were displayed in Things Portal when you activated MQTT for your device. The MQTT connector currently does not support authentication using client certificates.

To recap:

Device type
Connector address
Protocol

M2M using a KPN Things SIM card

10.151.236.154, port 1883

MQTT

Internet device

connect.mqtt.kpnthings.com, port 8883

MQTTS

Sending an uplink

Sending a downlink

Things Manager

You can send a downlink to your MQTT device using the "Send instruction" tab on the device detail page in Things Portal.

API

The downlink will be published to the downlink topic and will be delivered to the MQTT device the next time the device connects and subscribes to the topic.

For MQTTS to work correctly, many devices and/or MQTTS clients must be configured to trust KPN Things MQTT connector's server certificate (or rather the CA root certificate). Whether your device needs this extra configuration depends on the device or MQTT client used. Should you need it, you can download the CA root certificate from our certificate provider (from the Root Certificates section). For convenience, you can also find the root certificate here.

KPN Things MQTT connector will ingest uplinks on any topic, so you're free to choose. The expected message format depends on the decoder you have configured for your device. The decoder for the "Own M2M" and "Own Internet" device types supports SenML, the internal format of the Things Platform. If you're using the decoder › Decoded ThingsML and raw SenML data, your message payload should be a valid SenML pack. For more information see the .

Or you can to send downlinks automagically.

Device with a KPN Things SIM card which is configured to use the kpnthings2.m2m APN
configured Internet device
KPN Things flow mechanism
Read more about how to use MQTT to send data out of Things here
the Things Portal
Sectigo
SenML documentation
use the Actuator API
2KB
USERTrustRSA_Root_CA.crt