- Prerequisites
- Create Device on ThingsBoard (Optional)
- Add Integration and Topic Filter
- Docker Container Setup
- Deployment Configuration
- Check Data on ThingsBoard
- Conclusion
ALPON X4 is a powerful and reliable edge computer for IoT and industrial applications developed by Sixfab. It features cloud management, LTE connectivity, and eSIM support for automatic network switching. Powered by a Raspberry Pi CM4 processor, up to 8GB LPDDR4 RAM, and 32GB eMMC storage, it ensures robust processing for demanding applications. With Cat4 LTE, Wi-Fi 2.4/5GHz, Bluetooth 5.0 BLE, and Gigabit Ethernet, the ALPON X4 guarantees seamless connectivity, even in challenging environments.
Its rugged design operates from -20°C to +60°C, supports flexible power options like USB-PD Type-C, 9-30V DC, and optional PoE+, and offers DIN Rail or Wall Mount for easy deployment. Certified by CE, FCC, Verizon, AT&T, and more, it’s built for global scalability. The ALPON X4 powers industrial automation with PLC and Modbus, enables smart home and remote monitoring via ThingsBoard, supports digital signage, and optimizes energy efficiency for versatile IoT solutions.
Prerequisites
To continue with this guide, you will need the following:
- Sixfab Connect Account
- ALPON X4 Device: Registered and activated on Sixfab Connect with an active internet connection. Refer to the ALPON X4 Getting Started page setup instructions for details.
- Basic Knowledge: Familiarity with IoT concepts, containerized applications, and ThingsBoard dashboards.
Create Device on ThingsBoard (Optional)
The integration can create a device even if there is no device yet, so skip this step if you want.
Log in to ThingsBoard
- Access your ThingsBoard instance.
- Navigate to Entities > Devices in the sidebar.
Add a New Device
- Click on the “+” icon in the top right corner of the table and select “Add new device”.
- Enter the device name (e.g.,
ALPON_X4
). No other changes are required at this time. - Click Add and close the window. The device is created.
Add Integration and Topic Filter
To transfer data from the ALPON X4 to ThingsBoard via an external MQTT broker, you need to set up an MQTT Integration in ThingsBoard. This integration uses a Topic Filter to specify which MQTT topics to listen to and a Data Converter written in TBEL to process incoming data and map it to the appropriate device.
Create an MQTT Integration
- Log in to ThingsBoard. Go to the Integrations center -> Integrations page.
- Click “plus” icon to add a new integration.
- Select “MQTT” as the integration type.
- Select “TBEL” as the Downlink data converter.
- Copy and paste the following code into the decoder function window and click “Next”.
- Configure the broker details:
- Host:
broker.hivemq.com
- Port:
1883
- Topic:
v1/devices/+/telemetry
This filter determines which topics the integration will listen to. - Click Add button.
- Host:
Understand the Topic Filter
The Topic Filter v1/devices/+/telemetry
uses a single-level wildcard (+) to match any single topic level in the specified position. For example, it will match topics like:
v1/devices/device1/telemetry
v1/devices/sensorA/telemetry
v1/devices/room23/telemetry
It will not match topics such as:
v1/devices/device1/sensor/telemetry
(because+
matches only one level)v1/devices/telemetry
(because a level is missing)v1/attributes/+/client
(different topic structure)
This structure allows the integration to process data from multiple devices, each using a unique identifier (e.g., device1
, sensorA
, room23
) in the topic.
This setup allows the ALPON X4 to send telemetry data to ThingsBoard via an external MQTT broker, with the integration processing and mapping the data to the correct device based on the topic structure.
Docker Container Setup
Follow the steps below to prepare the MQTT client container on your local computer and then install Sixfab Registry.
Install Docker
Ensure Docker is installed on your local machine. Download and install it from the official Docker website if needed.
Create a Dockerfile
Create a file named Dockerfile
with the following content to set up the environment for the MQTT client:
Create the MQTT Test Script
Create a file named mqtt_test.py
in the same directory as the Dockerfile
. This script configures the ALPON X4 to publish telemetry data to ThingsBoard via MQTT:
Build the Docker Image
- Open a terminal on your local machine in the directory containing the
Dockerfile
andmqtt_test.py
. - Run the following command to build the Docker image:
1
docker build --platform=linux/arm64 -t thingsboard-mqtt-alpon-x4:latest .
Upload the Docker Image
- Log in to the Sixfab Connect platform and navigate to the container registry section.
- Click on + Add Container and follow the prompts to push the container to the Sixfab Registry.
Visit the Manage & Deploy Applications page for all necessary details on pushing your container image to the Sixfab Registry.
Deployment Configuration
- Log in to Sixfab Connect.
- Navigate to Assets and select your ALPON X4 device.
- Go to the Application section and click “+ Deploy”.
- In the Deploy Container window:
- Container Name:
thingsboard
- Image and Tag: Select the uploaded image and tag pushed to the Sixfab Registry.
- Environment: Click “+ Add More” in the environment section and add the following values:
MQTT_SERVER
:broker.hivemq.com
MQTT_PORT
:1883
CLIENT_ID
: alponx4TOPIC
:v1/devices/ALPON_X4/telemetry
- Container Name:
- Click the “+ Deploy” button to start the container.
Check Data on ThingsBoard
Verify that telemetry data is received and displayed in ThingsBoard:
- Log in to your ThingsBoard instance.
- Navigate to Entities > Devices and select your ALPON X4 device.
- Go to the Latest Telemetry tab to view the temperature and humidity data sent.
Conclusion
This guide demonstrated how to integrate the ALPON X4 with ThingsBoard using MQTT for real-time data collection and device control. By following the steps, you created a device in ThingsBoard, deployed an MQTT client on Sixfab Connect, and verified telemetry data.
For further assistance, refer to the ThingsBoard documentation or contact Sixfab support.