Command Manual-[EN]
W232N AT Command Overview
W232N provides various commands for the product’s setting and control. Each command is composed of a 2 byte alphabet character strings and all capital letters. By using these commands users can add script to the serial device or main MCU for product settings, and also can create a program for controlling the W232N module via network.
Each command can operate read/write depending on the parameter, and there is also a read only command.
Entering the command and switching the command mode of the serial port device is done using the data UART port. The debug UART port is not supported for command entering or operation.
Identical 2-byte character strings is used for setting the product with commands via serial and Ethernet network, but there will a distinction of the sending frame form. Thus this document will cover explanations of all commands and guides for each sending methods and its form of frames.
The different command modes are as following.
-
The Configuration tool provided by WIZnet uses the identical command set to control W232N.
-
For example, when the MC command for checking the MAC address and the VR command for checking the firmware are identical.
Abbreviations
Abbreviation | Description |
---|---|
CR | Carriage Return, moves the cursor to the far left(starting) position ('\r', 0x0D) |
LF | Line Feed, moves the cursor to the new line below ('\n', 0x0A) |
N | Number of commands |
RW | Read / Write |
RO | Read only |
WO | Write only |
Usage of Command Set
Control Device Using Serial Command Mode
You can use either of the two methods below to enter serial command mode.
1. Enter command mode using hardware trigger pin
- Use the HW_TRIG pin of the W232N (For the EVB, HW_TRIG switch) to enter command mode.
- Upon turning the power on, check the pin to enter command mode. Use the trigger pin to re-enter the command mode when rebooting.
- The trigger pin should be pull-up, and operates as low active.
- This method is used when users wish to change settings while the product operation is initiated.
- Set the hardware trigger pin(HW_TRIG) to Low.
· When using the EVB, place the HW_TRIG switch to Command.
- Power on the W232N.
· When operating in serial command mode, users can check the following message via Debug UART port.
· <code>> SEG:AT Mode </code>
- Enter the Command and Parameter that needs setting via serial port((Data UART port)).
- Switch to data transmission mode(GW mode) using [[#ex|EX]] command.
· If the switch to data transmission mode is successful, users can check the following message via Debug UART port.
· <code>> SEG:GW Mode </code>
2. Enter command mode using command mode switch code
- Users can enter command mode using the command mode switch code provided by W232N.
- The command mode switch codes can be used only if it is enabled in the configuration tool. (default: Enabled)
- The command mode switch code is composed of 3-byte Hex codes, and can be changed to a different value if needed. The code only accepts Hex value. (default: Hex [2B][2B][2B])
- Check if 'Serial command mode switch code' is enabled at the configuration tool and the 3-bytes 'command mode switch code'.
- Enter the ‘command mode switch code’ via data UART port to change modes.
· Read below what you need to be cautious about when switching to command mode.
· When operating in serial command mode, users can check the following message via Debug UART port.
· <code>> SEG:AT Mode </code>
- Enter the Command and Parameter that needs setting via serial port.
- Use [[#ex|EX]] command to switch to data transmission mode.
· When operating in data transmission mode, users can check the following message via Debug UART port.
· <code>> SEG:GW Mode </code>
-
Command mode switch trigger code via Data UART port
-
Char '+++'
Please be cautious when using the trigger code to switch command mode.
- There has to be a time gap of **at least 500ms** at the start and end of the ‘command mode switch code’ in order it to be read as switch code.
- The entering time in between each byte of the ‘3-byte command mode switch code’ has to be **below 500ms**.
- Do not add CR or LF at the end of the command mode switch code((Conversely, the serial command after mode switch must end with CR or LF.)).
- The default values of 1 and 2 above are **500ms**; these values change to the timer value if the timer value of the serial data packing option is set to a certain value.
Serial Command Frame Format
You must include CR and LF at the end of each command. CR and LF must be included at the end of each commands when multiple commands are entered simultaneously.
Get Request
[2-bytes Command Code] [CR] [LF]
- Enter command without parameter.
- The response relevant to the command will return.
Set Request
[2-bytes Command Code] [Parameters] [CR] [LF]
- Enter the command and parameters you wish to set.
- There will be no particular response and the field value relevant to the command will change instantly.
- You have to use the SV command in order to save settings, and use the RT command to change IP allocation methods or other initial operation changes.
* Note: You can check the Echoback of UART command via EC command.
Control Device Using Ethernet Network
Users can control or monitor W232N via Ethernet by using the following commands. The user must use UDP or TCP client to send commands, and the port number for processing the commands is 50001.
Network information for command transmission: UDP / TCP Server : 50001 (User can send the commands by UDP / TCP Client to device)
Ethernet Command Frame Format
Two additional commands are required before sending the command code when controlling the W232N via Ethernet. All other settings and operations are the same as when sending the serial command code via data UART port.
The two additional commands are MA and PW.
-
[MA] command
- This field shows the product’s MAC address.
- In both cases of TCP and UDP, 6-byte MAC address must be included after the 2-byte MA command.
- When users wish to broadcast only Get Request via UDP, the relevant field value can be set as the Broadcast MAC address. Users can receive responses from multiple peers. The search function of the configuration tool is implemented like this
-
[PW] command
-
Users must use UDP or TCP client because the UDP or TCP server is operating to handle the device commands.
-
Data is sent to the broadcast IP address 255.255.255.255, and data can be sent to all peers in the same network.
-
FF:FF:FF:FF:FF:FF
-
Hex 0x20 is ASCII code, which means blank.
Get Request
When sending a single command
MA [MAC] [CR] [LF] PW [Search ID] [CR] [LF] [Command] [CR] [LF]
When sending multiple commands
MA [MAC] [CR] [LF] PW [Search ID] [CR] [LF] ([Command] [CR] [LF]) * Number of commands
- The response for ‘get request’ will have the identical format as ‘request’ but include the parameter.
Set Request
When sending a single command
MA [MAC] [CR] [LF] PW [Search ID] [CR] [LF] [Command] [Parameters] [CR] [LF]
When sending multiple commands
MA [MAC] [CR] [LF] PW [Search ID] [CR] [LF] ([Command] [Parameters] [CR] [LF]) * Number of commands
- For ‘Set Request’, there is no additional response needed for changing the product setting.
- If users want to check the modified setting, send the command without parameter at the end of the ‘Set Request frame’; in form of Set + Get Request.
Ethernet Command Examples
Example #1: UDP Get Command Frame
- When requesting MAC and local IP from multiple devices via UDP
- Search ID is not used
Request from User |
---|
Command Frame
MA [FF FF FF FF FF FF] [CR] [LF] PW [ ] [CR] [LF] MC [CR] [LF] LI [CR] [LF]
Hex code version of Command Frame
4D 41 FF FF FF FF FF FF 0D 0A 50 57 20 0D 0A 4D 43 0D 0A 4C 49 0D 0A
Response by W232N |
---|
- The response for ‘Get Request’ has the same form as ‘Set Request’.
Command Frame
MA [00 08 DC 00 00 11] [CR] [LF] PW [ ] [CR] [LF] MC [00 08 DC 00 00 11] [CR] [LF] LI [192.168.11.2] [CR] [LF]
Hex code version of Command Frame
4D 41 00 08 DC 00 00 11 0D 0A 50 57 20 0D 0A 4D 43 00 08 DC 00 00 11 0D 0A 4C 49 31 39 32 2E 31 36 38 2E 31 31 2E 32 0D 0A
Example #2: TCP Get Command Frame
- When requesting the local IP of the device, which MAC address is 00:08:DC:00:00:11, via TCP
- Search ID is not used
Request from User |
---|
Command Frame
MA [00 08 DC 00 00 11] [CR] [LF] PW [ ] [CR] [LF] LI [CR] [LF]
Hex code version of Command Frame
4D 41 00 08 DC 00 00 11 0D 0A 50 57 20 0D 0A 4C 49 0D 0A
Response by W232N |
---|
Command Frame
MA [00 08 DC 00 00 11] [CR] [LF] PW [ ] [CR] [LF] LI [192.168.11.2] [CR] [LF]
Hex code version of Command Frame
4D 41 00 08 DC 00 00 11 0D 0A 50 57 20 0D 0A 4C 49 31 39 32 2E 31 36 38 2E 31 31 2E 32 0D 0A
Example #3: TCP Set Command Frame
- When requesting the local IP of the device, which MAC address is 00:08:DC:00:00:11, via TCP
- If the Search ID is set to HELLO
- Or if user wishes to change the local IP to 192.168.11.5
Request from User |
---|
Command Frame
MA [00 08 DC 00 00 11] [CR] [LF] PW [HELLO] [CR] [LF] LI [192.168.11.5] [CR] [LF]
Hex code version of Command Frame
4D 41 00 08 DC 00 00 11 0D 0A 50 57 48 45 4C 4C 4F 0D 0A 4C 49 31 39 32 2E 31 36 38 2E 31 31 2E 35 0D 0A
Response by W232N |
---|
None
When modifying the IP address format, '.'(dot, 0x2E) must be included such as the '192.168.11.5'.
Command list
- The Set command setting the applicable value will operate if the parameter is included when entering the command.
- The Get command reading the applicable value will operate if only the command is entered.
- If the ‘Read only’ sign does not appear, it means the command supports both Get / Set.
- Write only command is for controlling the product without the parameter.
- There is a basic command list and an expanded command list.
- Settings like IP allocation settings or DNS operation settings via command mode require ‘module reboot’ via RT command after the settings are saved via SV command.
-
IPv4 address forms like IP address, Gateway address, subnet mask, DNS server address, or Remote IP address.
-
Save setting, reboot, switch mode, factory reset and Etc.
-
WIZ107SR / WIZ108SR sync command list, excluding [UN], [UI] command
-
WIZ750SR / WIZ750SR-1xx / WIZ750SR-12x sync command list, including [UN], [UI] command
-
WIZ510SSL sync command list, including [UN], [UI] command
-
W232N exclusive command list
-
When the remote peer address is changed from IP address to domain
Basic Commands
Command | Category | Description | Type |
---|---|---|---|
MC | Device Information | MAC address | RO |
VR | ::: | Firmware version | RO |
MN | ::: | Product name | RO |
ST | ::: | Operation status | RO |
UN | ::: | UART interface(str) | RO |
UI | ::: | UART interface(code) | RO |
OP | Network Settings | Network operation mode | RW |
IM | ::: | IP address allocation method (static/DHCP) | RW |
LI | ::: | Local IP address | RW |
SM | ::: | Subnet mask | RW |
GW | ::: | Gateway address | RW |
DS | ::: | DNS server address | RW |
LP | ::: | Local port number | RW |
RH | ::: | Remote host IP address / Domain | RW |
RP | ::: | Remote host port number | RW |
BR | Data UART Settings | UART Baud rate | RW |
DB | ::: | UART Data bit | RW |
PR | ::: | UART Parity bit | RW |
SB | ::: | UART Stop bit | RW |
FL | ::: | UART Flow control | RW |
EC | ::: | UART Echoback enable | RW |
PT | Serial Data Packing Options | Time delimiter | RW |
PS | ::: | Size delimiter | RW |
PD | ::: | Char delimiter | RW |
IT | Options | Inactivity timer value | RW |
RI | ::: | TCP Reconnection interval (TCP client only) | RW |
CP | ::: | Connection password enable (TCP server only) | RW |
NP | ::: | Connection password (TCP server only) | RW |
SP | ::: | Search ID code | RW |
DG | ::: | Serial debug message enable | RW |
KA | ::: | TCP Keep-alive enable | RW |
KI | ::: | TCP Keep-alive initial interval | RW |
KE | ::: | TCP Keep-alive retry interval | RW |
SO | ::: | SSL receive timeout | RW |
QU | MQTT Settings | MQTT user name | RW |
QP | ::: | MQTT password | RW |
QC | ::: | MQTT client ID | RW |
QK | ::: | MQTT Keep-alive | RW |
PU | ::: | MQTT publish topic | RW |
U0 | ::: | MQTT subscribe topic 1 | RW |
U1 | ::: | MQTT subscribe topic 2 | RW |
U2 | ::: | MQTT subscribe topic 3 | RW |
QO | ::: | MQTT QoS level | RW |
RC | Certificate Settings | Root CA verify option | RW |
CE | ::: | Client certificate enable | RW |
OC | ::: | Root CA | WO |
LC | ::: | Client certificate | WO |
PK | ::: | Private key | WO |
TE | Command Mode Switch Settings | Command mode switch code enable | RW |
SS | ::: | Command mode switch code (3-bytes Hex) | RW |
EX | Device Control | Command mode exit (switch to data transfer mode) | WO |
SV | ::: | Save device setting | WO |
UF | ::: | Copy firmware from firmware binary bank to application bank | RW |
RT | ::: | Device reboot | WO |
FR | ::: | Device factory reset | WO |
Extended Commands
Command | Category | Description | Type |
---|---|---|---|
SC | Status I/O | Status pin S0 & S1 operation mode setting | RW |
S0 | ::: | Status of pin S0 (PHY link or DTR) | RO |
S1 | ::: | Status of pin S1 (TCP connect or DSR) | RO |
Command Descriptions
Device Information
MC
-
Format:
MC[CR][LF]
-
Meaning: Check product’s MAC address
-
Command Type: Read only
-
Return Type: String
-
Return Value:
MAC address with colons(:)
-
Response
Without Parameter (Get)
- In ASCII:
MC00:08:DC:00:00:01\r\n
- In ASCII:
VR
-
Format:
VR[CR][LF]
-
Meaning: Check the product’s firmware version
-
Command Type: Read only
-
Return Type: String
-
Return Value:
Firmware version with dots(.)
⇒ Major version number . Minor version number . Maintenance version number
-
Response
Without Parameter (Get)
- In ASCII:
VR1.0.0\r\n
- In ASCII:
MN
-
Format:
MN[CR][LF]
-
Meaning: Check the product name
-
Command Type: Read only
-
Return Type: String
-
Return Value:
Device model name
⇒ Default: WIZ5XXRSR-RP
-
Response
Without Parameter (Get)
- In ASCII:
MNWIZ5XXRSR-RP\r\n
- In ASCII:
ST
-
Format:
ST[CR][LF]
-
Meaning: Check the product operation status
-
Command Type: Read only
-
Return Type: String
-
Return Value:
Status | Description |
---|---|
BOOT | Boot mode; Users can update the product setting and firmware. |
OPEN | Status before TCP connection is successful. |
CONNECT | Status after TCP connection is successful. |
UPGRADE | Status during firmware update or DHCP IP allocation. |
ATMODE | Serial AT command mode status. |
-
Response
Without Parameter (Get)
- In ASCII:
STATMODE\r\n
- In ASCII: