If you've ever worked with Teltonika GPS tracking devices, you know that parsing their proprietary protocol can be a bit of a challenge. Whether you're building a fleet management system, a custom IoT platform, or just tinkering with real-time vehicle telemetry, understanding and communicating with these devices is critical.
That's why I created teltonika-go — an open-source Go package that simplifies parsing Teltonika messages and enables communication with their devices over TCP.
📦 What is teltonika-go?
teltonika-go is a lightweight, idiomatic Go library designed to help developers decode, parse, and interpret the binary protocol used by Teltonika GPS trackers like the FMB series. It provides building blocks for server-side communication with these devices, which typically send AVL (Automatic Vehicle Location) data over TCP.
With teltonika-go, you can:
- Read and parse AVL packets sent by devices
- Understand GPS, IO, and timestamp data
- Handle device handshakes and codec types (including Codec8, Codec8 Extended and Codec16)
Build your own custom server or integrate Teltonika device communication into an existing Go application
✅ Why Use It?
Teltonika devices are widely used in the GPS tracking industry, but documentation is limited and most of it is not tailored to developers. If you're a Go developer, teltonika-go provides:
- A clean and idiomatic API
- No external dependencies (other than the Go standard library)
- Open-source flexibility (MIT License)
🔧 Getting Started
Install the package:
go get github.com/danieljvsa/teltonika-go
Example: Parse a TCP packet from a Teltonika FMB device.
package main
import (
"fmt"
pkg "github.com/danieljvsa/teltonika-go/pkg" //for general functions
tools "github.com/danieljvsa/teltonika-go/tools" //for functions that used in package to help in case only want to decode specific tram code
)
func main() {
// example binary data from a Teltonika device
rawLogin := []byte{ /* login packet */ }
rawTram := []byte{ /* AVL packet */ }
// Decode login packet
login := pkg.LoginDecoder(rawLogin)
if login.Error != nil {
fmt.Println("Login decode error:", login.Error)
} else {
fmt.Printf("Login decoded: %+v\n", login.Response)
}
// Decode AVL/tram packet
tram := pkg.TramDecoder(rawTram)
if tram.Error != nil {
fmt.Println("Tram decode error:", tram.Error)
} else {
fmt.Printf("Tram decoded: %+v\n", tram.Response)
}
}
🧱 Project Structure
The project is still in its early stages, but currently supports:
- Decode login packets
- Parse AVL records using Codecs 08, 8E and 16
- Validate and interpret Teltonika TCP/UDP headers
Feel free to check out the repo: https://github.com/danieljvsa/teltonika-go
🚧 Roadmap
The project is under active development, and here are some features on the horizon:
- Full support for Codec 12 and Codec 14
- Full support for encoding for commands with codecs 12, 13, 14, 15.
- Tools to send commands to devices (e.g., engine cut-off, configuration updates)
- Improved error handling and documentation
If you're working with Teltonika devices and using Go, I'd love your feedback and contributions!
🤝 Contributing
Contributions are welcome! If you find a bug, have a feature request, or just want to improve the code, feel free to open an issue or a pull request.
🙌 Final Thoughts
Parsing Teltonika’s binary protocol doesn’t need to be a pain. With teltonika-go, you can start building robust applications that speak Teltonika's language — all in idiomatic Go.
👉 Check out the project on GitHub: danieljvsa/teltonika-go
⭐ Star it if you find it useful, and let's make working with Teltonika devices easier together!
Source code: https://github.com/danieljvsa/teltonika-go
[hidden by post author]