Exhange data beween 2 wizfi250 in udp mode

#1

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.

#2

Hello Anglial

Did you use <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?

#3

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.

#4

Hi

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

#5

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

#6

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

#7

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

#8

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

http://wizwiki.net/wiki/doku.php?id=products:wizfi250:wizfi250pg:start#at_ssend

http://wizwiki.net/wiki/doku.php?id=products:wizfi250:wizfi250pg:start#method_of_setting_tcp_client_and_exchanging_data_in_command_mode