Ubuntu server on EC2 - Edge compute device

Hi there,
I have set up an EC2 instance with Ubuntu and I have installed the Gateway Edge Agent, and it’s connected to an Edge Compute device.
The server needs to listen for inbound messages on a UDP port. I assumed I’d only have to use the UDP node in an edge workflow to get the messages but it doesn’t appear to be the case.
I saw here that @Brandon_Cannaday had play with a similar setup, would anyone happen to have some guidelines?

@Jules_Huguenin,

Would you be able to share the Docker command you used to start up the Edge Agent? We have some guidance in our documentation regarding passing UDP ports and data to the Edge Agent.

Thank you,
Heath

Hi @Heath
Below is the UDP config in the device config file:


I assume I don’t need to change anything?

Outbound messages from the IoT devices are going to the server port 20500. Here is the docker command I have used:


I’m a bit lost between the port in the container and the port in the host, I guess my mistake is here?

For the GEA workflow I have used a UDP node to log incoming messages:

Thanks for sending along all that info @Jules_Huguenin.

You will need to uncomment the lines in your configuration file. So, your updated UDP config section will look like this:

[udp]
# Address for UDP server - CLI: --udp-address, EnvVar: UDP_ADDRESS
address = '0.0.0.0'

EDIT: The UDP address for the Edge Agent defaults to 0.0.0.0, so uncommenting the address in the config is only necessary if you plan on changing the UDP address.

Then, in your Docker Run command, it looks like you may have mixed up the ports. The -p flag is hostPort:containerPort. If your server is expecting UDP messages on port 20500, then you’ll need to change that publish line to -p 20500:20500/udp.

I will make some updates to our documentation to better reflect what needs to be done to make this work.

Let me know if this works for you.

Thank you,
Heath

Thanks @Heath, it works now!
I didn’t realise the potential of the GEA, it’s going to help me lots.

For my own understanding, what is the UDP address in the config file?
Cheers
Jules

We love hearing that! As always, as you work with and have any questions, don’t hesitate to reach out!

For my own understanding, what is the UDP address in the config file?

The UDP address allows you to identify the IP address of the machine that is running this UDP server. In most cases, the IP address of the device (0.0.0.0 for example) works, but there are some cases where you may have multiple network interfaces on your machine and you want to listen for UDP messages on one a specific interface.

Let me know if that makes sense or if there is anything I can expand on.

Thank you,
Heath

1 Like