User Tools

Site Tools


products:wizfi250:wizfi250pg:at_command_set-network_commands


Network Commands


Commands related to Network are listed below.


AT+SCON




  • Format:
AT+SCON=<OpenType>,<SocketType>,<RemoteIP>,<RemotePort>,<LocalPort>,<DataMode>
  • Meaning: Socket Open/Connect ( User can use max 8 sockets. )

Opens a socket and if it is a TCP Client, establishes TCP connection with remote peer device.

<OpenType>: Socket open type (Required)

Parameter Meaning
O open at Once
S register as a Service
SO open at Once & register as a Service

* AT ONCE: Assigns a socket immediately and if the socket is a TCP Client, tries to connect peer socket.

* AS SERVICE: Registers its information to the profile. When WiFi Joined, socket open/connect will be performed automatically. If you want to use this after reset, It should be saved by using AT+MPROF=S

<SocketType>: Socket protocol to use (Required)

Parameter Meaning
TSN TCP Server Normal
TSS TCP Server Secured
TCN TCP Client Normal
TCS TCP Client Secured
USN UDP Server Normal
UCN UDP Client Normal

* 'Secured' means TCP connection through SSL Encryption.

* Actually, there is no Server/Client concept in UDP protocol. This concept is used to decide peer address purposes. If a UDP Server receives any packet, its default peer address will be changed to the address of the packet, so if you send data after that, it goes to the changed address. But If you use UDP Client, its …default address stored by AT+SCON will never be changed.

<RemoteIP>: Remote IP address

Protocol Parameter Application
TCP Server N/A
TCP Client Required
UDP Server Optional
UDP Client Required

<RemotePort>: Remote port number
Same condition with upper, RemoteIP

<LocalPort>: Local port number (Required)
Local port number should not be duplicated with others which have opened before. When the value is 0, in case the socket was a TCP/UDP Client, a random port number will be selected. If it was a TCP/UDP Server, it will return an error message.

<DataMode>: Mode to run (Optional, default: 0)

Parameter Meaning
0 Open as Command mode
1 Open as Data mode

* About Command/Data mode, refer to Command mode & Data mode

Examples)

  • AT+SCON=O,TSN,,,5000,0
  • AT+SCON=S,UCN,192.168.0.10,12345,5000,1 (Profile must be saved)

  • Response:
[OK]



  • Format:
AT+SCON=?
  • Meaning: Get Previous Input Parameters

Use for check if previous input parameters are correct.

  • Response:
<OpenType>,<SocketType>,<RemoteIP>,<RemotePort>,<LocalPort>,<DataMode>
[OK]



AT+SMGMT




  • Format:
AT+SMGMT=<SocketID>
  • Meaning: Socket Management - Socket Close

Closes the selected socket and releases all its resources.

<SocketID>: Socket ID (Required)

Parameter Meaning
0 ~ 7 The socket ID to close
ALL All the opened sockets

* Opened socket information can be found by using '?' option.

Examples)

  • AT+SMGMT=5
  • AT+SMGMT=ALL

  • Response:
[OK]



  • Format:
AT+SMGMT=?
  • Meaning: Socket Management - Get Opened Socket Status

This prints all of the opened sockets statuses.

  • Response:
Number of Sockets : x (SCID/Socket/Mode/Remote/Local/DataMode)
<SocketID>,<SocketAddr>,<SocketType>,<RemoteIP>,<RemotePort>,<LocalPort>,<DataMode>
...
[OK]



AT+SSEND




  • Format:
AT+SSEND=<SocketID>,<RemoteIP>,<RemotePort>,<SendSize>,<Timeout>
  • Meaning: Data Send

This is used only in command mode, not in data mode. It is not required in data mode as you can input directly, but if you exit from data mode to command mode by inputting '+++', you can send data through this command.

<SocketID>: Socket ID (Required)

<RemoteIP>: Remote IP Address

Protocol Parameter Application
TCP Server N/A
TCP Client N/A
UDP Server Optional
UDP Client Optional

* In case of TCP Server waiting for a client on listen state or in case of undecided remote address of the UDP Server (meaning its remote address is 0.0.0.0:0), this command will fail.

<RemotePort>: Remote Port Number
Same condition with upper, RemoteIP

<SendSize>: Data size to send (Required)
Valid Range: 1 ~ 100,000,000 Byte

<Timeout >: Set timeout value (milliseconds unit) (Optional)
If the transmission takes time more time than timeout value, it will fail and return error response. Default value is 10s + (100s / 1 MB)

Examples)

  • AT+SSEND=0,,,3
  • AT+SSEND=1,192.168.0.100,5000,1000000,50000

  • Response:
[OK]



AT+SDATA




  • Format:
AT+SDATA
  • Meaning: Return to Data Mode

In data mode, it can be changed to command mode temporally by using serial '+++' input. After that, to return to the data mode, you can use this command. If it is not data mode, [ERROR] response will be returned.

  • Response:
[OK]



AT+SFORM




  • Format:
AT+SFORM=<Format>,<Start>,<Delim>,<End>,<Cls1>,<Cls2>
  • Meaning: Define Data Receive Header Form

Define the header of received data which is used at command mode. For example, default receiving format look like below.
“{0,192.168.0.216,59834,5}hello(0xd)(0xa)”
This means ASCII code “hello” was received from 192.168.0.216:59834 by socket ID 0, and its length was 5. You can change this format to suit your system through this command. Factory default option is
“111111111,7B,2C,7D,0D,0A”

<Format>: Decide each of header items to use. (Required)
If you want to set it to active, input '1', if not, input '0'.

Order Meaning
0 Header Start
1 Socket ID
2 Delimiter
3 Remote IP Address
4 Remote Port Number
5 Data Length
6 Header End
7 Data End 1/2
8 Data End 2/2

* At default format, '{' '}' is header start and end, ',' is delimiter, 0xd,0xa is data end 1,2.

< Start>: Header Start Character (Required)
< Delim>: Delimiter Character (Required)
< End>: Header End Character (Required)
< Cls1>: Data End Character 1/2 (Required)
< Cls2>: Data End Character 2/2 (Required)

Examples)

  • AT+SFORM=111111111,7B,2C,7D,0D,0A
  • AT+SFORM=101100110,5B,2F,5D,0D,00

  • Response:
[OK]



  • Format:
AT+SFORM=?
  • Meaning: Get Current Data Receive Header Form
  • Response:
<Format>,<Start>,<Delim>,<End>,<Cls1>,<Cls2>
[OK]


AT+SOPT1




  • Format:
AT+SOPT1=<Option>,<Value>
  • Meaning: S2W miscellaneous option

<Option>: Option to configure (Required) <Value>: Value of the option (Required)

Option Value
10 Escape sequence(+++) Timer(millisecond, default 1000, 1~10000)

Examples)

  • AT+SOPT1=10,500
  • Response:
[OK]


products/wizfi250/wizfi250pg/at_command_set-network_commands.txt · Last modified: 2016/08/02 10:20 by daniel