---
title: "W5500 Sending Data to UDP server"
url: "https://maker.wiznet.io/forum/11976"
markdown_url: "https://maker.wiznet.io/forum/11976/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "ColdKeyboard"
created: "2016-10-17T20:56:58+09:00"
last_activity: "2017-05-04T08:39:13+09:00"
language: "en"
views: 5612
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5500 Sending Data to UDP server

## Question

Asked by ColdKeyboard on 2016-10-17 in Ethernet Chips.

Hello,

I have W5500 setup and running. I checked the MAC and IP and the configuration is correct, also when I try to ping the IP of the W5500 I get the reply, so I’m guessing the W5500 is up and running.

Now I have the issue that I want to send some packets to the UDP server, and I’m trying to use sendto(SOCK_UDP, data, count, ip, port)

However, It looks like I’m doing something wrong… Can someone please post an explanation on how to send UDP packets to certain IP:PORT or point me to the documentation where I can learn more about this?

Thank you in advance!

## Replies

### Reply 1 by Edward, 2016-10-18

First, refer to ioLibrary Loopback code. (below link)

[github.com/Wiznet/ioLibrary_Driver](https://github.com/Wiznet/ioLibrary_Driver)

check to loopback_udps code. and follow to ‘sendto’ inside code.

And wireshark tool download. This tool is udp packet capture possible.

Also you must find internet to udp packet basic information.

Thank you

### Reply 2 by ColdKeyboard, 2016-10-18

Thank you Edward.

I’ve downloaded the Socket APIs Help (chm, html) from [wizwiki.net/wiki/doku.php?id=pro … 0:allpages](http://wizwiki.net/wiki/doku.php?id=products:w5500:allpages) and from there I’ve created a small code that looks like this

```
	uint8_t result;
	uint8_t *testBuffer 	= "Wiznet Says Hi!";
	uint8_t address[4]		= { 10, 10, 0, 24 };

	//
    while(1)
    {
    	result = socket(0, Sn_MR_UDP, 3000, SF_IO_NONBLOCK);
    	DEBUG_PRINTF("socket Result: %d\r\n", result);

    	result = sendto(0, testBuffer, strlen(testBuffer), address, 300);
    	DEBUG_PRINTF("sendto Result: %d\r\n", result);

    	delay_ms(1000);
    }
```

And I’m getting those packets over the Ethernet and capturing them via Wireshark.

---

Source: https://maker.wiznet.io/forum/11976
