Docs

Teltonika Gateways

Teltonika Networks gateways can be connected over Ethernet, 4G, LTE-M, or NB-IoT. They can directly connect Modbus devices to the Blockbax Platform (via Ethernet, RS232, RS485, or I/O interfaces). Blockbax can natively integrate with the Teltonika firmware to easily unlock the data and unleash its full potential.


Goal

The goal is to configure a Teltonika device to send data with Modbus or Bluetooth over the internet to Blockbax.

Prerequisites

Make sure you have the following configured on your router:

  1. Internet connection
  2. Access to the Teltonika WebUI

This tutorial is tested on the RUTX11, TRB140, and TRB255 (firmware version 00.07.07.1). However, the instructions on this page should work for other Teltonika devices and firmware as well.

Steps to setup the Modbus TCP Server
  1. Open the Teltonika WebUI.
  2. Go to: Services -> Modbus -> Modbus TCP Server.
  3. Toggle the “Enable” button.
  4. Configure a Device ID.

More information about the Modbus TCP Server can be found here.

Steps to set up the Modbus TCP Client
  1. Open the Teltonika WebUI.
  2. Go to Services -> Modbus -> Modbus TCP Client in the Teltonika WebUI.
  3. Press the “Add” button.
  4. On the next page, toggle the “Enable” button.
  5. Set the Server ID. For this example, we set it to our previously set Device ID, which was 1.
  6. Set the “IP address” and the “Port” to the endpoint of your Modbus TCP/IP server. For this example, we use the “IP address” 127.0.0.1 and the “Port” 502, which is the default port to access the internal Modbus TCP server.
  7. You can configure any “Period” you want in seconds and leave the “Timeout” for now.

More information about the Modbus TCP Client can be found here.

Steps to read out registers

Reading out registers is the same for both TCP and Serial. As an example, we read out the RUTX11 internal temperature from the Modbus TCP server, which has register number 6.

  1. On the same page where you just configured the Modbus Client, for example Modebus TCP Client, clik on the existing devices or add a new device.
  2. Under “Requests Configuration,” a new instance will appear.
  3. Configure the following fields:
    • Data Type: 32 bit integer, Byte order 1,2,3,4 (see Get Parameters)
    • Function: Read holding registers (3)
    • First Register: 6
    • Register Count: 2
  4. Toggle the “No brackets” switch to “on”.
  5. Toggle the “Enable” switch to “on”.

After configuring the request, you can test it to ensure it works correctly:

  1. Go to the “Request Configuration Testing” section.
  2. In the “Requests” list, select the instance name you want to test.
  3. Press the “Test” button.

If all is set up correctly, a value should appear. Make sure this value is a valid number without brackets. Additional information to configure a request can be found here.

Setting up the Data to Server Service

Now that you have access to Modbus data, the Teltonika device can be configured to send data to Blockbax. For this, we are using the Data to Server service within the device. Before you create a “Data Sender,” make sure you have set up an MQTT or HTTPS inbound connector to push data to.

  1. Open the Teltonika WebUI.
  2. Go to Services -> Data To Server.
  3. Under “Add new instance”, type a collection name and click on “Add”.
  4. In the Data configuration tab, fill in a Name and select “Modbus” as the data type.
  5. For the format type, select JSON. You can choose a custom formatting as well, but use the default format if you want to use the inbound connector templates.
  6. Change the data filtering, if you want to override the server IP address or Id or the request name.
  7. Set the Segment count to the number of requests added in the Request Configuration.
  8. Turn off “Send as object”.
  9. In the collection configuration tab, choose the Period to send data to inbound connector (default 60)

Now you are redirected to the Server configuration. Here you can chose between the HTTP or MQTT communication type.

For HTTP integration:
  1. Chose the Type as HTTP.

  2. In the Server address paste the HTTPS endpoint from inbound connectors: https://api.blockbax.com/v1/projects/<PROJECT_ID>/measurements?inboundConnectorId=<INBOUND_CONNECTOR_ID>

  3. Add the following headers inside the “HTTP headers” section. Make sure you press the + icon after adding each individual header:

    Authorization: ApiKey <API_key>
    
    Content-Type: application/json
    
  4. This will bring you back to the “Data Senders”; press “Save & Apply” when you are done.

Alternatively, you can chose an MQTT connection type in the server configuration.

For the MQTT integration:
  1. Choose the Type as MQTT.
  2. Use mqtt.blockbax.com as the server address.
  3. Use port 8883
  4. In the topic section, paste the topic from inbound connectors: v1/projects/<PROJECT_ID>/measurements?inboundConnectorId=<INBOUND_CONNECTOR_ID>/measurements
  5. In the Server address paste the HTTPS endpoint from inbound connectors: https://api.blockbax.com/v1/projects/<PROJECT_ID>/measurements?inboundConnectorId=<INBOUND_CONNECTOR_ID>
  6. For the Client ID use an arbitrary id that is prefixed with the public ID of your access key.
  7. Toggle on the Use credentials.
  8. For the Username, use the public ID of your access key.
  9. For the password, use the secret of your access key.
  10. For the QoS, use 1 (at least once) or 0 (at most once).
  11. This will bring you back to the “Data Senders”. Press “Save & Apply” when you are done.
Using the inbound connector template

To parse the incoming data in Blockbax, you can use the inbound connector template. This allows you to ingest data without writing your own parser. Follow the steps below to set it up.

1. Set up the subject composition in Blockbax

The inbound connector expects a specific format for subject and metric external IDs when ingesting the default Teltonika raw JSON.

Subject external ID:
<server_name>-<server_id>

For example, if in the Modbus TCP Client setup you created a client named Demo with Server ID 1, then your subject external ID will be:

Demo-1

You can either:

  • Create the subject manually in Blockbax using this external ID format, or
  • Enable auto-creation in the inbound connector template so it will automatically create subjects when new data arrives.

Metric external ID:
The metric external ID corresponds to the full_addr field in the raw record.

To form the full Modbus address, use the conventional register prefix followed by a 5-digit register address.
For example, the 6th Holding Register has the full address:

400006

You can then create a numeric metric in Blockbax with external ID 400006 to ingest the internal temperature values.

Notes:

  • Metric data type:

    • Use number metrics for float or integer values.
    • Use text metrics for ASCII representations.
  • Location parsing:
    If your device sends both latitude and longitude (for example from registers 144 and 146), the template automatically combines them into a location.
    To ingest this data in Blockbax:

    • Create a location metric with external ID location.
    • Latitude and longitude values are also parsed separately as numeric metrics with external IDs 400144 and 400146, respectively.
2. Use the inbound connector template in Blockbax
  1. Go to your inbound connector in Blockbax.
  2. Click Edit, then select Use preset.
  3. Under Teltonika, choose RUTX router Modbus.
  4. The default connection protocol is HTTP POST. Change it to MQTT publish if you are using MQTT.
  5. Click Show advanced settings to test the payload and to make adjustments in the payload conversion in case you want to transform the data before ingesting into Blockbax.

Note:
The template is based on the RUTX11 firmware, which contains the superset of registers used by other Teltonika models. It should therefore work across most firmware versions.
If you’d like to expand, improve, or contribute to this template, feel free to visit our integration templates on GitHub.

Troubleshooting common issues

Issue: Data to Server and Modbus Client settings are configured, but no data appears in Blockbax

Solution:

  1. First, verify the Request Configuration Testing (see steps to read out registers) succeeds with a message such as:

    Request successful, result: <Some number>
    

    If the Modbus TCP client test works, continue to the next step.

  2. Confirm your Teltonika device has internet access:

    • Navigate to System -> Maintenance -> Troubleshoot -> Diagnostics.
    • Try pinging an external IP like 8.8.8.8.
    • If the ping fails, your connection settings need adjustment.
  3. If using a cellular connection, ensure the APN settings are correctly configured.

  4. If using a wired (Ethernet) connection:

    • Verify the Ethernet cable is connected to the WAN port of the Teltonika router.
    • Check under Network -> WAN that the interface has obtained an IP address and is running.
  5. If using WLAN:

    • Confirm the WLAN interface is assigned to the correct WAN network.
    • Adjust and reorder connection priorities as needed.
  6. If internet connectivity is confirmed but data still does not appear in Blockbax:

    • Double-check your Blockbax connection settings and credentials.
    • Inspect system logs under System -> Maintenance -> Troubleshoot -> General for additional clues.

Additional note:
By default, the firewall rule ENABLE_HTTPS_WAN is disabled. If you want remote access to your Teltonika WebUI over the internet, you must enable this rule. Use this option with caution.

Great job! You can now go back to the inbound connectors overview and confirm the data is coming in. You can now use the template for the Teltonika integration in Blockbax inbound connector to ingest data in Blockbax. To do that you need to first prepare the subject composition. Create a subject type and add metrics you want to ingest. The external id of these metrics should match the “full_addr” entry from your raw data. For example if you have the GPS data in your payload, then you can add a metric with external id 400146 to ingest the