Template: EMW3162 Uart-Wifi App Guide
From Waveshare Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
EMW3162 Uart-Wifi App Guide
Preparations
- Properly connect the EMW3162 module to the WIFI Shield.
- Connect the USB TO UART port to a PC, of which Wi-Fi function is needed.
Test the default configuration
- Open the Wi-Fi connection, and choose the connection of which prefix is MXCHIP.
- Run the software File:TCP232.7z
- Set the COMSettings area as: PortNum: Choose the COM Port listed in the Device Manager; BaudR: 115200; DPaity: NONE; DataB: 8 bit; StopB: 1 bit. Then click Open.
- Set the NetSettings area as: Protocol: TCP Client; Server IP: 192.168.1.1; Server Port: 8080. Then click Connect.
Set to AP mode
- Note: when the module is tested using the PC software, the USB to UART module should feature FT232 or FT230XS!
- The EMW3162 module is configured by UART commands. Please first connect the pin 30 to Low for entering command mode. When using the module with the WIFI Shield, you can switch BOOT to H and switch STATUS to L, instead of connecting the pin 30 to Low.
- Run the software EMW ToolBox(PC).
- Click the Refresh button to refresh the present COM port, and then choose the corresponding COM port, of which properties are set by default as:
- Click "Load Paras from module".
- Set the Wi-Fi mode to Soft AP Mode, set the SSID, i.e. the name of the Wi-Fi connection (for example, here the SSID is Waveshare).
- Click the Local IP tab and set the IP address of the module (for example, here is 192.168.1.100)
- Click the TCP/UDP Connection tab and set the Protocol as TCP Server; Port, e.g. 8899.
- When setup complete, click "Save Paras To Module" to save the parameters.
- Connect the pin 30 to High to reboot the module which will run with the configured parameters. When using the module with the WIFI Shield, you can switch STATUS to H, instead of connecting the pin 30 to High. Now you can connect the PC to the corresponding Wi-Fi connection:
- Run the software File:TCP232.7z.
- Set the COMSettings area as: PortNum: Choose the COM Port listed in the Device Manager; BaudR: 115200; DPaity: NONE; DataB: 8 bit; StopB: 1 bit. Then click Open.
- Set the NetSettings area as: Protocol: TCP Client; Server IP: 192.168.1.100; Server Port: 8899. Then click Connect.
Set to STA mode
- Note: when the module is tested using the PC software, the USB to UART module should feature FT232 or FT230XS!
- The EMW3162 module is configured by UART commands. Please first connect the pin 30 to Low for entering command mode. When using the module with the WIFI Shield, you can switch BOOT to H and switch STATUS to L, instead of connecting the pin 30 to Low.
- Run the software EMW ToolBox(PC).
- Click the Refresh button to refresh the present COM port, and then choose the corresponding COM port, of which properties are set by default as:
- Click "Load Paras from module".
- Set the Wi-Fi mode to Station Mode, and then input the SSID of a router to be connected.
- Choose the Wireless Encryption of the router and input the KEY.
- Click the Local IP tab and set the IP address of the module. Here we choose "Get IP address automatically". However, if you choose "Use the following IP address", make sure the IP address is not conflict with another system on the network.
- The expected result is that, the module can access server through router, here the server is emulated by the software File:TCP232.7z.
- Set the NetSettings area as: Protocol: TCP Server; Local host IP: 192.168.1.121; Local host Port: 8899. Then click Listening.
- For emulating the communication between the module and the server, set the module for connecting the server.
- When setup complete, click "Save Paras To Module" to save the parameters.
- Connect the pin 30 to High to reboot the module which will communicate with the router and server automatically. When using the module with the WIFI Shield, you can switch STATUS to H, instead of connecting the pin 30 to High.
- Set the COMSettings area as: PortNum: Choose the COM Port listed in the Device Manager; BaudR: 115200; DPaity: NONE; DataB: 8 bit; StopB: 1 bit. Then click Open.
STA Mode with Dual Sockets
- Set another socket on the basis of the configuration of STA mode before. Set the Protocol of Connection 2 as TCP Server; Port: 8080.
- Run the software File:TCP232.7z
- Set the COMSettings area as: PortNum: Choose the COM Port listed in the Device Manager; BaudR: 115200; DPaity: NONE; DataB: 8 bit; StopB: 1 bit. Then click Open.
- Set the NetSettings area as: Protocol: TCP Server; Local host IP: 192.168.1.121; Local host Port: 8899. Then click Listening.
- Reboot the module and it will connect to the corresponding router and server.
- Open another window of TCP232 and set as:
- Set the NetSettings area as: Protocol: TCP Client; Server IP: 192.168.1.169 (this IP is assigned from the module automatically); Server Port: 8080. Then click Connect.
- Now both of the Socket can receive the messages from the UART, while the module can receive the messages from both of the Socket individually: