HLK-RM04 is one of those cheap Wifi <-> UART modules which started to appear in the market. This kind of module basically abstracts all the TCP/IP and Wifi stuff, enabling use it as an easy web socket to/from serial port solution. Here you can see how to use it.
In brief, send bytes through the module TX pin and receive them in the socket client, then the socket client sends data back and receive them in the UART RX pin. The pins that matters are listed below:
pin 1 - 5 V In, module power supply pin 2 - 0V / GND pin 4 - 3.3 V Out *pin 10 - ES/RST, keep with 3.3v (you can connect to pin 4) pin 20 - UART RX, used to receive AT commands too pin 21 - UART TX, used to send AT commands too * Put 0v between 100 ms and 6000 ms to reset the factory settings
Now connect the module to your PC USB (you can use any USB <-> Serial cable), open the manufacturer configuration software, connect to the COM port and you will be able to configure it:
The module supports two wifi modes: client, that connects to an existing Access Point (AP), like your home/internet AP or Android HotSpot, and server, which creates an AP, with the chosen name (SSID) and password (Key).
Although this is the configuration software, it's just an interface that sends (under the hood) AT commands to the module, which is how you can program your wifi module using a microcontroller in some real application, because of course, you will not be able to use this software!
The AT commands are all in the module datasheet, the default serial connection baud rate is 115200 8N1. For example, this command will get the current module's IP:
Now the trick part, you MUST send in the end a carrier return (\r) and line feed (\n) ASCII commands, they are not ASCII visible, so configure your serial terminal software to send them. I like to use the "HTerm" terminal software for Windows, and this is how you can configure it:
Ok, now you know how to configure it by the Windows interface and AT commands, get the module IP and access it using your browser, then go to the Serial2Net settings page:
Here let's create a TCP/IP <-> UART server in the wifi module, just configure it like the fields in the above image, but pay attention, here is another trick! the web page has a bug, so to unlock the IP field select "Client" first, then "Server".
Now the module is ready! just use any TCP/IP socket client like netcat for Linux users or putty for Windows, connect to the module address, send/receive data and look them in the terminal software being received by the UART, then do the opposite way, send through the terminal software and look in the client software!