E45&M4 Config Protocol V1.4
E45&M4 Config Protocol V1.4
E45&M4 Config Protocol V1.4
Protocol
All data must be sent via UDP boardcast, local port 1901, sent to remote port 1901, broadcast
address 255.255.255.255.
First PC send a command, the device reply.
1. Send Command
All the search or config command format list below.
Length Com User/Passwo Check
Hea MAC
Function (Command~ man rd Parameter Byte
d (6 byte)
Parameter) d (12 bytes) (sum)
Search FF 01 01 02
[usrname]
Reset FF xx 02 [MAC] xx
[password]
[usrname]
Read FF xx 03 [MAC] xx
[password]
[usrname]
Store FF xx 04 [MAC] xx
[password]
[usrname] Basic
Basic Setting FF xx 05 [MAC] xx
[password] param
[usrname] Port0
COM 0 setting FF xx 06 [MAC] xx
[password] param
[usrname] Port1
COM 1 setting FF xx 07 [MAC] xx
[password] param
[usrname] Port2
COM 2 setting FF xx 08 [MAC] xx
[password] param
Expand setting
Read
[usrname]
temporary FF xx 0A [MAC] xx
[password]
config
Last byte is checksum, it calculated from length byte(length byte included), until the checksum
byte(not include checksum itself), the result byte is checksum, checksum reserves only 1 byte.
The command is used to reset a selected one device, one device only
Send:
FF 13 02 d8 b0 4c 00 04 c9 61 64 6d 69 6e 00 61 64 6d 69 6e 00 c8
Checksum C8 = 13 + 02 + ... + 6E + 00
Red part is module's mac address
Last 12 byte is the module's user name and password, if the string length less than 6 byte, rest byte
must be filled with 0.
This command is used to read all parameters out of the selected device
Send(16 bytes):
FF 13 03 AC CF 23 66 66 67 61 64 6D 69 6E 00 61 64 6D 69 6E 00 F9
Checksum F9 = 13 + 03 + AC + ... + 6E + 00
The green part is username, red part is password, if the string length less than 6 byte, rest byte
must be filled with 0.
ucSequenceNu
1
m
ucCRC 1
ucVersion 1
IP address type:
ucFlags 1 80
The eighth is 0: DHCP; 1: Statics IP
usLocationURLP
2 20 19 UPNP port
ort
usHTTPServerP
2 50 00 HTTP service port
ort
ucUserFlag 1
ulStaticIP 4 38 00 A8 C0 Statics IP
ulGatewayIP 4 01 00 A8 C0 Gateway
55 53 52 2D 54 43 50
ucModName 16 32 33 32 2D 45 00 00 Module name
00 00
username 6 61 64 6D 69 6E 00 Username
password 6 61 64 6D 69 6E 00 Password
ucNetSendTime 1
uiId 2 01 00 Device ID
Device ID (0~3)
0:no use
ucIdType 1 00 1:send id when connect
2:send id when send data
3:both
Each port's parameters is 63 byte, the is usually 3 port for each module. Port0,
port1, port2.
Name byte sample description
ulBaudRate 4 00 C2 01 00 baudrate
ucDataSize 1 08 databit(0X05/0x06/0x07/0x08)
parity
ucParity 1 01 1:no,2:odd,3:even,4:mark,5:
space
ucStopBits 1 01 stopbit(0x01/0x02)
ucFlowControl 1 01 flowcontrol( 0x01:no,0x03:HW)
ulTelnetTimeout 4 00 00 00 00 Unused
usTelnetLocalPort 2 17 00 Local port
usTelnetRemotePort 2 17 00 Remote port
31 39 32 2E 31 36 38 2E
Ip address or domain name is sent with
30 2E 31 00 00 00 00 00
uiTelnetURL 30 string format, such as "192.168.0.1", or
00 00 00 00 00 00 00 00
"www.usr.cn".
00 00 00 00 00 00
ulTelnetIPAddr 4 00 00 00 00 unused
ucFlags 1 02 by default unused
Work mode
ucWorkMode 1 03 0:UDP, 1:TCP Client, 2:UDP Server, 3:
TCP Server, 4:HTTPD Client
uiPackLen 4 C8 00 00 00 Serial packet length
ucPackTime 1 0A Serial packet time ms(10 by default)
ucTimeCount 1 91
Higher 4 bits: pls set this bit to 8
TCP server type 1 80 (by default)
Lower 4 bits: tcp server type(this bit is only
useful when module work as tcp server)
1: transparent transportation
2: send with ID(discard packet if there is
no id)
3: send with ID(send to all client if there is
no ID)
Unused
(usually 4 bytes , but 60 byte when u used
ucReserved 4(60)
a httpd client firmware)
Send:
FF 52 06 AC CF 23 66 66 67 61 64 6D 69 6E 00 61 64 6D 69 6E 00 00 C2 01 00 08 01 01 01 00 00 00
00 17 00 17 00 31 39 32 2E 31 36 38 2E 30 2E 32 30 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 08 03 C8 00 00 00 0A 95 11 00 00 00 00 42
Checksum: 42 = 52 + 06 + ... + 00
Red part is mac address, followed with username + password + portx param + checksum(1 byte)
Attention, the mac address can only be programed once(when mac is default
FFFFFFFFFFFF).
Send:
FF 07 FE 00 11 22 33 44 55 sum
Return(sucess)
FF 01 FE 4B
2. Return command
0 TAG_STATUS FF
1 Packet_length 24
2 CMD_DISCOVER_TARGET 01
3 Board_type 00
4 Board_ID 00
AC CF 23 20 FE
9~14 MAC_address Device MAC(High bit in front)
3D
D0 07:Device version number (low
bit in front)
12 34:Encrypted version ;The others
is non encrypted version;Encrypted
15~18 Firemware_version D0 07 12 34
program upgrade directly in
encryption version;Non encrypted
version need to decrypt the
encrypted program,then send
55 53 52 2D 54
43 50 32 33 32
19~34 Application_title Device name
2D 35 30 30 00
00
35 checksum F0
Return(4 byte)
FF 01 02 4B (if usename and password correct 4B = 'K')
FF 01 02 45 (if username and pass correct = 'E')
2.3. Read return
Return all parameters of module, 256 byte in total, without checksum or header.
Must judge length of returned parameter.
If length is 193 byte(basic param + 2*port param), this means the module have 2 port.
If length is 256 byte(basic param + 3*port param), this means the module have 3 port.
returns(256 byte):
61 66 03 80 20 19 50 00 02 07 00 A8 C0 01 00 A8 C0 00 FF FF FF 55 53 52 2D 54 43 50 32 33 32 2D
45 34 35 00 00 61 64 6D 69 6E 00 61 64 6D 69 6E 00 02 01 00 00 AC CF 23 66 66 67 00 48 54 54 50
2F 31 2E 31 20 00 00 05 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 C2 01 00 08 01 01 01 00 00 00 00 17 00 17 46 31 39 32
2E 31 00 00 00 00 05 01 01 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08
05 C8 00 00 00 0A 36 11 00 C2 01 00 08 01 01 01 00 00 00 00 1A 00 1A 00 31 39 32 74 31 36 38 2E
30 00 00 00 00 05 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 04 C8 00 00 00
0A 1A 11 00 C2 01 00 08 01 01 05 00 00 00 00 1D 00 1D 00 31 39 32 2E 31 36 38 74 30 2E 32 30 31
If your read command is incorrect, it will return,
FF 01 03 45
The return have no checksum
Other return
Successfully execuated: FF 01 CMD 'K' ( the CMD is command byte in your command)
Checksum error: return 'E' + checksum(the correct checksum)
Username or pass error: FF 01 CMD 'P'
Other error will return: FF 01 CMD 'E'
3. Sample command and return
Search
Send(4 byte search command)
Ff 01 01 02
Return (36 byte)
FF 24 01 00 4B C0 A8 00 4D D8 B0 4C 00 04 C9 DD 07 01 00 55 53 52 2D 54 43 50 32 33 32 2D 34 30
31 00 00 EF
Reset module
send
FF 13 02 d8 b0 4c 00 04 c9 61 64 6d 69 6e 00 61 64 6d 69 6e 00 c8
return(4 byte):FF 01 02 4B
If you want to get some command and return sample while you are config module via software,
there is a way to get what you want.
Open a USR-TCP232-Test, and choose protocol UDP, listen on port 1901. When you are
searching or config a module using another PC, you can get their interchange message in the
receive window of Test software.
4. Serial config protocol
Get access to serial config mode, first, connect Reload(CFG) to GND.
Module config command format as following table, you can also use our setup
software(serial config part is compatible to USR-TCP232-T24 setup
No matter which baud is in previous, module will switch to 9600 in config mode, and send
character U to com, to indicate module do in config mode. After receiving complete data
package and check correctly, will reply K, if check incorrect, will reply E and module
calculate parity bit, this bit is quite useful when test to send command manually. For other
errors, for example incorrect package header or bit number, will reply only E.
Note: Need to release CFG to vacant or connect to VCC, to make module back to
working mode ( for E45/M4 series, release cfg (Reload) will make module saving
parameters and restart)
When write port config, all data bit according to the following table; when read port config,
send package header is enough. Example: send 55 BC, will read port 0 config
parameters.
Note: Writing in 28 byte but read as 29 byte .The last bit is version number, but it can’t
write
Note:
1. Except header, Send 28 bytes param when write, return 29 bytes when read. The last
byte is firmware version, not writable
2. TCP232-E45/M4 series products, after serial configuration (reload pin back to high
level), module will reset automatically, restart after 4s, during this time, do not pull down
the Reset pin, or module will restore to factory defaults
4.2. Param table 2