---
title: "Exhange data beween 2 wizfi250 in udp mode"
url: "https://maker.wiznet.io/forum/10286"
markdown_url: "https://maker.wiznet.io/forum/10286/md"
type: "Forum topic"
category: "Wireless"
author: "anglial"
created: "2014-06-05T09:00:05+09:00"
last_activity: "2017-05-04T08:33:15+09:00"
language: "en"
views: 625
replies: 7
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Exhange data beween 2 wizfi250 in udp mode

## Question

Asked by anglial on 2014-06-05 in Wireless.

I am trying to establish a network with 2 of these modules. I have them on evaluation boards.

I need to be able to exchange serial data between them in udp mode, where one is a udp server and the other is a udp client. They will be connecting to each other only, and not to an existing wifi network.

I am only able to communicate with them using AT commands using a usb cable.

I have tried following the examples in the data sheet, but have not found a way to set up the network.
I usually get [ERROR: WiFi Status] to the AT commands I have used.

I am quite happy to work through the data sheet and work out the details, but I dont know what the basic steps are.

## Replies

### Reply 1 by ssekim, 2014-06-06

Hello Anglial

Did you use &lt;AT+SCON> command?
If so, before issuing the command, WizFi250 should be associated to a AP(or another WizFi250).

Can you let me know the all at command sets which you used?

### Reply 2 by anglial, 2014-06-06

I tried these to set up the server ready for the other to connect

at+scon=so,usn,5000,0

[ERROR: WiFi Status]

at+scon=so,usn,5000,1

[ERROR: WiFi Status]

at+scon=o,usn,5000,0

[ERROR: WiFi Status]

at+scon=o,usn,5000,0

[ERROR: WiFi Status]

at+scon=o,usn,5000,1

[ERROR: WiFi Status]

I then read the data sheet to see how to connect two together without using an AP and could not find an example so I asked here.

### Reply 3 by kaizen, 2014-06-08

Hi

You have to use &lt;AT+SCON> command after entering the &lt;AT+WJOIN> command.
[ERROR: WiFi Status] response means WizFi250 does not connect to your AP.

### Reply 4 by anglial, 2014-06-12

So do I need to set one of them up as an access point, then get the other one to connect to it ?

How do I do that ?

I have tried using AT+WSET but I’m not sure what I am doing and there are no examples to follow to do this.

In what order do I need to use the commands at each end ?

Thanks for your help

### Reply 5 by ssekim, 2014-06-12

Hello anglial

Here is my scenario.

Module A : AP mode, 192.168.12.1, TCP Server,
Module B : Station mode, 192.168.12.2, TCP Client

[AP mode setting in Module A]
AT+WSET=1,WizFi250_AP
AT+WSEC=1,WPA2,12345678
AT+WNET=0,192.168.12.1,255.255.255.0,192.168.12.1
AT+WJOIN

[Station mode setting in Module A]
AT+WSET=0,WizFi250_AP
AT+WSEC=0,WPA2,12345678
AT+WNET=0,192.168.12.2,255.255.255.0,192.168.12.1
AT+WJOIN

Now, module A and module B are in a same network.

[TCP Server setting in Module A]
AT+SCON=O,TSN,4000,1

[TCP Client setting in Module B]
AT+SCON=O,TCN,192.168.12.1,4000,1

Now, module A and module B can communicate each other.

Regards, Steve

### Reply 6 by anglial, 2014-06-23

Thanks, thats a great help.

I have used these commands to open a udp connection :

AT+SCON=O,USN,4000,0 udp server module A, command mode

AT+SCON=O,UCN,192.168.12.1,4000,0 udp client module B, command mode

If I want to send data from the client to the server using the AT+SSEND command how do I use it ?

The definition on page 15 of the programmers guide is different to the example on page 72.
Is the timeout necessary ?
Is a character required before the text data ?

Please could you post an example of the AT+SSEND command that will work in this example. I am confused.

Thank you

### Reply 7 by ssekim, 2014-06-24

There are some description and some examples about AT+SSEND.

[url][http://wizwiki.net/wiki/doku.php?id=products:wizfi250:wizfi250pg:start#at_ssend\[/url\]](http://wizwiki.net/wiki/doku.php?id=products:wizfi250:wizfi250pg:start#at_ssend%5B/url%5D)

[url][http://wizwiki.net/wiki/doku.php?id=products:wizfi250:wizfi250pg:start#method_of_setting_tcp_client_and_exchanging_data_in_command_mode\[/url\]](http://wizwiki.net/wiki/doku.php?id=products:wizfi250:wizfi250pg:start#method_of_setting_tcp_client_and_exchanging_data_in_command_mode%5B/url%5D)

---

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