CX-WIFI-2NET module is an all-in-one 802.11 b/g/n Wi-Fi and Ethernet module that
provides a way to connect a user's physical device to a Wi-Fi wireless network or
Ethernet. Provides a solution for the UART data transfer interface. The module comes
with an RS485 port, a standard RS232 communication port and two RJ45 standard
network ports. Through this module, the traditional low-end serial device or
MCU-controlled device can easily access Wi-Fi wireless network or Ethernet.
Transparent transmission is realized to realize the control and management of the
Internet of Things.
As a hotspot, CX-WIFI-2NET module can accommodate 32 wifi clients simultaneously,
and can also accommodate 32 TCP clients at the same time. At the same time, the
module can be used as a secondary router and can be connected hand-in-hand.
There are eight indicators on CX-WIFI-2NET module, which are POWER, CHAR,
READY, LINK, NET1, NET2, RX, TX. The status of the indicator light is as follows:
After CX-WIFI-2NET module is powered on, it will automatically connect to the
wireless network and server according to the parameters set by the user, and enter the
set working mode, and open the serial port according to the preset serial port
parameters.
The parameters that the user needs to preset are:
Operating mode
Transparent transmission / serial command mode / HTTPD Client mode
Wireless network parameters
Network name (SSID)
Safe mode
Key
Default TCP/UDP connection parameters
Protocol type
Connection type (server or client)
Destination port
Destination IP address
Serial port parameter
Baud rate
Data bit
Check position
Stop bit
Hardware flow control
After the user has configured all the parameters and restarted, the module can
work according to the set parameters. Each section will be described in detail in the
following sections.
2.2 Operating mode
The module has three working modes: transparent transmission, serial command
mode, and HTTPD client mode.
2.2.1 Transparent transmission mode
CX-WIFI-2NET module supports serial port transparent transmission mode, which
can realize serial port plug and play, thus minimizing the complexity of user use. In this
mode, all data that needs to be sent and received is transparently transmitted between
the serial port and the WiFi or Ethernet interface, enabling data transfer between the
universal serial device and the network device without any analysis.
In transparent transmission mode, it can be fully compatible with the user's original
software platform. User equipment can support wireless data transmission without any
software changes.
<Description>:
Transparent transmission mode is the least complex data transmission. The user
turns on the hardware flow control (CTS/RTS) function of the serial port, which can
minimize the bit error rate.
2.2.2 Serial command mode
In this mode, users can send serial port data to different server addresses
according to our protocol, and send data to different servers without restarting. This
mode can send data to the server using UDP or TCP client.
The client MCU sends the packet in the following format. After the module is parsed,
only n bytes of data are sent to the destination address. When there is data return, the
data is directly output from the serial port without parsing.
Serial command mode protocol table:
Baotou:
Constant for 0x55 0xaa
Length:
The sum of all the number of bytes from the start of the function word to the check
(without the checksum). High byte first function word:
Bit0:( UDP:0 ;TCP:1)
Bit1:( Short connection: 0; long connection:1)
Bit2:( IP:0;Domain name:1)
Bit7:(Streamlined protocol: 0; Full protocol:1)Note: Currently only the streamlined
protocol is supported.
Note:
● For Bit1, if it is a short connection, the data will be disconnected after sending the
data; if it is a long connection, after the data is sent, the connection will remain until the
target address is changed again.
● For Bit2, it indicates whether the destination address is IP or domain name. If it is
IP, the destination address is 4 bytes. If it is a domain name, the target address length
is the length of the entire domain name string (where the last byte of the destination
address is 0x00). , that is, the end of the string, the length of the domain name is not
fixed).
● For Bit7, in the thin protocol, the reply frame contains only data. Under the full
protocol, the reply frame will have a frame failure such as sending failure, waiting for
timeout, and responding to the device IP under UDP broadcast.
Alternate parameter area:
The first byte: If it is a short connection, this location is the TCP wait timeout period
(1-255). If the response is not received after the send command is completed, wait for
the corresponding number of seconds. If it is 5, it means the maximum wait. 5s
disconnected; if the return data is received immediately after sending the command,
the connection is immediately disconnected; if it is a long connection, it is 0x00 here.
Second byte: reserved
Target port:
Little endian format, low byte first, such as port 23, here the order is 17 00
Target address:
If it is IP, it is 4 bytes, for example, 192.168.0.7 is represented as 07 00 A8 C0; if it
is a domain name, the address length is not fixed, ending with '\0'
Data:
Variable length, up to 1000 bytes
Calibration:
From the beginning of the function word, before the check byte, add the checksum.
The following are specific application examples:
Send data: 55 aa 00 0a 00 00 00 21 00 85 00 A8 C0 01 0f
Length byte 00 0a: length is n+m+5, here is 10
Function word 00: UDP mode
Target ip address 85 00 A8 C0:192.168.0.133
Data area 00: length is 1
Check calculation:
This mode is used to request data from an HTTP server or to submit data to a
server.
After the user sets the specific content of the HTTP protocol header with the AT
command or the web page. Each time data is sent, the module automatically
encapsulates the sent data into HTTP protocol data and sends it to the specified HTTP
server. It is convenient for users to read or submit data directly from the HTTP server. In
this mode, the user can send the data to the specified http server, and the module will
automatically add the http protocol header in front of the sent data. The content of the
specific protocol header can be set by the AT command or the web page.
The following are specific application examples:
First set the HTTP related parameters with the AT command.
AT+HTTPURL=192.168.1.1,80 Set the server's address and port
AT+HTTPTP=POST Set the HTTP type, GET, PUT,
or POST
AT+HTTPPH=/set Set the path in the protocol
header, up to 50 bytes
AT+HTTPCN=keep-alive Set Connection in the protocol
header, up to 20 bytes
AT+HTTPUA=lwip13.2 Set the User-Agent in the protocol
header, up to 20 bytes.
If the data sent is 1234.
Then on the 192.168.1.1 port 80 will receive the following data
POST/set HTTP/1.1
Connection:keep-alive
User-Agent:lwip1.3.2
Content-Length:4
Host:192.168.1.1:80
1234
If the HTTP type is GET, the data received on port 80 of 192.168.1.1 is
POST/set1234 HTTP/1.1
Connection:keep-alive
User-Agent:lwip1.3.2
Content-Length:0
Host:192.168.1.1:80
If the module receives data from the server, it will print directly to the serial port
without any processing.
Users can customize the content of the HTTP header in the new definition mode.
You can add, delete, and modify the content of each HTTP header according to your
needs. (If the HTTP request type is POST/PUT, the module will automatically add
Content-Length. ). The set commands include AT+HTPMODE, AT+HTPSV, AT+HTPTP,
AT+HTPURL, AT+HTPHEAD. For the specific command setting procedure, please
refer to the AT command section. Similarly, there are corresponding settings pages in
the web page.
Note: In the new setting mode, if you use the AT command to set the protocol
header, please use "<<CRLF>>" instead of the carriage return. You don't need to
consider the carriage return when setting the built-in webpage.
2.2.4 Modbus TCP and Modbus RTU mutual conversion
This module supports Modbus TCP to Modbus RTU (Modbus ASCII is not
supported); the network parameters of the module should correspond to the network
parameters of the application software. The TCP server corresponds to the TCP client,
and the port should also be configured to be the same. The working mode is Modbus
TCP<= >Modbus RTU (AT command: AT+TMODE=modbus).
The wireless module of the CX-WIFI-2NET module can be configured as a wireless
STA or as an AP. Therefore, the CX-WIFI-2NET module logically supports two wireless
interfaces, one as a STA and the other as an AP. Other STAs can connect to the
wireless network through the AP interface of this module. Therefore, the
CX-WIFI-2NET module can provide a very flexible networking mode and network
topology. The functional modules of the CX-WIFI-2NET module are shown below:
< Description >:
AP: The wireless access point is the central node of a wireless network. A
commonly used wireless router is an AP, and other wireless terminals can be
connected to each other through an AP.
STA: A wireless station is a terminal of a wireless network. Such as laptops, PDAs,
etc.
2.3.1 STA-based wireless network
The CX-WIFI-2NET module is connected to other APs as STAs (using the AP CLI interface) to
form a wireless network. All STAs use the AP as the center of the wireless network, and the mutual
communication between the STAs is completed by the AP. As shown below:
Because the CX-WIFI-2NET module can be set to either AP or STA, the CX-WIFI-2NET
module can easily implement the wireless network of the ad hoc network. As shown below. The
CX-WIFI-2NET module No. 1 is used as an AP. Other modules and computers can be connected to
this module as STAs. It can also be connected to user equipment through the UART interface;
CX-WIFI- 2 and 3 The 2NET module is connected to the No. 1 module as a STA, so that all
CX-WIFI-2NET modules can be managed by a computer. The self-organizing network mode can
facilitate the unified management of all CX-WIFI-2NET modules, and the self-organizing network
can easily expand the coverage of the entire wireless network.
The CX-WIFI-2NET module can support AP+STA. That is, the module supports
one AP interface and one STA interface at the same time.
In the figure, the module activates the function of AP+STA. The STA interface of the
module can be connected to the router and connected to the server in the network
through TCP connection. At the same time, the AP interface on the module is also
available. The mobile phone/PAD can be connected to this AP interface (via TCPB
connection) to control the serial device or set the module.
☆ With the AP+STA function, it is convenient to use the mobile phone/PAD and
other hand-held devices to monitor the user device without changing its original
network settings.
☆ The module can be easily set by the AP+STA function, which solves the
problem that the previous module can only be set through the serial port when it is in
the STA.
AP+STA Function setting:
The AP+STA function needs to be set through the serial port command
(F-logarithmic setting).
AT+FAPSTA=on Sets the AP+STA function (the factory settings are in effect).
Then when the module is set to STA mode, the AP interface is still valid.
Note on AT+STA mode:
When the AP+STA function is enabled, the STA port needs to be connected to
other routers. Otherwise, the STA port will continuously scan the router. When scanning,
it will affect the AP port, such as data loss.
If the user determines that the STA cannot connect to the AP at this time, you can
use the command to stop scanning the STA port.
AT+STTC=on/off, on means scanning the router, off is not scanning, and the
command is not saved after restarting.
AT+FSTTC=on/off, this command can be saved, and the original settings will be
maintained after restarting.
2.4 Ethernet interface networking mode
The CX-WIFI-2NET module provides a 100M Ethernet interface. Through this
100M Ethernet interface, users can implement WIFI port, serial port, Ethernet port, and
three interfaces to communicate with each other. In terms of networking, the
CX-WIFI-2NET module supports bridging mode, routing mode and switch mode to
correspond to different specific applications.
<Description>:
The Ethernet function has two network ports. The second network port can be used
as either a LAN port or a WAN port. The first network port can only be used as a LAN.
The bridge mode described below uses only the network port 2. The route mode can
use either network port 1 or network port 2. The switch mode uses two network ports at
the same time.
For different networking modes, the CX-WIFI-2NET module needs to be
version-switched through commands. Use the command AT+FVER=n to switch to the
(2.4.2) routing mode, and AT+FVER=z to switch to the (2.4.3) bridge mode.
2.4.1 CX-WIFI-2NET module Ethernet interface function (AP)
The CX-WIFI-2NET block acts as a STA and the module works in routing mode.
After the module is connected to the AP, obtain the IP address from the AP (as shown
in Figure 192.168.1.100). The modules themselves form a subnet (default
10.10.100.254), and the devices on the Ethernet interface are assigned addresses by
the module (see Figure 10.10.100.101). Thus, as PC1 is in the subnet (NAT), the
connection from PC1 can be connected to PC2 (because CX-WIFI-2NET works in
routing mode), but PC2 cannot actively connect to PC1.
2.4.3 CX-WIFI-2NET module Ethernet interface function (STA bridge mode)
The CX-WIFI-2NET module acts as a STA and the module works in bridge mode.
After the module is connected to the AP, the device on the Ethernet interface obtains
the IP address from the AP (as shown in Figure 192.168.1.101). At this time, the
entire network, the module is like a transparent device, and PC1 and PC2 can
communicate with each other without any constraint. However, if the CX-WIFI-2NET
module is to communicate with other devices, you need to statically set the LAN IP
address (as shown in Figure 192.168.1.10).
2.4.4 CX-WIFI-2NET Ethernet interface function (switch)
CX-WIFI-2NET module Ethernet interface function (switch)
The CX-WIFI-2NET module acts as an AP and the module works in switch mode.
The module is connected to the AP through the network cable 2, and is connected to
the PC1 through the network port 1, so that the PC1 obtains an IP (192.168.1.101)
from the AP. In this way, PC1 and PC2 can communicate directly under a LAN.
Multiple D2 modules can be added between PC1 and AP (both work in switch mode),
so that the modules can be extended by hand, so that the coverage of the AP
network can be extended.
Note: In this mode, the module DHCP should be turned off with
AT+DHCPDEN=off, otherwise the network will be abnormal. To access the module,
you need to manually change the LAN port address of D2 to the same network
segment (192.168 above). 1.102).
2.5 WI-FI parameter settings
2.5.1 Automatic frequency selection
When the module works in STA mode, the module adjusts itself to the same
channel as the AP according to the wireless channel of the AP and accesses it.
When the module works in AP mode, it can be set to automatic frequency
selection mode, so when the module starts, it will choose a better wireless channel
according to the surrounding environment.
2.5.2 Security Mechanism
The CX-WIFI-2NET module supports multiple wireless network encryption
methods to fully guarantee the secure transmission of data, including:
WPA-PSK/AES
WPA2-PSK/TKIP
WPA2-PSK/AES
Note: When WEP is encrypted, the HEX mode is a 10-bit or a 26-digit password,
the ASCII mode is a 5-digit or a 13-digit password, and the WPA-PSK and
WPA2-PSK passwords are at least 8 bits.
2.5.3 Add router function when STA
A "Search" button has been added to the module "Wireless Terminal Settings"
page. After clicking this button, a window will pop up showing the information of the
surrounding APs and select. As shown below:
There are three STA settings on this page. You can fill in one or fill in three. If all
three are filled in, the module will automatically switch to the next STA network if the
current network signal is less than the signal threshold (if the threshold is Filling in
100 will not automatically switch the network).
After selecting the router, it will return to the original page. At this time, the
encryption mode and encryption algorithm have been filled in. You only need to
Follow the prompts to write your password.
2.5.4 STA address binding function
CX-WIFI-2NET module supports the function of binding the BSSID of the
destination network during the networking process (as the STA, to connect to the
AP). According to the 802.11 protocol, different wireless networks may have the
same network name (ie, SSID/ESSID), but must correspond to a unique BSSID
address (ie, MAC address). Because the illegal intruder can connect the STAs in the
network to the illegal AP by establishing a wireless network with the same
SSID/ESSID, the network is leaked. Therefore, by binding the BSSID address, the
STA can be prevented from accessing the illegal network, thereby improving the
security of the wireless network.
2.6 Network parameter setting
CX-WIFI-2NET module has two TCP Sockets: Socket A and Socket B. The data
written to the serial port of the module will be sent to the Socket A and B
simultaneously; the data received by the module through Socket A or B will be sent
out through the serial port.
Through the different settings of the dual Socket, a variety of network
interconnection methods can be realized. Currently Sock B only supports tcp client.
2.6.1 Socket A
Socket A works in the following ways: TCP Server, TCP Client, UDP Server,
Shenzhen Coolmay Technology www.coolmay.net
CX-WIFI-2NET module user manual
Page 22 , Total 93 pages
UDP Client. For the setting method, please refer to the AT+NETP command in the
AT command.
When Socket A is set to TCP Server, it can support TCP link connections of up
to 32 TCP Clients. In the multi-TCP link connection mode, data transmitted from
TCP is forwarded one by one to the serial port. The data coming from the serial port
will be copied into multiple copies and forwarded on each TCP link. The specific data
flow chart shows:
2.6.2 Socket B
The working mode of Socket B is currently only TCP Client. For the setting
method, please refer to the AT+TCPB/AT+TCPPTB/TCPADDB/TCPTOB/TCPLKB
command in the AT command.
2.7 New feature settings
2.7.1 Tcp password authentication when establishing connection
This function is only applicable when the module is used as the tcp server. When
the tcp client is connected to the module, the module will authenticate each
connected tcp.
The first data sent after tcp clien is connected should be the module's webpage
password plus carriage return. By default, the password of the module is admin, so
the first data sent by the tcp client should be "0x61 0x64 0x6D 0x69 0x6E 0x0D
0x0A" (hexadecimal). If the password is correct, the module returns "OK" and vice
versa returns "NO" and disconnects.
This feature can be turned on or disabled in "TCP Connection Password
Authentication" on the web page. Please refer to the "Web Management Page"
section for details.
2.7.2 Register ID/MAC function
This function is only applicable when the module is used as the tcp client. When
the module is connected to the server, it will have a two-byte ID number in front of
the data (the ID range is 0~65535, the high byte is first, the low byte is at After) add
two bytes of ID inversion or upload a 6-byte MAC address. For example, if the
default ID of the module is 1111 (MAC address: D8B04CF20000), the first four bytes
are sent to the server as “0x04 0x57 0xFB 0xA8” (or 0xD8 0xB0 0x4C 0xF2 0x00
Shenzhen Coolmay Technology www.coolmay.net
Shenzhen Coolmay Technology Co.,Ltd
CX-WIFI-2NET module user manual
Page 23 , Total 93 Pages
www.coolmay.com
0x00).
There are two ways to register: one is to register your own ID/MAC when
connecting to the server for the first time; the other is to add ID/MAC in front of each
sent data.
The parameters related to this function are set on the “Serial Port and Other
Settings” section of the webpage. The ID/MAC function is built for the first time and
the ID/MAC function is disabled by default.
2.7.3 Adaptive baud rate function
Please use this function with our company's virtual serial port software.
In the virtual serial port software, select "synchronous baud rate (class
RFC2217)", and use the at command "AT+AABR=on" to open the module's adaptive
baud rate function and restart. As shown below:
www
Shenzhen Coolmay Technology Co.,Ltd
CX-WIFI-2NET module user manual
Page 24 , Total 93 pages
www.coolmay.com
In the virtual serial port software, select "synchronous baud rate (class
RFC2217)", and use the at command "AT+AABR=on" to open the module's adaptive
baud rate function and restart. As shown below:
In the picture, the virtual serial port synchronizes the baud rate. The baud rate of
the module changes with the baud rate of the virtual serial port at any time, and the
module does not need to be restarted. If the module is restarted, the baud rate will
return to the previous baud rate.
2.7.4 KeepAlive Function
When the TCP connected, the keep-alive mechanism is added. Therefore,
when the network of the module is abnormal, the network abnormality can be judged
and disconnected in time. When the network is restored, the network can also be
connected to the server in time.
2.7.5 Multi-STA Function
Added multiple SAT network setting function. In STA mode, if the connected
network has a low signal, it will automatically switch to other AP networks (it will
automatically restart when switching networks).
This function provides a signal threshold that automatically switches to the
network and restarts when the current network signal is below the signal threshold. If
the signal value is set to 100, the module will not switch to networks. Even if the
current network signal is not available, it will always search the current network and
will not reconnect to other networks.
The specific settings page of this function,Please refer to section 2.5.3 chapter.
This function can also be set by the AT command, refer to section
3.2.2.2.49-3.2.2.2.55 chapters.
2.7.6 Domain name backup and smart STA
After the domain name backup function is enabled, the IP address of the
domain name will be automatically saved when the module is connected to the
server of the domain name. If the server can’t be connected over five minutes
(Including the IP address cannot be resolved or the resolved IP address cannot be
connected.) it will automatically enable the alternate IP to connect.
This function can be turned on/off in the web page or AT command (AT+IPBUP).
Smart STA function. If the module is in STA mode and has not been connected
to the router for five minutes, the module will automatically start its own AP function
and connect the router every 80 seconds at a later time. This function allows the
user to continue to control the module or set the parameters of the module wireless.
This feature is always off.
2.8 Parameter setting
Shenzhen Coolmay Technology Co.,Ltd
CX-WIFI-2NET module user manual
Page 25 , Total 93 pages
www.coolmay.com
CX-WIFI-2NET module support web parameter settings, which can be easily set
by user using IE browser. If the module is connected to a wireless network, the PC
can be set up only if it is connected to the same wireless network. In addition, since
the CX-WIFI-2NET module is also an AP,PC can be set by being connected to the
module which needs to be set .
2.9 Firmware upgrade
The CX-WIFI-2NET module supports web online firmware upgrading.
Shenzhen Coolmay Technology Co.,Ltd
CX-WIFI-2NET module user manual
Page 26 , Total 93 pages
www.coolmay.com
Parameter
Default setting
SSID
USR-WIFI232-AP_xxxx
IP Address
10.10.100.254
Subnet Mask
255.255.255.0
User Name
admin
Password
admin
Chapter 3 Module parameter setting
3.1 Web Management page
When using the CX-WIFI-2NET module for the first time,needs to do some
configuration of this module. You can connect AP interface of the CX-WIFI-2NET
module via PC and manage page configuration via web.
By default, the SSID of the AP interface of the CX-WIFI-2NET module is
USR-WIFI232-AP_xxxx, and the IP address and user name and password are as
follows:
First connect the CX-WIFI-2NET module with the PC's wireless network card. The
SSID is USR-WIFI232-AP_xxxx. After connecting, open IE, enter web page:
http://10.10.100.254, Fill in the username and password in the pop-up dialog box,
then "confirm".
Then the web page will display the management page of the CX-WIFI-2NET module.
It supports Chinese and English language which can be selected in the upper right
corner. There are 10 pages, namely “Quick Configuration”, “Wireless Mode
Selection”, “Wireless Access Point Settings”, “Wireless Terminal Settings”, “Serial
Port and Network Settings”, “Ethernet Function Settings”, “HTTPD Client Mode”. ",
"IO Control" mode ,"advanced setting" and "module management".
Shenzhen Coolmay Technology Co.,Ltd
CX-WIFI-2NET module user manual
Page 27 , Total 93 pages
www.coolmay.com
3.1.2 Quick Configuration
Quick Configuration page provides users with a quick way to configure modules.
After configuring the parameters according to the page steps and restarting the
startup module, the module can work normally, reducing the configuration steps and
time. Of course, there are fewer options on this page. If you have some detailed
configuration, needs to visit corresponding page configuration.
This page has four options to configure and a restart item. Below corresponding
instructions:
Wireless configuration: configure the wifi working mode of the module, which
can be either AP mode or STA mode;
Ethernet function configuration: open/close the Ethernet port and set the
corresponding working mode;
Serial port configuration: configure the serial port parameters of the module,
including serial port baud rate, parity bit, 485 function, etc.
Network configuration: configure the network parameters of the module, only
TCPA relevant parameters;
Restart module: After all the above parameters are configured, click Restart
Module.
3.1.3 Wireless Mode Selection
This page can be set to select the module to work in AP mode or STA mode. The
working modes of the "Data Transfer Mode" selection module are "Transparent
Transfer Mode", "Serial Command Mode", and "HTTPD Client Mode".
Shenzhen Coolmay Technology Co.,Ltd
CX-WIFI-2NET module user manual
Page 28 , Total 93 pages
www.coolmay.com
3.1.4 Wireless Access Point Settings
The CX-WIFI-2NET module supports the AP interface,which could be used to
manage the module conveniently, and realize self-organizing network. The
management page is as shown below. Including: SSID settings, wireless network
mode settings and wireless security settings, and the setting of the LAN composed
of APs.
Loading...
+ 65 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.