Connecting FMB003 to Custom server

Hello all,
Please, I am new to Teltonika devices, and I wish to know how to connect my device to my local server to receive signals and readings from the device.
Please help me with a step-by-step guide or an example of what has previously worked.

Thanks.

Hello,

Prerequisites

Before you begin, ensure you have:

  • Teltonika device (e.g., FMB920, FMB120, FMC130, etc.)

  • Active SIM card with data plan (PIN disabled)

  • Teltonika Configurator software (download from Teltonika Wiki)

  • USB cable or Bluetooth connection to configure the device

  • Local server with a public IP address or domain name

  • Port forwarding configured on your router (if server is behind NAT)


Step 1: Prepare Your Device

  1. Insert SIM Card: Insert Micro-SIM card as shown with PIN request disabled

  2. Connect Battery: If your device has an internal battery, connect it

  3. Power Up: Power-up FMB920 with DC voltage 6-30 V power supply using power cable. LED’s should start blinking

  4. Connect to PC: Connect device to your computer via USB cable or Bluetooth


Step 2: Install and Open Configurator

  1. Download and install the Teltonika Configurator for your device model

  2. Install COM port drivers if prompted

  3. Open the Configurator application

  4. Connect to your device (it should auto-detect via USB or Bluetooth)

  5. Click “Load from device” to retrieve the current configuration


Step 3: Configure APN Settings (GPRS Connection)

Navigate to GPRS Settings in the Configurator:

  1. Enable GPRS Context: Make sure GPRS is enabled

  2. APN Configuration:

    • Access point name, a mandatory parameter which is used to connect to the internet (GPRS). Access Point Name is the name of a gateway between a mobile operator and the public internet. It can be obtained from your SIM card provider

    • Enter your carrier’s APN (e.g., “internet”, “data.carrier.com”)

    • Enter APN Username (if required by your carrier)

    • Enter APN Password (if required by your carrier)

Note: Some operators use a specific type of authentication for GPRS sessions – CHAP or PAP. If any of these is used, APN should be entered as “chap:” or “pap:” respectively e.g. if the operator is using APN “internet” with CHAP authentication, it should be entered as “chap: internet”. Information about APN and authentication type should be provided by your GSM operator


Step 4: Configure Server Settings

In the GPRS Settings section, configure your server connection:

First Server Settings:

  1. Domain (Parameter ID 2004):

    • Server or Domain adress, can be written either IP address or Domain

    • Enter your local server IP address (e.g., 192.168.1.100) or domain name (e.g., myserver.example.com)

    • Important: If using a local server, ensure it has a public IP or use a service like DynDNS

  2. Port (Parameter ID 2005):

    • Enter your server port (common ports: 5027, 12050, or your custom port)

    • Example: 5027

  3. Protocol (Parameter ID 2006):

    • Defines GPRS data transport protocol, used for data transfers – TCP or UDP. From the device side TCP and UDP work almost the same, only difference is that UDP doesn’t need additional confirmation from the server side, that the data packet was received. TCP has that, and uses more network data for the confirmation. The desired data transfer protocol can be selected through the configurator

    • Recommended: Select TCP for reliable data transmission

  4. TLS Encryption (Optional):

    • An additional option is the use of TLS encryption for sending records to the main server and backup server

    • Set to None (0) for basic setup, or enable if your server supports TLS


Step 5: Configure Data Protocol

Navigate to System Settings or Data Protocol:

  1. Select Data Protocol:

    • Choose Codec 8 or Codec 8 Extended (recommended for more parameters)

    • Codec8 – a main FM device protocol that is used for sending data to server

    • Codec8 Extended is used for FMBXXX family devices. This protocol looks familiar to Codec8 but they have some differences


Step 6: Configure Data Acquisition Settings

Navigate to Data Acquisition settings:

  1. Records Sending:

    • Can be set either Newest or Oldest. For example if the Oldest is marked the device first will send the Oldest information, if Newest then Device will send the newest information

    • Recommended: Select Oldest for chronological data

  2. Send Period: Set how often the device sends data (e.g., every 30 seconds, 60 seconds)

  3. Min Saved Records: Set to 1 for real-time data transmission

  4. Open Link Timeout: Set to 3600 seconds (1 hour) to keep connection alive

  5. Network Ping Timeout:

    • Enables network ping after timeout to prevent link close by operator. For example, if the operator closes the active link after 15 minutes when no data is sent, you can set the “network ping” timeout to 10 minutes then the device sends a 0xFF byte to server to keep the link open. Network Ping Timeout should be always lower than Open Link Timeout

    • Set to 300 seconds (5 minutes)


Step 7: Configure Time Synchronization

Important: default device configuration is to store/send records “after time sync”. Time can be synchronized using GNSS signal or NTP server

Options:

  • Wait for GPS fix (device will sync time from satellites)

  • Configure NTP server in System Settings

  • Or change “Records Saving/Sending Without TS” to Always (only when implementing solution in real world use its not recommended unless time is not important for your usecase)


Step 8: Save Configuration and Test

  1. Click “Save to device” in the Configurator

  2. Wait for confirmation that settings were saved


Step 9: Set Up Your Local Server

Your server needs to:

A. Listen for TCP Connections

Create a TCP/UDP server that listens on the port you configured (e.g., 5027)

B. Implement Teltonika Protocol

Connection Flow:

  1. Device sends IMEI:

    • the device will send you the IMEI. you have to answer with 0x01

      • Server must respond: 0x01 (1 byte) to accept connection
  2. Device sends data packets:

    • Preamble – the packet starts with four zero bytes. Data Field Length – size is calculated starting from Codec ID to Number of Data 2. Codec ID – in Codec8 it is always 0x08. Number of Data 1 – a number that defines how many records are in the packet

    • Packet structure: Codec - Teltonika Telematics Wiki

  3. Server acknowledges data:

    • you have to send the ACK (4 bytes with the number of avl records received, e.g. 0x00000001) number has to reflect how many records server have recieved in this ecample 1 record recieved so answer is 0x00000001 if 2 records- 0x00000002 and so on

    • Send 4 bytes containing the number of records received

C. Parse the Data

You can:

  • Use existing parsers:

    • Codec 8 documentation can found via URL bellow: https://wiki.teltonika-gps.com/view/Codec · Server - Device communication must work but not yet tested - works … TCP communaction - done! Codec 8 Extended structure parsing - done! Codec 8 structure parsing - done!

    • GitHub repositories available for various languages (Python, Node.js, Go, Java)

  • Implement your own parser following the Teltonika Data Sending Protocols documentation

D. Example Server Implementations

Available on GitHub:

This topic was automatically closed after 60 days. New replies are no longer allowed.