Call Phone +8618073152920 Hotline: +8618073152920
Call Phone +8618073152920
CONTACT US/ CONTACT US
Consumer hotline +8618073152920
Changsha Zoko Link Technology Co., Ltd.

Email:Arvin@niubol.com

WhatsApp:+8615367865107

Address:Room 102, District D, Houhu Industrial Park, Yuelu District, Changsha City, Hunan Province, China

Position:Home >> Blogs >> Technical Support

Technical Support

NiuBoL sensor interfaces with the akenza.io platform via the MQTT protocol

Time:2025-04-25 15:50:56 Popularity:14

The process of integrating with the akenza.io platform via the MQTT protocol requires completing steps such as device configuration, data flow creation, device registration, and code implementation. Below is a detailed guide, based on the official akenza documentation and the features of the MQTT protocol, explaining how to achieve the integration step by step.

 NiuBoL sensor interfaces with the akenza.io platform via the MQTT protocol.png

Step 1: Create an akenza.io Account 

1. Register an Account:

   - Visit the registration page at https://akenza.io and create an account. If you already have an account, log in directly.

   - After logging in, you will be directed to the akenza platform dashboard. 

2. Understand the Platform:

   - The akenza platform supports MQTT protocol and uses Eclipse Mosquitto as the MQTT broker. The platform acts as the broker, and devices act as MQTT clients.  

Step 2: Create MQTT Data Flow 

A data flow defines how devices communicate with the akenza platform via MQTT. 

1. Navigate to Data Flow:

   - In the akenza dashboard, click on "Data Flow" in the left menu.

   - Click the "Create Data Flow" button.

Create Data Flow.png 

2. Select MQTT Connection:

   - In the connection type, select "Connect a device over MQTT".

   - Device Type: Select "Passthrough" to receive raw data formats (JSON format is recommended).

   - Output Connector: Choose the storage destination for the data, such as the akenza DB (default database) or other supported connectors like InfluxDB or Webhook.

Select MQTT Connectio.png

3. Generate a Secret (Key):

   - After creating the data flow, the system will automatically generate a secret (key) for device authentication.

   - Record this secret, as it will be used in the MQTT topic structure and device connection. 

4. Save the Data Flow:

   - After confirming your settings, click "Create" to save the data flow. 

Step 3: Register a Device 

1. Navigate to Workspace:

   - In the left menu, click "Workspace".

   - Click the "Create Device" button.

Create Device.png  

2. Fill in Device Information:

   - Device Name: Name your device, e.g., "Weather sensor" or "Soil sensor".

   - Description (optional): Add a description for the device.

   - Tags/Custom Fields (optional): Add tags or custom fields for categorization.

   - Data Flow: Select the MQTT data flow created in the previous step.

 Create Device.png 

3. Generate Device ID:

   - Click "Generate ID" to generate a unique ID for the device.

Generate Device ID.png 

4. Complete Registration:

   - Click "Create Device" to complete the device registration.

   - After registration, find the device in the Devices menu and click to enter the device details page.

Create Device.png 

5. Obtain API Configuration:

   - In the device details page under the "API-Configuration" tab, get the following information:

     - MQTT Broker Host: Typically mqtt.akenza.io.

     - MQTT Username: Username.

     - MQTT Password: Password.

     - Uplink Topic: /up/{secret}/id/{deviceId}.

     - Downlink Topic (optional): /down/{secret}/id/{deviceId}. 

API.png 

Step 4: Configure the Device to Connect to MQTT

Using a device such as the Niubol sensor or another MQTT-capable device, configure it to connect to the akenza MQTT broker. The following instructions assume you're using the Niubol data collector.

 Configure the Device to Connect to MQTT.png

Step 5: Verify Data 

1. View Message Logs:

   - In the akenza platform's Workspace, find your device and go to its device details page.

   - Under the "Message Logs" tab, view the uplink data sent by the device.

   - The data should appear in JSON format, e.g., {"sensor":"temperature","value":25.5}.

Message Logs.png 

2. Data Visualization:

   - In the Dashboard Builder tab, view the device's KPIs and historical data charts.

   - If a downlink topic is configured, you can test sending commands to the device.

Data Visualization.png 

Step 6: Enable TLS (Optional) 

For enhanced security, it is recommended to use TLS encryption:

1. Use port 8883 instead of 1883 for encrypted communication.

 Data Visualization.png

Notes: 

1. Authentication Methods:

- akenza supports two authentication methods:

- Uplink Secrets: Use a shared key as the MQTT password.

- JWT: Use the device's private key to generate a JWT as the password (more secure, requires additional configuration).

- Choose the authentication type when creating the data flow. 

2. Topic Structure:

- Uplink Topic format: /up/{secret}/id/{deviceId}.

- Downlink Topic format: /down/{secret}/id/{deviceId}.

- Ensure the topics match the device configuration. 

3. Troubleshooting:

- If the connection fails, check:

- Ensure the MQTT username, password, and topic are correct.

- Verify the network connection is stable (Wi-Fi or cellular network).

- Ensure that the ports are not blocked by a firewall (1883 or 8883).

- Use a serial monitor or logs to view error codes.

4. Supported Formats:

- akenza accepts JSON formatted MQTT messages, so make sure the data sent by the device is in the correct format.

Reference Resources:

- akenza Official Documentation: MQTT Connectivity:

https://docs.akenza.io/akenza.io/get-started/your-data-flow/device-connector/mqtt

- Tutorial: How to integrate an Arduino device via MQTT on akenza:

https://docs.akenza.io/akenza.io/tutorials/add-devices/how-to-integrate-an-arduino-device-via-mqtt-on-akenza

Related recommendations

Sensors & Weather Stations Catalog

Agriculture Sensors and Weather Stations Catalog-NiuBoL.pdf

Weather Stations Catalog-NiuBoL.pdf

Agriculture Sensors Catalog-NiuBoL.pdf

Related products

Tell us your requirements, Let's discuss more about your project.we can do more.

Name*

Tel*

Email*

Company*

Country*

Message

online
Contacts
Email
Top
XNiuBoL sensor interfaces with the akenza.io platform via the MQTT protocol-Technical Support-Automatic weather stations_Pyranometer_Agricultural sensor_Soil sensor_temperature and humidity sensor_PH sensor_NPK sensor_environmental monitoring-NiuBoL

Screenshot, WhatsApp to identify the QR code

WhatsApp number:+8615367865107

(Click on WhatsApp to copy and add friends)

Open WhatsApp

The WhatsApp ID has been copied, please open WhatsApp to add consultation details!