I discovered recently, a significant change was introduced in the way MQTT topics are structured in LoRaWAN network servers, such as The Things Stack (TTS). The topic no longer uses the DevEUI to identify devices. Instead, the new format is as follows:
v3/{application-id}/devices/{device-id}/{event-type}
Key Changes:
-
Use of
Device ID
Instead ofDevEUI
:- The device identifier is now the
Device ID
, which corresponds to the name assigned to the device in the platform. This replaces the hexadecimal DevEUI previously used in the topic. - This makes integrations more user-friendly, as you can assign descriptive names to devices rather than working with hard-to-read identifiers.
- The device identifier is now the
-
Topic Structure:
- The topic includes the
application-id
, thedevice-id
, and the event type (e.g.,uplink
,join
,ack
, etc.). - Example:
v3/my-app/devices/kitchen-sensor/uplink
- The topic includes the
-
Benefits of the Change:
- Improved Readability: Using the
Device ID
makes it easier to identify devices, especially in large-scale applications. - Enhanced Compatibility: The new structure aligns with The Things Stack V3 standard, ensuring better interoperability and scalability.
- Greater Flexibility: You can create unique and meaningful names for devices, simplifying device management in applications.
- Improved Readability: Using the
-
Payload Format:
- Device identification, which was previously part of the topic (via DevEUI), is now included in the message payload in JSON format.
- Example of payload:
{ "end_device_ids": { "device_id": "kitchen-sensor", "application_ids": { "application_id": "my-app" }, "dev_eui": "AABBCCDDEEFF0011" }, "uplink_message": { "f_port": 1, "frm_payload": "data-encoded", "rx_metadata": [...], "settings": {...} } }
Recommendations:
- Update Your Code and Workflows: Ensure that your integration scripts and tools are updated to use the new
Device ID
instead of theDevEUI
in the topic structure. - Refer to the Documentation: Check the official documentation of The Things Stack for detailed examples and guidance on adapting to the new topic format.
- Choose Device IDs Wisely: Since the
Device ID
is part of the topic, assign unique and meaningful names to devices to make management easier.