# RS232 to UDP Message

**URL:** <https://forums.losant.com/t/rs232-to-udp-message/3394>\
**Category:** Help\
**Tags:** edge\
**Created:** [November 11, 2020, 8:46pm UTC](https://forums.losant.com/t/rs232-to-udp-message/3394 "2020-11-11T20:46:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_GM](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@Chris\_GM](https://forums.losant.com/u/Chris_GM)\
**Post date:** [November 11, 2020, 8:46pm UTC](https://forums.losant.com/t/rs232-to-udp-message/3394/1 "2020-11-11T20:46:00Z")

</div>

My application is capturing outbound RS232 messages from an industrial machine, and sending through to a Losant workflow for processing.

I am struggling to send data to an edge device using UDP.

I have an industrial LTE router, which has an RS232 to UDP feature.

I have set a Pi3B+ running the edge agent, and I believe I’ve opened up the UDP port following various forum posts and docker documentation.

I have proven my USB-Serial adapter works with the router, so the only variables left are:

1. Router Configuration
2. Docker Settings
3. Workflow Settings

1 -

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/1/11d3b090fc33b36ae3f957d6fb4db34736e46b35.png)

2 -

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/c/c694e800d6b8b0ccf0d10adf092e1cd9f7986efe.png)

3 -

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/f/fd072ccd5d7caf2c67068a076e6008937a79bd40.png)

I have tried connecting to 0.0.0.0 instead of 192.168.1.8 (Pi Address), however this also doesn’t work.

Do you have any ideas of what I might be able to try next?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Heath](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/heath/32/3036_2.png) [@Heath](https://forums.losant.com/u/Heath)\
**Post date:** [November 11, 2020, 9:46pm UTC](https://forums.losant.com/t/rs232-to-udp-message/3394/3 "2020-11-11T21:46:27Z")

</div>

Hey @Chris_GM,

Welcome to the Losant Forums. We’re very excited you’re here!

Would you be able to share with me the contents of the `toml` file you’re using for your Edge Agent configuration? I just want to confirm that you have enabled the UDP Server on the Edge. You can read more about it in [our Supported Edge Protocols Documentation](https://docs.losant.com/edge-compute/supported-edge-protocols/#udp).

Could you share, also, the command you are using the spin up the docker container with the Edge Agent in it?

Thank you so much,  
Heath

---

<div class="post-metadata">

**Author:** ![Chris\_GM](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@Chris\_GM](https://forums.losant.com/u/Chris_GM)\
**Post date:** [November 12, 2020, 8:08am UTC](https://forums.losant.com/t/rs232-to-udp-message/3394/5 "2020-11-12T08:08:33Z")

</div>

Hi @Heath, thanks for your quick reply.

Based on the fact that I’m not using any specific toml file, I think you’re on to something!

I did try using a toml command from the documentation, but I now see this wouldn’t work without creating the file with vim.

Here is my run command currently:

sudo docker run -d --restart always --name docs-agent --publish 8080:8080/udp   
-e ‘DEVICE\_ID=XXX’   
-e ‘ACCESS\_KEY=XXX’   
-e ‘ACCESS\_SECRET=XXX’   
-v /var/lib/losant-edge-agent/data:/data   
losant/edge-agent

---

<div class="post-metadata">

**Author:** ![Chris\_GM](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@Chris\_GM](https://forums.losant.com/u/Chris_GM)\
**Post date:** [November 14, 2020, 2:06pm UTC](https://forums.losant.com/t/rs232-to-udp-message/3394/8 "2020-11-14T14:06:05Z")

</div>

So I’ve created, and edited the file in vim with:

sudo vim /var/lib/losant-edge-agent/config.toml

" [udp]  
" # Address for UDP server - CLI: --udp-address, EnvVar: UDP\_ADDRESS  
" address = ‘192.168.1.9’

Note ip has now changed. I redeployed ubuntu.

I then spin up using:

sudo docker run -d --restart always --name docs-agent   
-e ‘DEVICE\_ID=XXX’   
-e ‘ACCESS\_KEY=YYY’   
-e ‘ACCESS\_SECRET=ZZZ’   
-v /var/lib/losant-edge-agent/data:/data   
-v /var/lib/losant-edge-agent/config.toml:/etc/losant/losant-edge-agent-config.toml   
-p 2395:2395/udp   
losant/edge-agent

Note, I have tried a different port in case 8080 was an issue.

The device connects OK, however still no UDP messages passed through.

I have used this command:  
echo “This is my data” \> /dev/udp/192.168.1.9/2395  
I do get a UDP message into my edge workflow debug log.

Suspect my modem is not outputting the UDP message.  
Or my edge device is not letting it in.

I have downloaded wireshark to see if I can debug this, but I’m not that familiar with it.

---

<div class="post-metadata">

**Author:** ![Heath](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/heath/32/3036_2.png) [@Heath](https://forums.losant.com/u/Heath)\
**Post date:** [November 16, 2020, 9:33pm UTC](https://forums.losant.com/t/rs232-to-udp-message/3394/10 "2020-11-16T21:33:17Z")

</div>

Hey @Chris_GM,

Thanks for all that information, it’s a huge help!

I spoke with some of our folks here who are familiar with UDP about what you’re experiencing. Once you have the container running, you can run the command (on your RPi), `nc -u localhost 2395 testing UDP message on 2395` and see if your workflow picks that up as well.

You can also run this command from a different unix-based machine on the same network with `nc -u <ip-address-of-pi> 2395 ...`. This would confirm that the RPi (and the Edge Agent) are receiving UDP messages, and the issue may lie within your Modem or Edge Device.

I am going to do some testing with a container on my machine in the meantime. I’ll be sure to update you with anything I find as well.

Thank you,  
Heath
