You own a fleet of delivery vans, a few construction drones, or an autonomous rover that tends to wander. Each one has a GPS module — likely a u-blox NEO-6M or NEO-8M — spitting out NMEA 0183 sentences at 9600 baud. The data is there: latitude, longitude, speed, heading. But getting that data into a monitoring dashboard, setting up geofence alerts, and connecting it to your existing logistics software has traditionally meant writing custom parsers, building APIs, and babysitting serial ports.
ASI Biont turns that effort into a conversation. It is an AI agent that connects to any device over any protocol — COM port, MQTT, Modbus, HTTP, and a dozen others — and writes the integration code itself. Instead of spending days on a REST API and a React map component, you simply chat with ASI Biont and describe the hardware. The AI does the rest. In this article, we'll show you how to connect a NEO-6M/NEO-8M GPS module to ASI Biont, with concrete Python examples, wiring diagrams, and real-world logistics scenarios.
Why Connect a GPS Sensor to an AI Agent?
GPS is one of the most well-understood sensors in the embedded world. The NEO-6M is a 15-year-old design, and the NEO-8M is its slightly more sensitive successor. Both output the same standardizes NMEA sentences. The challenge is not reading the data — it's using it efficiently.
A logistics company with 50 delivery vehicles generates roughly 4,320,000 position fixes per day (50 vehicles × 1 fix per second × 86400 seconds). Nobody wants to manually inspect that stream. An AI agent can monitor the positions, compare them to defined geofences, calculate ETAs, detect speeding, and even flag when a vehicle stops longer than a scheduled break.
ASI Biont is not a ready-made fleet management SaaS. It is a programmable AI that lives in your infrastructure. You bring the hardware and the data stream; it brings the intelligence and the automation. Because it writes Python code on the fly, it can adapt to whatever combination of GPS modules and microcontrollers you have.
Which Connection Method Is Right for You?
There are three practical ways to get GPS data from a NEO-6M/NEO-8M into ASI Biont. Each has its own use case.
1. Direct Serial via Hardware Bridge (Recommended for Laptops and Single-Board Computers)
The Hardware Bridge, bridge.py, is a small utility you download from the ASI Biont dashboard. It opens a COM port on your machine (e.g., COM3 or /dev/ttyUSB0) and streams the data to the AI agent. You specify the port and baud rate when launching the bridge, and then use industrial_command() to read from the port.
This is the most direct path, and the one we'll explore with a full code example.
2. MQTT via an ESP32 or Other Microcontroller (Best for Distributed Robots)
When your GPS module rides on a robot, the robot's MCU (ESP32, Raspberry Pi Pico, STM32) handles the serial parsing and publishes a clean JSON message to an MQTT broker. ASI Biont subscribes to that topic and processes the positions. This is the standard pattern for a fleet of autonomous mobile robots.
3. Universal execute_python (For Everything Else)
If you have an industrial controller, a PLC, or a proprietary gateway, ASI Biont can still connect via execute_python. You simply describe the device parameters — IP address, port, baud rate, protocol — and the AI writes a Python script using pyserial, pymodbus, aiohttp, or any other library it needs. This is the fallback that works for 99.9% of devices.
Wiring the NEO-6M/NEO-8M to a Computer or Microcontroller
Let's start with the physical connection. The NEO-6M and NEO-8M both expose TTL-level UART pins. You cannot connect them directly to a PC's RS-232 serial port without a level converter. Instead, use a USB-to-TTL adapter (CP2102, CH340, FTDI).
Wiring to a USB-TTL Adapter
| GPS Module | USB-TTL Adapter | Notes |
|---|---|---|
| VCC | 5V or 3.3V | NEO-6M works with 5V; NEO-8M should be 3.3V to avoid damage |
| GND | GND | Common ground |
| TX | RX | GPS transmitter goes to adapter receiver |
| RX | TX | GPS receiver goes to adapter transmitter |
USB-TTL NEO-6M/NEO-8M
RX <-------- TX
TX --------> RX
GND --------- GND
VCC --------- VCC
On Windows, the adapter usually maps to COM3 or higher. On Linux it becomes /dev/ttyUSB0. Verify with dmesg or Device Manager.
Wiring to an ESP32
If you're building a robot, the ESP32 is a great companion for a GPS module. It has multiple UART peripherals and built-in Wi-Fi.
| ESP32 Pin | GPS Module Pin |
|---|---|
| 3V3 | VCC |
| GND | GND |
| GPIO16 | TX |
| GPIO17 | RX |
Use a level shifter if your GPS module is not 3.3V tolerant. The NEO-8M breakout boards are usually safe, but double-check the datasheet.
Integration 1: Direct Serial Connection with Hardware Bridge
This is the fastest way to get a GPS module talking to ASI Biont. Follow these steps.
Step 1: Download and Launch the Bridge
Go to your ASI Biont dashboard and download bridge.py (the link is under the Devices section). Then open a terminal and run:
python bridge.py --token=YOUR_TOKEN --ports=COM3 --baud 9600 --rate=1
Replace COM3 with your actual port. The --rate=1 tells the bridge to sample the serial port once per second.
Step 2: Ask ASI Biont to Read GPS Data
In the ASI Biont chat, type:
"Read the current GPS position from COM3 at 9600 baud."
The AI will respond with an industrial_command() call to the bridge. Here's the Python it might generate and execute:
import json
response = industrial_command(
protocol='serial',
command='read',
port='COM3',
max_bytes=256,
timeout=2
)
raw_data = response['data']
for line in raw_data.splitlines():
if line.startswith('$GPGGA'):
# parse and print the position
print(line)
The bridge returns raw NMEA data. The AI then parses it using a standard $GPGGA handler.
Step 3: Parsing NMEA 0183 in Python
Here is a robust parser for a $GPGGA sentence. You can ask ASI Biont to include this in future scripts, or let it generate a more elaborate one with checksum verification.
import re
def parse_gpgga(sentence):
if not sentence.startswith('$GPGGA'):
return None
parts = sentence.split(',')
if len(parts) < 7:
return None
if parts[6] == '0': # No fix
return None
try:
lat_raw = float(parts[2])
lon_raw = float(parts[4])
lat_deg = int(lat_raw / 100)
lon_deg = int(lon_raw / 100)
lat_min = (lat_raw - lat_deg * 100) / 60.0
lon_min = (lon_raw - lon_deg * 100) / 60.0
lat = lat_deg + lat_min
lon = lon_deg + lon_min
except ValueError:
return None
return {
'latitude': lat if parts[3] == 'N' else -lat,
'longitude': lon if parts[5] == 'E' else -lon,
'satellites': int(parts[7]) if parts[7] else 0,
'fix': True
}
Once you have positional data, you can start automating.
Integration 2: ESP32 + NEO-6M + MQTT (For a Fleet of Robots)
Direct serial is fine for a single vehicle, but when you have 10 robots, you want them to push data over Wi-Fi. An ESP32 with a NEO-6M is the cheapest way to do this.
MicroPython Code Example
Below is a minimal MicroPython script that reads NMEA data from a UART pin and publishes the position as JSON over MQTT. This is a starting point; ASI Biont will generate a complete version when you describe your hardware in chat.
from machine import UART, Pin
import time, ujson
import network
from umqtt.simple import MQTTClient
uart = UART(2, baudrate=9600, tx=Pin(17), rx=Pin(16))
uart.init(9600, bits=8, parity=None, stop=1)
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect('YOUR_SSID', 'YOUR_PASS')
time.sleep(3)
mqtt = MQTTClient('gps_rover_01', '192.168.1.100', 1883)
mqtt.connect()
while True:
line = uart.readline()
if line:
line = line.decode('utf-8').strip()
if line.startswith('$GPGGA'):
# parse in same way as above
pos = parse_gpgga(line)
if pos:
mqtt.publish('rover/gps/01', ujson.dumps(pos))
time.sleep(0.5)
The ESP32 connects to your Wi-Fi and publishes position updates every half second. On the ASI Biont side, you subscribe to the topic using MQTT. For example, in the chat you could say:
"Subscribe to rover/# and show me all positions on a map. Alert me if a rover leaves the yard."
The AI will set up a geofence and send Telegram notifications when the rule is violated. (To send Telegram messages, the AI uses requests.post to https://api.telegram.org/bot<TOKEN>/sendMessage — an integration you can just describe in chat.)
Real-World Scenario: Construction Site Asset Tracking
A construction company in the Netherlands needed to track 14 excavators and wheel loaders spread across three sites. Each machine was fitted with a waterproof enclosure containing an ESP32, a NEO-8M GPS module, and a small 3.7V LiPo battery that lasted about 48 hours between charges. The ESP32 published a JSON message to a central MQTT broker every ten seconds.
The company asked ASI Biont to do the following:
- Subscribe to
site/{machine_id}/gps. - Maintain a real-time map in a dashboard.
- Send a Telegram alert if any machine moves outside its designated polygon between 20:00 and 06:00.
- Generate a daily shift report with total working hours (derived from motion detection, not engine telemetry) and estimated fuel usage.
The AI agent wrote the Python code, tested it against a live data stream, and deployed it in about forty minutes. The geofencing logic used the Shapely library to test point-in-polygon, and the report was sent as a formatted message to the site manager's Telegram. The system has been running since March 2026, and the only maintenance was swapping batteries every two days (later replaced by solar panels).
This is a textbook example of how an AI agent turns a raw sensor stream into a business asset. The same pattern applies to package delivery, drone surveillance, and even wildlife tracking.
Going Further with execute_python
The GPS module is just one sensor. ASI Biont's execute_python method means you can connect almost any device simply by describing it. For example:
"I have a ProSoft PLX31-EIP-MBTCP gateway bridging EtherNet/IP to Modbus. The GPS data is in Modbus registers 40001 to 40012. Read those registers every second and log them."
The AI will write a Python script using pymodbus and pycomm3, test it in the sandbox, and return the parsed coordinates. No driver development, no waiting for a firmware update.
If your device speaks BACnet (HVAC), OPC-UA (industrial sensors), or CAN bus, ASI Biont has connectors for those too — all invoked through the chat interface. The barrier to entry is not protocol support; it is your willingness to describe the problem.
Security and Reliability Considerations
Before deploying a GPS tracking solution, consider these points:
- The Hardware Bridge does not expose an HTTP API. You must use
industrial_command()from the ASI Biont chat interface. Never expose the bridge port to the public internet. - Always use timeouts in
execute_pythonscripts. The sandbox enforces a 30-second limit, so design your code to read a few samples, not loop forever. - GPS modules can lose fix. Build in a "fix timeout" and fallback logic. The NEO-6M can take up to 60 seconds to get a cold fix; the NEO-8M is faster but still needs clear sky.
- If you use Wi-Fi on an ESP32, make sure it reconnects after signal loss. The MicroPython
umqttclient does not auto-reconnect by default, so add a retry loop.
The lessons we've discussed are grounded in real hardware: the NMEA 0183 protocol is an actual standard (NMEA 0183, Version 4.10, published by the National Marine Electronics Association), and u-blox NEO-6/NEO-8 data sheets are publicly available for reference. No magic, just solid engineering.
Try It Yourself
You do not need a full fleet to see the value. Take a NEO-6M, a $5 USB-TTL adapter, and your laptop. Download bridge.py from asibiont.com, run it with your token, and type: "Show me my current GPS position." The AI will parse the NMEA stream and open a map in your chat window — in under a minute.
Once you see how fast the AI bridges the gap between silicon and intelligence, you'll never go back to writing integration glue code manually. Head over to asibiont.com, create your free account, and start automating your logistics today.
Comments