Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read, how they find the site and where they get stuck, so we can improve it (Google Analytics, Microsoft Clarity).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, LinkedIn, Meta, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors
180 Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

UDP Integration

UDP Integration receives data from devices that send it over UDP and converts the payload into ThingsBoard telemetry and attributes. It also supports downlink: the Edge can send a message back through the same UDP socket.

  • A ThingsBoard server with tenant administrator access. The templates are created there.
  • A ThingsBoard Edge instance connected to the server.
  • Docker on the machine that will run the UDP integration service. UDP port 11560 must be open for incoming packets there.
  • The echo command and netcat (nc) to simulate a device.

The example device SN-001 sends temperature and humidity readings to port 11560. Pick the payload format that matches your device:

SN-001,default,temperature,25.7,humidity,69

Converter templates are created on the server. The uplink converter decodes the UDP payload into telemetry and attributes. The downlink converter encodes messages from the rule engine, for example shared attribute updates, into the message sent back to the device.

  1. On the server, go to Edge management > Templates and open the Converter tab. Click Add data converter and select Create new converter.

  2. Set Converter type to Uplink, select UDP as the Integration type, and enter the name UDP uplink converter.

  3. In Main decoding configuration, select JS, paste the script for your payload format, and click Add.

    /** Decoder **/
    // decode payload to string
    var strArray = decodeToString(payload);
    var payloadArray = strArray.replace(/\"/g, "").replace(/\s/g, "").replace(/\\n/g, "").split(',');
    var telemetryPayload = {};
    for (var i = 2; i < payloadArray.length; i = i + 2) {
    var telemetryKey = payloadArray[i];
    var telemetryValue = parseFloat(payloadArray[i + 1]);

To change a converter later, open it on the Converter tab, click the pencil icon, edit the script, and click the checkmark icon. The change is pushed to every Edge that uses it.

  1. On the Converter tab, click Add data converter and select Create new converter.

  2. Set Converter type to Downlink, select UDP as the Integration type, and enter the name UDP downlink converter.

  3. In Main encoding configuration, select JS, paste the following script, and click Add:

    // Encode downlink data from incoming Rule Engine message
    // msg - JSON message payload
    // msgType - e.g. 'ATTRIBUTES_UPDATED', 'POST_TELEMETRY_REQUEST'
    // metadata - key/value pairs with message metadata
    // integrationMetadata - key/value pairs defined in the Integration
    var result = {
    // downlink data content type: JSON, TEXT or BINARY (base64 format)
    contentType: "JSON",
  1. On the server, go to Edge management > Templates, open the Integration tab, and click Add integration.

  2. On the Basic settings step, select UDP as the Integration type. Keep the name UDP integration or enter your own. Click Next.

  3. On the Uplink data converter step, select Select existing, choose UDP uplink converter, and click Next.

  4. On the Downlink data converter step, select Select existing, choose UDP downlink converter, and click Next.

  5. On the Connection step, keep Port at 11560 (or enter another free port). Under Handler Configuration, select the handler for your payload format:

    Field Value
    Handler Configuration TEXT
    Charset Name UTF-8 (the default)
  6. Execute remotely is enabled and cannot be turned off, because UDP Integration runs only as a remote service. Copy the Integration key and Integration secret shown under it. You need them to start the service.

  7. Click Add.

The other settings on the Connection step keep their defaults:

Setting Description
Size of the buffer for inbound socket (in KB) Socket receive buffer size.
Cache Size Maximum number of cached UDP sessions.
Cache time to live in minutes How long a UDP session stays in the cache.
Enable broadcast - integration will accepts broadcast address packets Accepts packets sent to the broadcast address.
  1. On the server, go to Edge management > Edges and click the Edge. On the Details tab, click Manage integrations.

  2. Click Assign to edge (+), select UDP integration, and click Assign.

  3. Log in to the Edge and go to Integrations > Integrations. The UDP integration is listed there.

Install and run the remote UDP integration

Section titled “Install and run the remote UDP integration”

The remote service connects to the Edge through the integration RPC port, 9090 by default (INTEGRATIONS_RPC_PORT in tb-edge.yml), and identifies itself with the Integration key and Integration secret of the template. See also Remote integrations.

  1. Pull the image:

    Terminal window
    docker pull thingsboard/tb-tcp-udp-integration:4.4.0.2
  2. Create a directory for the logs:

    Terminal window
    mkdir -p ~/.tb-pe-tcp-udp-integration-logs && sudo chown -R 799:799 ~/.tb-pe-tcp-udp-integration-logs
  3. Start the service. Replace the placeholders with your values:

    Terminal window
    docker run -it -p 11560:11560/udp \
    -v ~/.tb-pe-tcp-udp-integration-logs:/var/log/tb-tcp-udp-integration \
    -e "RPC_HOST=mytbedge" \
    -e "RPC_PORT=9090" \
    -e "INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEY" \
    -e "INTEGRATION_SECRET=YOUR_SECRET" \
    --name my-tb-pe-tcp-udp-integration \
    --network NETWORK_NAME \
    --restart always \
    thingsboard/tb-tcp-udp-integration:4.4.0.2
    Parameter Description
    mytbedge Hostname of the Edge service
    9090 Integration RPC port of the Edge
    -p 11560:11560/udp Publishes UDP port 11560 of the container on the host
    YOUR_ROUTING_KEY Integration key of the template
    YOUR_SECRET Integration secret of the template
    NETWORK_NAME Docker network of the Edge container. Find it with docker network ls.

To detach from the container without stopping it, press Ctrl+p then Ctrl+q. Useful commands:

Terminal window
docker attach my-tb-pe-tcp-udp-integration # reattach to the logs
docker stop my-tb-pe-tcp-udp-integration
docker start my-tb-pe-tcp-udp-integration

Once the service is running, it listens on UDP port 11560.

  1. Send a test message with echo and nc. Pick the command for your payload format:

    Terminal window
    echo -e 'SN-001,default,temperature,25.7,humidity,69' | nc -w5 -u 127.0.0.1 11560
  2. On the Edge, go to Integrations > Integrations, open the UDP integration, and select the Events tab. An Uplink event with status OK appears.

  3. The device SN-001 is created automatically. On the Edge, go to Devices & assets > Devices, open it, and select the Latest telemetry tab to see the received values.

  4. To see how the converter processed the message, go to Integrations > Data converters, open UDP uplink converter, and select the Events tab. Click the three dots in the In column to see the raw payload, or in the Out column to see the decoded result.

To send messages from the rule engine to the integration, add an integration downlink node to the root rule chain of the Edge.

  1. On the Edge, go to Data processing > Rule chains and open Edge Root Rule Chain.

  2. In the node search field, type integration downlink and drag the integration downlink node onto the canvas.

  3. Enter a name, select UDP integration in the Integration field, and click Add.

  4. Connect the message type switch node to the new node and select the Attributes Updated link label.

  5. Click the checkmark icon to save the rule chain.

The integration sends the downlink to the address the device last sent a packet from, as long as its UDP session is still cached. In the test below, nc sends the uplink and then waits 120 seconds for the response.

  1. Send an uplink message with -q120, so that nc keeps waiting for the response:

    Terminal window
    echo -e 'SN-001,default,temperature,25.7,humidity,69' | nc -q120 -u 127.0.0.1 11560
  2. Within these 120 seconds, on the Edge, go to Devices & assets > Devices, open SN-001, and select the Attributes tab. Select the Shared attributes scope, click +, enter the key firmware and the value v1.0, and click Add.

  3. Open the Events tab of the integration. A Downlink event with status OK appears.

  4. The terminal prints the response from the Edge:

    {"firmware":"v1.0"}