Table of Contents

Advertisement

Quick Links

UART-WIFI232-B2 User Manual
UART-WIFI232-B2
User Manual
Figure UART-WIFI232-B2
www.waveshare.com
1

Advertisement

Table of Contents
loading

Summary of Contents for Waveshare UART-WIFI232-B2

  • Page 1 UART-WIFI232-B2 User Manual UART-WIFI232-B2 User Manual Figure UART-WIFI232-B2 www.waveshare.com...
  • Page 2: Overview

    UART-WIFI232-B2 User Manual 1. OVERVIEW Features: Support 802.11b/g/n wireless standard.  CE/FCC/ROHS standard certifications.  Support WiFi protocol and TCP/IP network protocol stack.  Support UART/Ethernet data communication interface.  Support wireless operation on STA/AP/AP+STA mode.  Support router/bridge network mode.
  • Page 3: Table Of Contents

    UART-WIFI232-B2 User Manual CATALOGUE 1. Overview ..............................2 2. Quick get start ............................6 2.1 Hardware Connection ........................6 2.2 network connections ........................7 2.3 Data transmission test .........................9 3. Overview ..............................10 3.1 Introduction ..........................10 3.2 Electrical parameter ........................10 3.3 Product appearance ........................11 3.4 Antenna .............................
  • Page 4 UART-WIFI232-B2 User Manual 5. Product networking application ......................29 5.1 Wireless networking settings ....................29 5.2 Wireless networking applications ..................... 31 5.2.1 Wireless Networking Applications (AP) ................31 5.2.2 Wireless networking application (STA) ................32 5.2.3 Wireless networking application (AP+STA) ..............33 5.2.4 Wireless networking application (AP, STA) ..............
  • Page 5 6.12 Timeout reboot function ......................73 6.13 Timed reboot function ......................74 6.14 Modbus polling ........................74 6.15 KeepALIVE Function .........................75 6.16 Websocket function ........................ 75 6.17 MQTT function .........................75 6.17.1 MQTT function introduction ..................75 6.17.2 UART-WIFI232-B2 Parameter Configuration ..............76 www.waveshare.com...
  • Page 6: Quick Get Start

    In order to test the communication conversion of UART to WiFi/Ethernet, we replace the UART of the UART-WIFI232-B2 module with a USB-to-Serial module (such as the CH343 USB UART Board or FT232 USB UART Board) and a wireless network card. The hardware connection is as shown in the following diagram: www.waveshare.com...
  • Page 7: Network Connections

    UART-WIFI232-B2 User Manual Figure Hardware Connection 2.2 NETWORK CONNECTIONS Let's take WIFI connection as an example to introduce the network connection process. Open the wireless network connection and search for the network. As shown in the figure below, "Waveshare_xxxx" (xxxx is the last four digits of the MAC address) is the default network name (SSID) for the serial server.
  • Page 8 UART-WIFI232-B2 User Manual Figure Wireless Network SSID Search Join the network, choose to automatically obtain IP, UART-WIFI232-B2 serial server supports DHCPServer function and is enabled by default. www.waveshare.com...
  • Page 9: Data Transmission Test

    Open the testing software "SSCOM.exe". Connect to the computer's COM5 (select the appropriate port based on your situation). Choose the UART-WIFI232-B2 serial server's default baud rate of 57600, and click "Open Port". Open another instance of "SSCOM.exe". In the network settings section, choose TCP Client mode.
  • Page 10: Overview

    3. OVERVIEW 3.1 INTRODUCTION The UART-WIFI232-B2 serial server supports UART-to-Wi-Fi, allowing you to convert a serial port into a TCP/IP network port. This enables bidirectional transparent data transmission between the serial interface and Wi-Fi. This enables serial devices to immediately have TCP/IP network interface...
  • Page 11: Product Appearance

    Command setting Structure AT+Command Protocol TCP/UDP/ARP/ICMP/DHCP/DNS/HTTP/MQTT Maximum TCP connections User Web Server+AT Command Configuration Configuration Customer Support customer customization of application application software software 3.3 PRODUCT APPEARANCE The following image shows the appearance of UART-WIFI232-B2: www.waveshare.com...
  • Page 12: Antenna

    UART-WIFI232-B2 User Manual Figure Product Appearance 3.4 ANTENNA The module defaults to the external antenna version, which can be connected to the matching WiFi antenna externally through the IPEX connector. If users need to switch to the on-board PCB antenna, they can modify the pads at the red box to switch.
  • Page 13: Interface Description

    UART-WIFI232-B2 User Manual 3.4 INTERFACE DESCRIPTION Description Network Network Description Name Name Ethernet output+ PHY_TX+ PHY_TX- Ethernet output- Ethernet input+ PHY_RX+ PHY_RX- Ethernet input- Module startup status nReady nReload Restore factory settings indications Module Reset RESET nLink WiFi status indications...
  • Page 14 UART-WIFI232-B2 User Manual UART request to send signal UART_RTS UART_CTS UART allowed to send signal UART sends data UART_TXD UART_RXD UART receives data 3.3V VCC 3.3V(350mA) Network Description Type Note Name Power Ground VCC 3.3V@350mA 3.3V Power External power: 3.3V@ 350mA...
  • Page 15: Outline Dimensions

    Ethernet output - PHY_TX- 3.5 OUTLINE DIMENSIONS Figure Outline dimensions 3.7 APPLICATION SCENARIOS The application scenarios of UART-WIFI232-B2 is as shown below: The seial port (RS232/485) to WiFi/ETH are as follows:  WiFi remote control/monitor, TCP/ip AND WiFi co-processor. ...
  • Page 16 UART-WIFI232-B2 User Manual Other wireless related secondary development and application in modern agriculture and  military fields; Smart factories, smart homes, smart medical care and other fields.  www.waveshare.com...
  • Page 17: Product Parameters Setting

    Web. 4.1 WEB MANAGEMENT PAGE When using UART-WIFI232-B2 serial server for the first time, it is necessary to configure the WIFI serial server. You can connect the AP interface of UART-WIFI232-B2 through a PC and configure it with a web management page.
  • Page 18: Quick Configuration Page

    Figu re Quick Setup Page The quick configuration page provides a method for users to quickly configure UART-WIFI232-B2 serial server. After configuring the parameters according to the steps on the page and restarting the WIFI serial server, the WIFI serial server can work normally, which reduces the steps and time of configuration.
  • Page 19: Mode Selection Page

    4.1.3 MODE SELECTION PAGE The first page of the Web can be set to select UART-WIFI232-B2 serial server to work in AP mode or STA mode. "Data transmission mode" the working modes of WIFI serial server are transparent transmission mode, serial command mode, HTTPDClient mode and ModbusTCP<=>ModbusRTU mode.
  • Page 20: Wireless Terminal Settings Page

    Figure Access point settings 4.1.5 WIRELESS TERMINAL SETTINGS PAGE Wireless terminal interface, also known as STA interface. UART-WIFI232-B2 can be connected to other wireless networks through the STA interface, as shown in the following figure: The settings on this page include two tables. The top one is the wireless settings for STA, including the SSID of the AP to be connected, security settings, etc.
  • Page 21: Serial Port And Network Settings Page

    UART-WIFI232-B2 User Manual Figure Wireless Terminal Interface Settings 4.1.6 SERIAL PORT AND NETWORK SETTINGS PAGE Application program settings refer to the settings of WIFI to serial port application parameters, including serial port parameter settings, automatic framing settings, Ethernet function settings, device registration package settings, and network protocol settings.
  • Page 22: Ethernet Function Settings

    TCP connection password verification: When UART-WIFI232-B2 is working in TCP Server mode, perform password verification on the connected TCPClient. Note: This verification only works when the UART-WIFI232-B2 serial server is used as the TCP Server. When enabled, TCPClient connects to the TCPServer of the WIFI serial port server, the first data sent to UART-WIFI232-B2 serial server is password plus carriage return.
  • Page 23: Httpdclient Mode Page

    UART-WIFI232-B2 User Manual This page is used to set the Ethernet port of the module, which can be enabled or disabled. Moreover, it can be used as a WAN port, so that the module can be used as a secondary router, which is convenient for users to network.
  • Page 24 UART-WIFI232-B2 User Manual Figure Web Page Setting HTTPDClient Mode www.waveshare.com...
  • Page 25: Mqtt Function Settings Page

    UART-WIFI232-B2 User Manual Figure Example of Webpage HTTPDClient Mode Test Settings 4.1.9 MQTT FUNCTION SETTINGS PAGE This webpage sets MQTT function related parameters, including server parameters to connect to, publish topic parameters, and subscribe topic parameters. For specific usage of MQTT functions, please refer to the relevant chapters of this manual titled "MQTT Functions".
  • Page 26: Module Management Page

    UART-WIFI232-B2 User Manual Figure Webpage MQTT function settings 4.1.10 MODULE MANAGEMENT PAGE Module management includes username/password settings, factory reset, and software upgrade functions. www.waveshare.com...
  • Page 27: Software Configuration

    "OK" to confirm the settings, these changes will only take effect after the user clicks "Restart" on the module management page. After clicking “Reboot”, the UART-WIFI232-B2 serial server reset and reboot, refreshing the previous configuration information stored in the memory.
  • Page 28 UART-WIFI232-B2 User Manual The device supports features like one-click firmware upgrades and batch parameter configuration. The interface might look like the following figure: Figure Serial Port and Network Parameter Settings Batch parameter configuration setting and firmware upgrade interface as shown below:...
  • Page 29: Product Networking Application

    Figure Batch Parameter Configuration Page 5. PRODUCT NETWORKING APPLICATION The UART-WIFI232-B2 serial server can be configured as either a wireless STA or an AP. So UART-WIFI232-B2 logically supports two wireless interfaces, one as an STA and the other as an AP.
  • Page 30 The webpage configuration is as follows: Figure Wireless Networking Settings webpage The UART-WIFI232-B2 serial port server can be configured as either a wireless STA or an AP. There are AT commands and web page settings that can be set, as follows: (1) AT command setting mode: it can be set by AT+WMODE, which can be set as AP or STA.
  • Page 31: Wireless Networking Applications

    UART-WIFI232-B2 User Manual AT+Z After restarting, the serial server works in STA mode. (2) The webpage is set as follows: For example, log in to the built-in webpage of the serial port server, enter the mode selection page, and select the Station mode (set the WIFI serial port server to STA mode), as follows:...
  • Page 32: Wireless Networking Application (Sta)

    5.2.2 WIRELESS NETWORKING APPLICATION (STA) UART-WIFI232-B2 serial server is connected to other AP (such as routing in local area network) as a STA to form a wireless network. All STAs regard this AP as the center of the wireless network, and...
  • Page 33: Wireless Networking Application (Ap+Sta)

    Complete the parameter setting. 5.2.3 WIRELESS NETWORKING APPLICATION (AP+STA) The UART-WIFI232-B2 serial server can support both an AP interface and an STA interface. When the AP+STA function is enabled, both the STA and AP interfaces are available. The STA interface of the serial server is connected with the router and connected with the server in the network through TCPB;...
  • Page 34 AT+WMODE=STA (4) Set the parameters for the WIFI serial server to connect to the route (assuming the route SSID in the figure above is WAVESHARE-WIFI-TEST, the encryption mode algorithm is WPA2PSK, AES, and the password is www.waveshare. com), as follows: AT+WSSSID=WAVESHARE-WIFI-TEST AT+WSKEY=WPA2PSK, AES, www.waveshare.com...
  • Page 35: Wireless Networking Application (Ap, Sta)

    Figure Wireless networking application (AP+STA) 5.2.4 WIRELESS NETWORKING APPLICATION (AP, STA) The UART-WIFI232-B2 device's wireless functionality can be configured in two modes: as a wireless Station (STA) or as an Access Point (AP). Logically, it supports two wireless interfaces: one...
  • Page 36 You can also choose settings as required, or use default parameters. Examples of parameter settings for WIFI serial server 2 are as follows: At+WAP = 11bgn, waveshare-test, auto (optional) AT+WAKEY=WPA2PSK,AES,12345678 (optional) An example of parameter setting for No.1 WIFI serial server is as follows (set the SSID and...
  • Page 37: Wired Networking Setup

    UART-WIFI232-B2 User Manual Consistent with the parameter setting example of WIFI serial server 2. (4) Restart the WIFI serial server: AT+Z Complete the parameter setting. 5.3 WIRED NETWORKING SETUP Related AT commands are as follows: Table related command list Item...
  • Page 38: Wired Networking Application

    5.4 WIRED NETWORKING APPLICATION 5.4.1 WIRED NETWORKING APPLICATION (APLAN) When UART-WIFI232-B2 is used as AP, other computers or devices can be connected to the serial port server as STA through RJ45 (i.e. network cable) and wireless mode, and a network is formed centering on the serial port server.
  • Page 39: Wired Networking Application (Apwan)

    5.4.2 WIRED NETWORKING APPLICATION (APWAN) The UART-WIFI232-B2 serial server is used as AP, Ethernet port is set as WAN port, and it is connected to the route that can access the external network, so the DHCP server function is enabled.
  • Page 40: Wired Networking Application (Routing)

    5.4.3 WIRED NETWORKING APPLICATION (ROUTING) The UART-WIFI232-B2 serial server as STA, and the serial server works in router mode. After the serial server is connected to the AP, it obtains the IP address from the AP (as shown in Figure 192.168.1.101).
  • Page 41 UART-WIFI232-B2 User Manual 10.10.100.101). As shown in this figure, PC1 is in the subnet (NAT), so the connection can be initiated from PC1 and connected to PC2 (because UART-WIFI232-B2 works in routing mode), but PC2 cannot actively connect to PC1.
  • Page 42: Wired Networking Application (Bridge)

    5.4.4 WIRED NETWORKING APPLICATION (BRIDGE) The serial server of UART-WIFI232-B2 is STA, and works in bridge mode. After the serial server connecting to AP, the device of the Ethernet port gets the IP address from the AP (as shown in Figure 192.168.1.101).
  • Page 43: Working Mode

    "UART-WIFI232-B2 AT Command Set" documentation. 6.1.1 TRANSPARENT TRANSMISSION MODE UART-WIFI232-B2 supports the serial port transparent transmission mode. In this mode, all the data that need to be sent and received are transparently transmitted between the serial port and WIFI/ Ethernet, without any parsing, so as to realize the data transmission between universal serial port devices and network devices.
  • Page 44: Serial Command Mode

    In this mode, users can send data to servers according to our protocol, and can send data to different servers without restarting. In this mode, when the UART-WIFI232-B2 serial server is used as UDPClient or TCPClient, users are allowed to send serial data to different servers, regardless of the number of Soc0ket.
  • Page 45 UART-WIFI232-B2 User Manual The sum of all bytes from the start of the function code to the checksum (excluding the checksum). Note: The high byte comes first. Function code: Bit0:(UDP:0; TCP:1) Bit1: (Long connection: 0) Note: Only long connections are supported at present.
  • Page 46: Httpdclient Mode

    AT instruction or webpage. This mode is used for UART-WIFI232-B2 to transmit data to or obtain data from the HTTP server. After the user sets the specific content of HTTP header with AT command or webpage. Every time data is sent, UART-WIFI232-B2 will automatically package the sent data into HTTP protocol data and send it to the designated HTTP server.
  • Page 47 UART-WIFI232-B2 User Manual Figure HTTPDClient functional block diagram In GET mode, after the serial server receives the user's serial data packet, the packaging format is follows: In POST mode, after the serial server receives the user serial data packet, the packaging format is as follows: www.waveshare.com...
  • Page 48 Set/query HTTPDClient short connection timeout (3-65535s) The following are examples of specific applications: First, use AT command to set the related parameters of HTTP: If the data sent is 1234, Then the 80 port of test.waveshare.com will get the following data: www.waveshare.com...
  • Page 49 Connection:keep-alive User-Agent:lwip1.3.2 Content-Length:4 Host:test.waveshare.com:80 1234 If the HTTP type is GET, the data received on port 80 of test.waveshare.com is GET/1.php?data=1234HTTP/1.1 Connection:keep-alive User-Agent:lwip1.3.2 Host:test.waveshare.com:80 When the request mode is POST or PUT, the serial data will be added to the position behind the HTTP protocol header;...
  • Page 50 UART-WIFI232-B2 User Manual Figure HTTPD Client request type (2) Under the serial port and network configuration page, select the HTTPDClient mode as long/short. If it is set to the short connection state, you can set the timeout of 3-65535(s). www.waveshare.com...
  • Page 51 UART-WIFI232-B2 User Manual Figure HTTPDClient Short Connection Timeout Settings The user can also set it through the AT command. (1) Set/query long/short connection of HTTPDClient, taking short connection as an example; AT+HTTPSCEN=short (2) Set/query timeout interval (3-65535) seconds in short connection mode; Take 3 seconds as an example;...
  • Page 52 UART-WIFI232-B2 User Manual (1)Set the HTTPD Client POST parameter through the web page: (2)Open SSCOM serial communication assistant and send Json format through RS232/485 interface: "apikey": "tPmAT5Ab3j888", "value1": "33", "value2": "3", "value3": "22" (3)After sending successfully, the prompt in the red box will be returned:...
  • Page 53 UART-WIFI232-B2 User Manual (4)Open a web page:https://pico.wiki/esp-chart.php , you can see the POST to the server data chart, as shown in the figure below: www.waveshare.com...
  • Page 54 UART-WIFI232-B2 User Manual HTTPD GET measured demonstration: (1)Set the HTTPD Client GET parameter through the web page: www.waveshare.com...
  • Page 55 UART-WIFI232-B2 User Manual (2)Open SSCOM serial communication assistant and send it through RS232/485 interface. You need to get the latest value of a certain value on the webpage, for example, to get the latest value of value3: variable=value3 (3)After sending successfully, the following is returned:...
  • Page 56: Modbustcp<=>Modbusrtu Conversion Mode

    UART-WIFI232-B2 User Manual (4)It is the same as that obtained through a web browser, as shown in the following figure: 6.1.4 MODBUSTCP<=>MODBUSRTU CONVERSION MODE This serial server supports ModbusTCP to ModbusRTU (ModbusASCII is not supported); The network parameters of the module should correspond to those of the application software, the TCPserver should correspond to the TCPclient, and the ports should be configured the same, and the working mode should be ModbusTCP<=>ModbusRTU.
  • Page 57: At Command Mode

    AP according to the wireless channel of AP, and access it. When UART-WIFI232-B2 works in AP mode, it can be set to automatic frequency selection mode, so when UART-WIFI232-B2 is started, a better wireless channel will be selected according to the surrounding environment.
  • Page 58: Sta Joins The Routing Function

    Note: The passwords of WPA-PSK and WPA2-PSK are 8-63 digits. 6.2.3 STA JOINS THE ROUTING FUNCTION The working mode of UART-WIFI232-B2 is set to Station mode. Click the "Search" button in the "Wireless Terminal Settings" page, and a window will pop up to display the information of the surrounding AP.
  • Page 59: Uart Framing Mechanism

    UART-WIFI232-B2 User Manual Table SocketA related AT command list Item Note NETP Set/query the network protocol parameters of TCPA TCPLK Query whether the TCP link is established. TCPTO Set/query TCP timeout TCPDIS Connect/disconnect TCP (valid only for TCPClient) SocketB setting: AT+TCPB/AT+TCPPTB/TCPADDB/TCPTOB/TCPLKB/TCPDIS...
  • Page 60: Uart Free-Frame Mode

    UART-WIFI232-B2 User Manual Figure Webpage Sets Serial Parameters AT Command Settings If you need to change the WiFi serial server baud rate to 115200bps, use the following command: AT+UART=115200,8,1,None,NFC 6.4.2 UART FREE-FRAME MODE The default interval time for two bytes in the WiFi serial server is 10ms, which means that when the interval time is greater than 10ms, a frame is considered complete.
  • Page 61: Uart Automatic Framing Mode

    6.4.3 UART AUTOMATIC FRAMING MODE For fixed-length data frames on the serial port, you can enable the UART automatic framing function, and set the automatic framing trigger time and trigger frame length. UART-WIFI232-B2 will send the data from the serial port.
  • Page 62: Password Authentication When Tcp Establishes Connection

    After connecting via TCPClient, the first data to be sent should be the web password of the UART-WIFI232-B2, followed by a carriage return and line feed. By default, the password of UART-WIFI232-B2 is admin, so the first data sent by TCPClient should be "0x610x640x6D0x690x6e0x0D0x0A"...
  • Page 63: Description Of Rfc2217 Protocol

    UART-WIFI232-B2 User Manual Figure RFC2217 automatic baud rate 6.6 DESCRIPTION OF RFC2217 PROTOCOL The length of the protocol is 8 bytes, and the specific content of the protocol is as follows. The numerical value of the example is in HEX format: Attachment: Explanation of the meaning of serial port parameter bit.
  • Page 64: Fast Networking Protocol

    UART-WIFI232-B2 User Manual See attached table Example 55AA55 01C200 (115200, N, 8,1) Example 55AA55 002580 (9600,N,8,1) Form query reply instruction No. Name Bytes Note Header Fixed value 0xFF Length The total number of bytes after the length (excluding the length itself) and before the checksum byte (excluding the checksum byte).
  • Page 65 UART-WIFI232-B2 User Manual Table query instruction Name Number of Note bytes header Fixed value 0xFF Length The number of bytes after the length (excluding the length) and before the checksum (excluding the checksum). Command Command type, 0x01 is a query instruction...
  • Page 66 UART-WIFI232-B2 User Manual Example: Mobile phone sent to WIFI serial server (hexadecimal number): FF00010102. WIFI serial server returns to mobile phone (hexadecimal number): FF00148102544553543100400D0A 544553543200370D0A1F Note: The mobile phone sends a query instruction to the WIFI serial server to query the router related information.
  • Page 67: Local Area Network Search

    UART-WIFI232-B2 supports local network search functionality. This means that when UART-WIFI232-B2 is connected to a wireless router, users can obtain the IP address of the current local network serial port server for UART-WIFI232-B2 by sending a UDP broadcast to a specific fixed port.
  • Page 68: Registration Packet Function

    AT command. Note: The search tool and UART-WIFI232-B2 must be on the same LAN. If multiple STAs are connected to a router, the computer running the search tool is also connected to that router. This search tool can find all the STAs.
  • Page 69: Customized Heartbeat Packets

    UART-WIFI232-B2 User Manual Figure data carrying registration package diagram Parameters related to this function are set in the "serial port and other settings" section of the webpage, which is disabled by default. The relevant instruction settings are as follows: Table Registration Package Command List No.
  • Page 70 AT+HEARTTP=NET (3) Set the heartbeat packet data (up to 40 bytes), for example, to set the data to the string www.waveshare.com, you need to first convert it to a hexadecimal string as 7777772E7761766573686172652E636F6D。 AT+HEARTDT=7777772E7766573686172652E636F6D (4) Set the interval time for sending heartbeat packets, with a range of 1-65535s and a default of 30s.
  • Page 71: Socket Distribution Function

    30 seconds, the serial server will send the string www.waveshare.com to the server. The related instructions are set as follows: Table heartbeat packet instruction list No.
  • Page 72 UART-WIFI232-B2 User Manual The length is variable, and the length of the whole data packet is not more than 4096 bytes. Checksum: Starting from the parameter area (including the parameter area), and counting up to the byte before the checksum byte, calculate the sum and take the last byte as the checksum byte.
  • Page 73: Timeout Reboot Function

    UART-WIFI232-B2 User Manual Starting from the parameter area (including the parameter area) and before the checksum byte, add and take the last byte as the checksum byte. The following is a specific application example: AAFD5500036100CC2D (Hex) Among them, length byte 0004: is length 4.
  • Page 74: Timed Reboot Function

    UART-WIFI232-B2 User Manual The "timeout reboot" here means no data restart. In transparent transimission mode, when the timeout restart feature is enabled, if the module's WiFi is not connected or if WiFi is connected but there is no communication within the set timeframe, the module will be restarted. To enable the...
  • Page 75: Keepalive Function

    The MQTT protocol is lightweight, simple, open, and easy to implement, which makes it highly versatile and applicable in a wide range of scenarios. The MQTT function settings of UART-WIFI232-B2 are highly flexible, allowing you to configure almost all MQTT protocol-related connection parameters, publish topic parameters, and subscribe topic parameters.
  • Page 76: Uart-Wifi232-B2 Parameter Configuration

    UART-WIFI232-B2 User Manual UART-WIFI232-B2 MQTT's subscribe topic modes include Pure Transparent Subscribe Mode (subscribed topic data transparently transmitted to the serial port) and Topic-Carrying Subscribe Mode (subscribed topic data carrying the topic is transparently transmitted to the serial port). 6.17.2 UART-WIFI232-B2 PARAMETER CONFIGURATION...
  • Page 77 UART-WIFI232-B2 User Manual Figure MQTT function settings page www.waveshare.com...

Table of Contents