UDP Out

What is udp-out node in Node-RED?

The udp-out node in Node-RED is a node used for sending UDP messages to a specified network destination. When you add a udp-out node to your Node-RED flow, you configure it with the IP address and port of the destination device or service. Then, any messages received by the udp-out node are sent as UDP packets to that destination. This node is particularly useful for applications where real-time communication or lightweight message transmission is required.

For more information on UDP refer to What is UDP

Configuring UDP-Out Node

  • Send to:

    • Choose the destination type:
      • Single IP: Specify the IP address of the target device or service. you can also specify the ip dynamically with msg.ip when this field left blank
      • Broadcast: Send the message to all devices on the network. you can either specify the address as the local broadcast IP address or use 255.255.255.255, which represents the global broadcast address.
      • Multicast: Send the message to a group of devices.
        • Group: Specify the multicast group address.
        • Local Interface: Select the network interface for sending multicast messages.
  • Port:

    • Specify the port number that the UDP packets will be sent to. you can also specify the ip dynamically with msg.port when this field left blank
  • Address:

    • Choose the type of address:
      • IPv4 Address: Specify an IPv4 address for the destination.
      • IPv6 Address: Specify an IPv6 address for the destination.
    • bind to random local port: When selected, the system automatically assigns an available local port for sending UDP packets.
    • bind to local port: When selected, you need to specify the local port number to which the UDP socket will be bound.
  • Decode Base64 encoded payload?:

    • Choose whether to decode the payload as Base64 before sending it. This option is useful if the payload is encoded in Base64 format and needs to be decoded before being sent as a UDP message.

Note: On some systems, you may need root or administrator access to use ports below 1024 and/or broadcast, and have to ensure your firewall allows the data in.

Note: The default UDP nodes have been removed from the Node-RED palette in the FlowFuse Cloud due to limitations in routing connections to the container running Node-RED inside the FlowFuse platform

Usecases

  • Sensor data transmission: Utilize the udp-out node to transmit real-time data acquired from IoT sensors deployed in the field, such as temperature, humidity, or motion sensor readings, to a centralized processing system or server for analysis and storage.
  • Environmental monitoring: Utilize the udp-out node to transmit environmental data collected from IoT devices, such as air quality sensors or weather stations, to a central server for analysis and decision-making.
  • Asset tracking: Utilize the udp-out node to send location data from IoT devices equipped with GPS or RFID technology to a tracking system for real-time monitoring of assets, vehicles, or livestock.
  • Media stream transmission: Employ the udp-out node to transmit media streams, such as video or audio content, for applications like live broadcasting, surveillance, or multimedia communication.

Example

  1. In the example below, we have a udp-out node configured to send data over localhost on port 90 and receive it with a udp-in node.

Node Documentation