Asset Tracking Meets AI: How to Integrate BLE/GPS/LoRaWAN Trackers with ASI Biont for Smarter Inventory and Logistics

Introduction

Asset tracking is the backbone of modern logistics, warehousing, and facility management. From Bluetooth Low Energy (BLE) tags on office laptops to GPS-enabled pallet trackers in cross‑country shipments, the ability to know where your equipment is — and how it's being used — saves companies millions in lost assets and operational inefficiencies. However, most tracking solutions are siloed: they offer a dashboard for viewing location data, but rarely connect that data to an AI that can act on it in real time.

Enter ASI Biont, an AI agent that connects to any device through natural‑language chat. Instead of building a custom middleware or waiting for vendor APIs, you simply describe your asset tracking setup in plain English, and ASI Biont writes the integration code on the fly — connecting to your BLE scanners, GPS receivers, LoRaWAN gateways, or existing IoT platforms via MQTT, HTTP, Modbus, OPC‑UA, or direct serial communication.

In this guide, we’ll walk through a concrete integration: connecting a fleet of GPS‑enabled asset trackers (sending NMEA sentences over a COM port) and a LoRaWAN‑based temperature tag to ASI Biont. You’ll see how the AI agent parses location data, triggers geofence alerts, automates inventory reconciliation, and generates utilisation reports — all through a chat interface.

Why Connect Asset Tracking to an AI Agent?

Traditional asset tracking gives you a map and a list. An AI agent like ASI Biont turns that raw data into actionable intelligence:

  • Geofence automation — receive a Telegram alert when a high‑value asset leaves a designated area.
  • Predictive maintenance — combine location data with sensor readings (temperature, vibration) to predict failures.
  • Inventory reconciliation — compare tracked asset positions against a Bill of Materials (BOM) and flag discrepancies.
  • Utilisation analytics — calculate how often an asset moves, how long it stays idle, and optimise its deployment.

Because ASI Biont connects via execute_python — a sandboxed environment where the AI writes and runs Python scripts using real libraries (paho‑mqtt, pyserial, pymodbus, aiohttp, opcua‑asyncio, paramiko) — there’s no limit to the protocols or devices you can integrate. The user simply provides connection parameters (IP, port, API key, COM port name) in the chat, and the AI generates the connector code instantly.

Connection Methods: Which One to Use?

ASI Biont supports multiple integration paths for asset tracking hardware:

Asset Tracker Type Typical Interface ASI Biont Connection Method Why This Method
GPS tracker (serial output) RS‑232 / USB‑to‑serial Hardware Bridge (bridge.py) via industrial_command Bridge reads NMEA sentences from the COM port and forwards them to the AI via short‑polling.
BLE tag scanner (e.g., Raspberry Pi + bluetooth) SSH / Python script SSH via paramiko (inside execute_python) AI connects to the Raspberry Pi over SSH, runs a Python script that scans BLE beacons, and returns the list of detected tags.
LoRaWAN tracker (e.g., Dragino LGT‑92) MQTT (via TTN / ChirpStack) MQTT via paho‑mqtt (inside execute_python) The AI subscribes to the MQTT topic where the LoRaWAN network server publishes uplink messages, parses the payload, and extracts GPS coordinates / sensor data.
IoT platform API (e.g., AWS IoT Core, Azure IoT Hub) HTTP / MQTT HTTP via aiohttp or MQTT via paho‑mqtt The AI calls the platform’s REST API or subscribes to its MQTT topics to pull asset telemetry.
USB GPS dongle on a PC COM port (NMEA) Hardware Bridge (bridge.py) Same as GPS tracker: bridge exposes the serial stream to the AI.
OPC‑UA asset tracking server OPC‑UA industrial_command (protocol='opcua') Read asset position variables from an OPC‑UA server in a factory.

Step‑by‑Step Integration: GPS Asset Tracker via COM Port + LoRaWAN Temperature Tag via MQTT

Let’s build a hybrid asset tracking system that monitors:
1. GPS coordinates of a mobile generator (via a serial GPS module).
2. Temperature and location of a cold‑chain container (via a LoRaWAN tag).

The user will connect both to ASI Biont simultaneously, and the AI will correlate the data, send alerts, and generate reports.

Prerequisites

  • Hardware Bridge (bridge.py) running on a Windows PC connected to the GPS module on COM4 at 9600 baud (NMEA 0183).
  • A LoRaWAN temperature tag registered on The Things Network (TTN) with an MQTT integration enabled. The user provides the TTN application ID, device EUI, and API key.
  • Python 3.9+ installed locally (for bridge.py).

1. Starting the Hardware Bridge

The user downloads bridge.py from the ASI Biont dashboard (Devices → Create API Key → Download bridge) and launches it:

python bridge.py --token=YOUR_API_TOKEN --ports=COM4 --default-baud=9600

The bridge connects to ASI Biont via HTTP short‑polling. Now the AI can send commands to COM4 using the industrial_command tool with protocol serial://.

2. Chat with AI: Connect to the GPS Tracker

The user types:

“Connect to my GPS tracker on COM4. The bridge is running. Parse the NMEA sentences and show me the current latitude and longitude. Then monitor the stream every 10 seconds and alert me if the device moves outside a geofence of [48.8566, 2.3522] with a radius of 500 meters.”

The AI responds by using industrial_command(protocol='serial://COM4', command='read', ...) to read raw data from the COM port. It then parses the $GPGGA or $GPRMC sentences using pynmea2 (available in the sandbox). Here’s the core parsing logic the AI writes inside the execute_python environment:

import pynmea2
import json

# Simulated raw NMEA string (in reality, comes from industrial_command)
raw_nmea = "$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47"

msg = pynmea2.parse(raw_nmea)
latitude = msg.latitude
longitude = msg.longitude
print(f"Current position: {latitude}, {longitude}")

The AI then evaluates the geofence condition and, if triggered, sends a Telegram message via the slack_sdk or twilio library (also available in sandbox).

3. Chat with AI: Connect to the LoRaWAN Temperature Tag

Next, the user types:

“Connect to my LoRaWAN temperature tag on TTN. Application ID: ‘coldchain-app’, Device EUI: ‘A81758FFFE054321’, API key: ‘ttn-account-v2.xxxx’. Subscribe to the uplink topic and decode the payload. The payload is in Cayenne LPP format. Log the temperature and coordinates to a CSV file.”

The AI generates an MQTT subscriber script using paho-mqtt:

import paho.mqtt.client as mqtt
import json
import csv
from datetime import datetime

TTN_APP_ID = "coldchain-app"
DEVICE_EUI = "A81758FFFE054321"
API_KEY = "ttn-account-v2.xxxx"

BROKER = "eu1.cloud.thethings.network"
PORT = 1883
TOPIC = f"v3/{TTN_APP_ID}/devices/{DEVICE_EUI}/up"

def on_message(client, userdata, msg):
    payload = json.loads(msg.payload.decode())
    # Decode Cayenne LPP (simplified)
    decoded = payload.get("uplink_message", {}).get("decoded_payload", {})
    temp = decoded.get("temperature", {}).get("value")
    lat = decoded.get("latitude", {}).get("value")
    lon = decoded.get("longitude", {}).get("value")
    print(f"Temp: {temp}°C, Lat: {lat}, Lon: {lon}")
    # Append to CSV
    with open("tracking_log.csv", "a", newline="") as f:
        writer = csv.writer(f)
        writer.writerow([datetime.now(), temp, lat, lon])

client = mqtt.Client()
client.username_pw_set(DEVICE_EUI, API_KEY)
client.on_message = on_message
client.connect(BROKER, PORT, 60)
client.subscribe(TOPIC)
client.loop_start()

Because execute_python has a 30‑second timeout, the AI runs a single poll cycle, but the user can ask to “keep monitoring” — the AI will wrap the loop with a short time.sleep(10) and print results for each fetch.

4. Automating Inventory Reconciliation

Now the user asks:

“Take the CSV from the LoRaWAN tag and the GPS coordinates from the serial tracker. Compare them with the expected asset list in this JSON file: [{"asset_id":"GEN-01","expected_lat":48.8566,"expected_lon":2.3522}]. Flag any asset that is more than 100 meters from its expected location.”

The AI reads the JSON from the chat, loads the CSV, and computes Haversine distances using numpy:

import numpy as np
import csv
import json

def haversine(lat1, lon1, lat2, lon2):
    R = 6371000
    phi1, phi2 = np.radians(lat1), np.radians(lat2)
    dphi = np.radians(lat2 - lat1)
    dlambda = np.radians(lon2 - lon1)
    a = np.sin(dphi/2)**2 + np.cos(phi1)*np.cos(phi2)*np.sin(dlambda/2)**2
    return 2 * R * np.arcsin(np.sqrt(a))

# Load expected assets
with open("expected_assets.json") as f:
    expected = json.load(f)

# Load tracked positions
with open("tracking_log.csv") as f:
    reader = csv.DictReader(f)
    for row in reader:
        lat, lon = float(row["lat"]), float(row["lon"])
        for asset in expected:
            dist = haversine(lat, lon, asset["expected_lat"], asset["expected_lon"])
            if dist > 100:
                print(f"ALERT: {asset['asset_id']} is {dist:.0f}m away from expected location!")

The AI outputs the results directly in the chat, and the user can ask it to save the report or send it via email.

Real‑World Scenarios

Scenario 1: Warehouse Inventory with BLE Tags

A 3PL warehouse uses BLE tags on pallets. A Raspberry Pi with a Bluetooth dongle scans for tags every 30 seconds. Instead of writing a broker, the user connects the Pi to ASI Biont via SSH:

“SSH into 192.168.1.100 (user: pi, key: id_rsa). Run a Python script that uses bluepy to scan for BLE devices and prints their MAC addresses and RSSI values. Filter only tags with prefix ‘ASSET’. Return the list.”

The AI writes a paramiko script, runs it, and returns the list. The user can then ask:

“Check which tags are in zone A (RSSI > -70 on scanner_1) and zone B (RSSI > -70 on scanner_2). If a tag disappears from both zones for 5 minutes, send a Slack message.”

Scenario 2: Cold Chain GPS + Temperature Monitoring

A pharmaceutical company ships vaccines in a container with a LoRaWAN tracker (Dragino LGT‑92). The user connects the TTN MQTT feed to ASI Biont as shown above. The AI monitors temperature and location. If the temperature exceeds 8°C or the container leaves the authorised route, the AI sends an SMS via Twilio and logs the event.

Scenario 3: Tool Tracking on a Construction Site

A construction company attaches GPS trackers to expensive tools (generators, compressors). They set up a geofence around the site. The AI polls the GPS data every minute and compares it to the geofence. If a tool leaves the site, the AI calls the security team via Twilio voice (using the twilio library).

Why ASI Biont Changes the Game

Traditional asset tracking integrations require:
- Writing custom MQTT clients
- Setting up bridges between protocols
- Building dashboards and alerting logic
- Maintaining that code as devices change

With ASI Biont, you just describe what you want in a chat. The AI agent:
- Writes the connector code using proven libraries
- Executes it in a sandbox (or via bridge for serial)
- Returns results and can be asked to keep monitoring
- Adapts to new devices on the fly — no vendor lock‑in

The user doesn’t need to know Python, MQTT topics, or NMEA sentence structure. They just need to know what they want to track and where to find the connection parameters.

Conclusion

Asset tracking is no longer just about dots on a map. With ASI Biont, you can turn that location and sensor data into a conversational AI that watches your assets, predicts problems, and automates your workflows — all through a simple chat interface.

Whether you’re managing a warehouse, a fleet of delivery vehicles, or a hospital’s mobile equipment, the integration steps are the same:
1. Choose your connection method (COM port via bridge, MQTT, SSH, HTTP, OPC‑UA).
2. Tell the AI what to connect to and what to do.
3. Let the AI write the code and start tracking.

Ready to bring AI into your asset tracking? Try it now at asibiont.com — no coding required, just a conversation with your new AI agent.

← All posts

Comments