chose a language

WI-FI HLK-RM04 Module

WI-FI HLK-RM04 Module

 

HLK-RM04

 

 

 

Preface

The  Wi-FI HLK-RM04 module allows you to transform a  UART/USART port more commonly known as a serial (RS-232 protocol as the only difference signal levels that would require a max232 for direct connection to a PC example) in an attested port on an Ethernet network and\or WI-FI, therefore, with the appropriate configurations and network structures allows any microprocessor (MCU) of the microchip or Atmel (commonly mounted on Arduino boards), or anything else that can communicate on port UART / USART to reach and be reached from any point on the earth and not only!

 

The specifications

HLK-RM04 PIN diagram

To begin, we can indicate the size of the module Wi-Fi HLK-RM04 which are 29 mm * 40 mm * 8.8 mm, after which we can list:

  • 2,4GHz 802.11 b/g/n  compatible.
  • Network standard on wire IEEE 802.3, IEEE 802.3u.
  • Network standard on WI-FI IEEE 802.11n, IEEE 802.11g, IEEE 802.11b
  • WIFI Client/AP/Router.
  • wps/wds.
  • possible speed UART configurable; about this since there are documents with different indications, there is the one that says 50 to 230400 bps and another declaring 1200 to 500000 bps; what to say? I have tested up to 250000 bps, and I seemed to work fine.
  • Wireless transmission rate 11n 150Mbps, WI-FI 11g 54Mbps, WI-FI 11b 11Mbps
  • CPU on board RT5350@360MHz
  • 2 ports UART.
  • 2 ports 10/100 RJ-45 for LAN connectio.
  • 1 USB 2.0 (host/slave)
  • supports the following algorithms and security protocols  WEP64/WEB128/TKIP/AES  WEP/WPA-PSK/WPA2-PSK.
  • supports the network protocols  PPPOE/TCP/UDP/DDDNS/DHCP/DNS/HTTP.
  • configurable via AT commands over a serial connection or via WEB interface.
  • pin with voltage output 3,3V ( max 300 mA).
  • pin with voltage output 1,8V (max 300mA).
  • Supply Voltage 5V (min 3,9V, max 5,5v).
  • Current consumption about 140mA for wifi - UART.
  • Current consumption about  120 mA for one RJ-45 - UART.
  • Default Current consumption that is when is all enabled(tho ports RJ-45, the WI-FI) approximately 160 mA.

 

From these early features it soon becomes clear that through this module you can implement different configurations and different modes of communication.

The real experts may even rewrite the firmware for the module and adapt it to their needs,  please refer to the link OpenWrt for more details.

For the model of the module Wi-Fi HLK-RM04 which has not an antenna printed on the PCB, but that needs of an antenna connected via a connector  IPX end, even if not sold together are strongly advised to make use of it, because  the module has a minimum range, which greatly increases with the antenna.

 

If it is sufficient the only part WI-FI\UART to below is shown  the minimum connection diagram:

 

HLK-RM04 schema

To be honest, if you do not require some type of special functionality for example  the  wps functionality or some other type, you can connect only the 5V pin (pin 1), the ground pin (pin 2) and the TX \ RX  pins (pin 21 and 20) for UART communication - WIFI.

For all other characteristics, please refer to datasheet that can be downloaded here  Datasheet Area Download

 

The Expansion card\Test

 

In support of the Wi-Fi module HLK-RM04 there's also a test board  that has implemented all the connections that it has:

  • The Serial(RS-232 compliant) for connect the module to the PC.
  • two network ports for  LAN with RJ-45 connector.
  • wps/wds button.
  • trasmission mode  button (trasparent/AT command).
  • power connector. 

In short, all that is needed to fully exploit the module without too much trouble.

 

Below is a picture of the card:

HLK-RM04 test board

 

Mode of Operation

Talk about  of mode of operation for a module as simple as complex as this is a bit complicated.

To try to simplify,  first we can discuss about how the module can  access to the network and about its configuration to turn the data to the uart, and then how to communicate with the module Wi-Fi-RM04 for to turn the data.

Thus we can say that there are 4 modes of access to the network  that are so identified:

 

 Default mode 

HLK-RM04 DefaultMode

In this mode is all enabled, by this I mean that the two wired network connections connected via RJ-45 are active and operate one as a LAN and one as a WAN, and the Wi-Fi is in AP (Access Point).

Through the appropriate settings, the data between UART and network can achieve mutual conversion.

Serial to Ethernet

HLK-RM04 Serial to Ethernet

In this mode, LAN2 and WI-FI are disabled, only ETH1 is enabled and can be configured in either static IP in DHCP mode

Through the appropriate settings, the data between UART and ETH1 network can achieve mutual conversion.

 

 Serial to WI-FI Client

HLK-RM04 Serial To WIFI Client

In this mode the ETH1 and ETH2 are disabled, the WI-FI works like a normal client and can be configured in either DHCP or static IP.

Through the appropriate settings, the data between UART and WIFI network can achieve mutual conversion.

 

Serial to WI-FI AP

HLK-RM04 Serial To WIFI AP

In this mode the ETH1 and ETH2 are disabled, the WI-FI works but this time it works as an access point (AP mode).

Through the appropriate settings, the data between UART and WIFI network can achieve mutual conversion.

 


Defined the different mode for access to the network for the Wi-Fi Wi-Fi HLK-RM04 module, we can now specify how you can communicate with the module to ensure that the data arrives to the UART and vice versa; also for this part you have 4 modes that are :

TCP server

HLK-RM04 TCP Server

In this mode, the module Wi-Fi Wi-Fi HLK-RM04 starts listening on a specific port / IP address configured, waiting for client connections by turning all of the data that will come in of it to the UART and vice versa.

The max number of connections that the module is able to support is around 20.

 

TCP Client 

HLK-RM04 TCP Client

 

In this mode, the module Wi-Fi Wi-Fi HLK-RM04 make a connection to the server on port / IP address configured, turning all the data that will come in from the UART and vice versa.

If for some reason you were to drop the connection, if properly configured the module will attempt to redo the connection immediately.

 

UDP Server

HLK-RM04 UDP Server

In this mode, the module Wi-Fi Wi-Fi HLK-RM04 will listen on port / IP address configured; when  will arrive the first data, the server will store the IP and port of who sent the data so that it may resend to him any data from the UART.

Beware, The module will store the IP / port only for the last connection , this means that if more UDP client have communicated with the same module, the module will answer only to the last connection  who sent something.

UDP Client

HLK-RM04 UDP Client

In this mode, the module Wi-Fi Wi-Fi HLK-RM04 will send data directly from the UART to the port / IP configured and the data returned from the server will be turned directly to the UART.

 

Configuration Mode

The module Wi-Fi Wi-Fi HLK-RM04 can be configured via two modes that are:

To configure the module  you can use to the web page of the module, and once you enter the right credentials, you can make all the necessary configurations, while to be able to use AT commands, you must first perform a procedure to exit Transparent mode and enable the module to acknowledge and accept AT commands.. 

WEB Page mode

HLK-RM04 WEB Configuation SerialHLK-RM04 WEB Configuation

To access to the web configuration of the  Wi-Fi Wi-Fi HLK-RM04 module, type in  the following address from the browser: http://192.168.16.254/Serial2Net.asp

The address 192.168.16.254 is the IP address that the module has by default, remember so, if you were to change the IP address configured, it  will become the new address.

To access will request a user name and a password, which by default are:admin\admin.

so, will be displayed the first screen as showed on the left where you can make all the configurations on the UART mode, on  WIFI access, update firmware etc etc, clicking on the logo "Hi-Link" in the upper left you can instead go to the page displayed on the right, where you can do the same settings, more  most other advanced configurations such as the firewall etc etc.

So using these two web pages you can make all the possible configurations that the module offers, including the firmware update.

 

AT Command mode

The AT mode is the mode that allows you to make all the changes via AT commands via the UART port, to ensure that the module accepts commands, the same must enter AT command mode (otherwise the module is in transparent mode).

To send the module in AT command mode there are two ways:

  • For the first way: lower the voltage on PIN ES / RTD  more longer of  Tes time but for less time Trst; where default: Tes = 100 micro seconds and Trst = 6 seconds, so hold down the PIN between 100 ms and 6 s., the module will come in  AT command mode and it will can receive the various AT commands.
  • For the second way: that is only  if the pass-through option is enabled you can  send a series of three characters '+' spaced by a time Tpt (Serial framing time) from one another, wait about 500 ms or better between 400 ms and 600 ms and then send a series of 3 characters 0x1B interspersed by a time Tpt (Serial framing time), at this point the module will enter into aT mode and accept commands.

Finally there is a third mode in which the module can be in AT mode but without that it has been explicitly requested by the user, ie when the module goes into error.

 

 AT Command

The AT commands are formed as follows:

  • At+[command]=[value]\r : for configuration.
  • At+[command]=?\r   : to query the current configuration.

So wanting to change the remote address you can send the command at+remoteip=192.168.11.133\n with which you set the remote address 192.168.11.133, while, wanting to get the remote  address  you can  send the at command at+remoteip=?\n which will return 192.168.11.133(in case we had sent before the previous command) .

 

to follow, some of AT commands, please refer to the datasheet that can be downloaded from  Datasheet Area Download for a full and detailed list of the commands:

At+netmode=?\r : used to obtain the operating mode of the module which can be:

 

  • 0 Default setup
  • 1 Ethernet
  • 2 Wifi client
  • 3 Wifi ap

It's possible instead to set up the operation mode of the module using the command:

At+netmode=mode \r where  mode can be one of four numbers listed above (0,1,2,3).

 

At+dhcpc=?\r : used to obtain DHCP configuration that can take the following valori:

 

  • 0 Static ip address
  • 1 Dynamic ip address

It's possible instead to set up the mode using the command:

At+dhcpc=value\r  where  value  can be one of two numbers listed above(0,1).

 

There's also  a tool for use with a PC that lets you send AT commands, but this assumes that the module is connected to the PC via serial which assumes you are using the expansion card  described above  or that you are at least used an adapter eg max232 chip connected from one side to the UART module and to the other side to the serial port of the PC.

 

First start-up

When you switch on for the first time the module Wi-Fi Wi-Fi HLK-RM04, the same is in default mode which as we said is in AP mode with all RJ-45 ports enabled more the WI-FI.

If you want to connect to the module via Wi-Fi then you can access to the Wi-Fi network that the module has with the default  name HI-LINK_XXXX, password 12345678 or you can connect the ethernet cable if you have an expansion card or however a connector connected to the pins of the module and configure your  IP address to 192.168.16.100/255.255.255.0(classe C).

At this point, you can connect to http://192.168.16.254/Serial2Net.asp and type in as a user and password : admin\ admin.

Are you ready to make any configuration.

If you are not sure that the module is in default mode, you can perform a factory reset by which you can restore all the default settings of the module.

Factory Reset

To perform the factory reset of the module Wi-Fi Wi-Fi HLK-RM04 switch it on and wait about 30 seconds, after 30 seconds, lower the voltage on Pin ES / RST for more than 6 seconds, which would be the time that the Trst is configured of default, at this point the module will reboot and will be returned to the factory configuration.

 

Information Manufacturer and Sales

 

The production company of the module is a Chinese company whose official website is  www.hlktech.com.

Fortunately, the site allows also the selection of the English language to which the link that we have included is linked.


The module is really cheap and you can find at price of around 15 euros on ebay but attention to the antenna!

 

 

You have no rights to post comments