🛠 Configure the KNOT HL9 for IoT Asset Tracking
Objectives
This tutorial guides the user through configuring the MikroTik KNOT Gateway HL9 for an asset tracking use case. The goal is to use the integrated GNSS receiver and the LTE Cat 1 bis modem to periodically transmit GPS position data to a remote MQTT broker. We will also enable Wi-Fi HaLow to collect data from surrounding sensors.
Required Equipment
- A MikroTik KNOT Gateway HL9.
- An active SIM card (supporting LTE Cat 1 bis) or a configured eSIM.
- An external LTE antenna (if necessary for optimal coverage).
- A computer with local network access for initial configuration.
- An account with an MQTT broker (e.g., HiveMQ, AWS IoT, or a local server).
- Ethernet cable for initial configuration via PoE or DC.
Steps
- Initial Connection: Power the HL9 via PoE (18-57V) or DC. Connect an Ethernet cable between the gateway's Gigabit port and your computer. Access the RouterOS v7 interface via the default IP address (usually 192.168.88.1) in a web browser or via Winbox.
- LTE Modem Configuration: In RouterOS, go to
Interface>LTE. Verify that the Quectel EG800Q modem is detected. Configure the APN provided by your mobile operator in the LTE interface settings. Enable the interface to establish the cellular connection.
- GNSS Activation: Navigate to
System>GPS. Ensure the serial port corresponding to the GNSS receiver is enabled. Configure the position update frequency (e.g., every 60 seconds). Verify that satellites are acquired to obtain a valid position.
- Wi-Fi HaLow Configuration: Go to
Wireless>Interfaces. Create a new Wi-Fi HaLow (802.11ah) interface on the 915 MHz band. Define an SSID and password. This interface will be used to receive data from long-range sensors.
- MQTT Automation Script: Open the terminal and create a script (
/system script add name=send_gps source="..."). The script must read the GPS position (/gps get [find] latitude) and publish it to the defined MQTT topic. Use the/tool fetchcommand or native MQTT functions in RouterOS v7 to send JSON data to the remote server via the LTE connection.
- Scheduling: Use the task scheduler (
/system scheduler) to execute the data sending script at regular intervals (e.g., every 5 minutes) to save energy and bandwidth.
Verification
Log in to your MQTT broker and subscribe to the configured topic. You should receive JSON messages containing latitude, longitude, and timestamp at each interval. Verify in RouterOS that the LTE interface shows a "connected" status and that the GPS indicates a "valid" position.
To go further
Explore integration with Bluetooth 5.1 LE to detect nearby iBeacon tags, or configure local alerts based on geographic zones (geofencing) directly on the gateway.
Other tutorials for this board
Code examples for this board
gnss-position-tracking.pyPython-Bashble-advertising-sensor.inoRouterOS-Scriptlte-failover-monitor.pyPython-Bashnand-storage-cleanup.pyPython-Bashpoe-power-status.inoRouterOS-Scriptrouteros-mqtt-telemetry.inoRouterOS Script