WizFi250 AT Command Examples

details

This posting introduces some examples of AT+FSOCK and AT+MEVTFORM, the major AT commands of WizFi250

 (1) AT+FSOCK=6,n

At the TCP Client mode, if the connection is unexpectely closed, the WizFi250 needs to try to re-connect. For this you can use below commands

AT+FSOCK=6,n

This commands let WizFi250 check the socket status every ‘n’ second, and re-create the socket if there is no socket opened.

For example, when WizFi250 opeartes at the ‘AT+SCON=S,TCN,….’ mode, if the connection with TCP server is closed, WizFi250 will re-create the socket using the command ‘AT+FSOCK=6,n’ option.

 (2) AT+FSOCK=8,n

This command is very similar to ‘AT+FSOCK=6,n’, but it resets the WizFi250. Therefore, with this command WizFi250 tries to re-connect to AP after resetting.

AT+FSOCK=8,n

For example, when WizFi250 opeartes at the ‘AT+SCON=S,TCN,….’ mode, if the connection with TCP server is closed, the module resets and restarts by connecting to AP.

However, if there is no TCP server, WizFi250 will repeately reset and re-associate. It can make the trouble at the AP.

(3) AT+MEVTFORM

 

WizFi250 can make some random messages that could be transmited to MCU, but MCU could not interpret all those mesaages. This command will select the requried message or tranmits simplified format to MCU.

Example 1

This example code will let WizFi250 tries to re-connect to the TCP server every 10 second and reset every 15 second for re-connection.

WizFi250 Version 1.0.3.9 (WIZnet Co.Ltd)
AT+WSET=0,WizFiDemoAP
[OK]
AT+WSEC=0,,xxxxxxxx
[OK]
AT+WNET=1
[OK]
AT+SCON=S,TCN,222.98.xxx.xxx,10004,,0
[OK]
AT+FSOCK=6,10
[OK]
AT+FSOCK=8,20
[OK]
AT+MPROF=S
[OK]
AT+MRESET
[OK]
 
WizFi250 Version 1.0.3.9 (WIZnet Co.Ltd)
Joining : WizFiDemoAP
Successfully joined : WizFiDemoAP
 
[Link-Up Event]
  IP Addr    : 192.168.3.52
  Gateway    : 192.168.3.1
 
[DISCONNECT 0] (The first connection failed)
 
[DISCONNECT 0] (The 2nd connection after 10 sec failed)
 
[DISCONNECT 0] (The 3rd connection after 10 sec, failed)
 
[Link-Down Event]
WizFi250 Version 1.0.3.9 (WIZnet Co.Ltd) (Module reset after 20 seconds)
Joining : WizFiDemoAP
Successfully joined : WizFiDemoAP
 
[Link-Up Event]
  IP Addr    : 192.168.3.52
  Gateway    : 192.168.3.1
 
[DISCONNECT 0] (Connection failed after reset)
 
[DISCONNECT 0] (Re-connection failed after 10 seconds)
 
[CONNECT 0] (Connection Established after 10 seconds)
 
[DISCONNECT 0] (Connection with server is unexpectedly closed)
 
[CONNECT 0] (Re-connection established after 10 seconds)

Example 2

This example is almost identical with example 1, but event message configuration has been added.

Initial booting Event Message : Normal output

[CONNECT x], [DISCONNECT x], [Link-Up Event], [Link-Down Event] : Short Messag output

Other event messages are not output.

WizFi250 Version 1.0.3.9 (WIZnet Co.Ltd)
AT+WSET=0,WizFiDemoAP
[OK]
AT+WSEC=0,,xxxxxxxx
[OK]
AT+WNET=1
[OK]
AT+SCON=S,TCN,222.98.xxx.xxx,10004,,0
[OK]
AT+FSOCK=6,10
[OK]
AT+FSOCK=8,20
[OK]
AT+MEVTFORM=1222200000
[OK]
(Event Message Configuration)
AT+MPROF=S
[OK]
AT+MRESET
[OK]
WizFi250 Version 1.0.3.9 (WIZnet Co.Ltd)
 
[3] (The real message : [Link-Up Event])
 
[2] (The real message : [DISCONNECT 0])
 
[2] (The real message [DISCONNECT 0])
 
[4] (The real message [Link-Down Event])
 
WizFi250 Version 1.0.3.9 (WIZnet Co.Ltd)
 
[3] (The real message [Link-Up Event])
 
[1] (The real message [CONNECT 0])

Example 3

This example is almost identical with example 2, but all the event messages are not output.

WizFi250 Version 1.0.3.9 (WIZnet Co.Ltd)
AT+WSET=0,WizFiDemoAP
[OK]
AT+WSEC=0,,xxxxxxxx
[OK]
AT+WNET=1
[OK]
AT+SCON=S,TCN,222.98.xxx.xxx,10004,,0
[OK]
AT+FSOCK=6,10
[OK]
AT+FSOCK=8,20
[OK]
AT+MEVTFORM=0000000000
[OK]
(Event Message Configuration)
AT+MPROF=S
[OK]
AT+MRESET
[OK]
 
(After then, MCU doesn't need to send AT command or analyze the event mesagge)

 

This posting introduces some examples of AT+FSOCK and AT+MEVTFORM, the major AT commands of WizFi250

 (1) AT+FSOCK=6,n

At the TCP Client mode, if the connection is unexpectely closed, the WizFi250 needs to try to re-connect. For this you can use below commands

AT+FSOCK=6,n

This commands let WizFi250 check the socket status every ‘n’ second, and re-create the socket if there is no socket opened.

For example, when WizFi250 opeartes at the ‘AT+SCON=S,TCN,….’ mode, if the connection with TCP server is closed, WizFi250 will re-create the socket using the command ‘AT+FSOCK=6,n’ option.

 (2) AT+FSOCK=8,n

This command is very similar to ‘AT+FSOCK=6,n’, but it resets the WizFi250. Therefore, with this command WizFi250 tries to re-connect to AP after resetting.

AT+FSOCK=8,n

For example, when WizFi250 opeartes at the ‘AT+SCON=S,TCN,….’ mode, if the connection with TCP server is closed, the module resets and restarts by connecting to AP.

However, if there is no TCP server, WizFi250 will repeately reset and re-associate. It can make the trouble at the AP.

(3) AT+MEVTFORM

 

WizFi250 can make some random messages that could be transmited to MCU, but MCU could not interpret all those mesaages. This command will select the requried message or tranmits simplified format to MCU.

Example 1

This example code will let WizFi250 tries to re-connect to the TCP server every 10 second and reset every 15 second for re-connection.

WizFi250 Version 1.0.3.9 (WIZnet Co.Ltd)
AT+WSET=0,WizFiDemoAP
[OK]
AT+WSEC=0,,xxxxxxxx
[OK]
AT+WNET=1
[OK]
AT+SCON=S,TCN,222.98.xxx.xxx,10004,,0
[OK]
AT+FSOCK=6,10
[OK]
AT+FSOCK=8,20
[OK]
AT+MPROF=S
[OK]
AT+MRESET
[OK]
 
WizFi250 Version 1.0.3.9 (WIZnet Co.Ltd)
Joining : WizFiDemoAP
Successfully joined : WizFiDemoAP
 
[Link-Up Event]
  IP Addr    : 192.168.3.52
  Gateway    : 192.168.3.1
 
[DISCONNECT 0] (The first connection failed)
 
[DISCONNECT 0] (The 2nd connection after 10 sec failed)
 
[DISCONNECT 0] (The 3rd connection after 10 sec, failed)
 
[Link-Down Event]
WizFi250 Version 1.0.3.9 (WIZnet Co.Ltd) (Module reset after 20 seconds)
Joining : WizFiDemoAP
Successfully joined : WizFiDemoAP
 
[Link-Up Event]
  IP Addr    : 192.168.3.52
  Gateway    : 192.168.3.1
 
[DISCONNECT 0] (Connection failed after reset)
 
[DISCONNECT 0] (Re-connection failed after 10 seconds)
 
[CONNECT 0] (Connection Established after 10 seconds)
 
[DISCONNECT 0] (Connection with server is unexpectedly closed)
 
[CONNECT 0] (Re-connection established after 10 seconds)

Example 2

This example is almost identical with example 1, but event message configuration has been added.

Initial booting Event Message : Normal output

[CONNECT x], [DISCONNECT x], [Link-Up Event], [Link-Down Event] : Short Messag output

Other event messages are not output.

WizFi250 Version 1.0.3.9 (WIZnet Co.Ltd)
AT+WSET=0,WizFiDemoAP
[OK]
AT+WSEC=0,,xxxxxxxx
[OK]
AT+WNET=1
[OK]
AT+SCON=S,TCN,222.98.xxx.xxx,10004,,0
[OK]
AT+FSOCK=6,10
[OK]
AT+FSOCK=8,20
[OK]
AT+MEVTFORM=1222200000
[OK]
(Event Message Configuration)
AT+MPROF=S
[OK]
AT+MRESET
[OK]
WizFi250 Version 1.0.3.9 (WIZnet Co.Ltd)
 
[3] (The real message : [Link-Up Event])
 
[2] (The real message : [DISCONNECT 0])
 
[2] (The real message [DISCONNECT 0])
 
[4] (The real message [Link-Down Event])
 
WizFi250 Version 1.0.3.9 (WIZnet Co.Ltd)
 
[3] (The real message [Link-Up Event])
 
[1] (The real message [CONNECT 0])

Example 3

This example is almost identical with example 2, but all the event messages are not output.

WizFi250 Version 1.0.3.9 (WIZnet Co.Ltd)
AT+WSET=0,WizFiDemoAP
[OK]
AT+WSEC=0,,xxxxxxxx
[OK]
AT+WNET=1
[OK]
AT+SCON=S,TCN,222.98.xxx.xxx,10004,,0
[OK]
AT+FSOCK=6,10
[OK]
AT+FSOCK=8,20
[OK]
AT+MEVTFORM=0000000000
[OK]
(Event Message Configuration)
AT+MPROF=S
[OK]
AT+MRESET
[OK]
 
(After then, MCU doesn't need to send AT command or analyze the event mesagge)

 

COMMENTS

Please Login to comment
  Subscribe  
Notify of
POSTED BY