How to connect HLK-RM04 to arduino uno?

Hi, I got this wifi module HLK-RM04 and wonder is it a way to use it with arduino Uno without any additional shields/boards?

I found library GitHub - chunlinhan/WiFiRM04: Arduino WiFi library for Hi-Link HLK-RM04 module

Connected the module using 4 pins

HLK-rm04----Arduino
1 5v -----------5V
2 GND---------GND
20 RX----------1 TX
21 TX-----------2 RX

Modified library

By default, this library will use two UARTs to communicate with HLK-RM04 module. (firmware V1.78 can support two UARTs) If you don't want to use second UART of HLK-RM04, just modify utility/wl_definitions.h and change the definition of MAX_SOCK_NUM to 1. (but the second serial port will still be initialized in utilit/at_drv.cpp)

The serial ports I used are Serial1 and Serial2, you could change them by modifying utilit/at_drv.cpp and change the definition of AT_DRV_SERIAL and AT_DRV_SERIAL1.

So i have

MAX_SOCK_NUM 1

AT_DRV_SERIAL SERIAL
AT_DRV_SERIAL1 SERIAL

I try to use examples but it doesn't work. I think this is because SERIAL commands in examples(examples adopted for ARD MEGA with several serias?)
Ok, then i removed all serial commands from 'client' example. And trying to connect to router. Unsucceccfully because there is no any new clients in client-list of router.

So, is it a way to connect this module to arduino uno?? Or it works only with mega?

Black_Parrot:
Hi, I got this wifi module HLK-RM04 and wonder is it a way to use it with arduino Uno without any additional shields/boards?

I found library GitHub - chunlinhan/WiFiRM04: Arduino WiFi library for Hi-Link HLK-RM04 module

Connected the module using 4 pins

HLK-rm04----Arduino
1 5v -----------5V
2 GND---------GND
20 RX----------1 TX
21 TX-----------2 RX

Modified library

By default, this library will use two UARTs to communicate with HLK-RM04 module. (firmware V1.78 can support two UARTs) If you don't want to use second UART of HLK-RM04, just modify utility/wl_definitions.h and change the definition of MAX_SOCK_NUM to 1. (but the second serial port will still be initialized in utilit/at_drv.cpp)

The serial ports I used are Serial1 and Serial2, you could change them by modifying utilit/at_drv.cpp and change the definition of AT_DRV_SERIAL and AT_DRV_SERIAL1.

So i have

MAX_SOCK_NUM 1

AT_DRV_SERIAL SERIAL
AT_DRV_SERIAL1 SERIAL

I try to use examples but it doesn't work. I think this is because SERIAL commands in examples(examples adopted for ARD MEGA with several serias?)
Ok, then i removed all serial commands from 'client' example. And trying to connect to router. Unsucceccfully because there is no any new clients in client-list of router.

So, is it a way to connect this module to arduino uno?? Or it works only with mega?

You have any luck with this? I also failed to get this library to work. Am going to work directly with the AT+ commands...

I have a shield as atatched.

HLK-RM04.jpg

Hi,

I am trying to use HLK-RM04 with ARDUINO UNO too.

I am using this shield for ARDUINO UNO: http://www.hlktech.com/en/productshow.asp?id=147

http://www.aliexpress.com/snapshot/6067679366.html

Unfortunately I can not run chunlinhan library properly (GitHub - chunlinhan/WiFiRM04: Arduino WiFi library for Hi-Link HLK-RM04 module) in UNO. It is designed for be used with MEGA (2 serial ports).

In order to use it with UNO, I tried to disable Serial1 and Serial2 instances.

I changed Serial1 and Serial2 by Serial in at_drv.cpp

// use Serial1 as default serial port to communicate with WiFi module
//#define AT_DRV_SERIAL Serial1
#define AT_DRV_SERIAL Serial
// use Serial2 to communicate the uart2 of our WiFi module
//#define AT_DRV_SERIAL1 Serial2
#define AT_DRV_SERIAL1 Serial

Scape pin to 8 (in this shield).

#define ESCAPE_PIN				8

And in "wl_definitions.h" MAX_SOCK_NUM to 1

// Maxmium number of socket
#define	MAX_SOCK_NUM		1

This shield allows direct connection by LAN, and configure module by WEB UI instead of AT commands.

Did anyone work with this module without Chunlinhan library and WEBUI config?

I tried this simple sketch to do this, but it does not work, watching in serial terminal, module does not response. Any suggestion?

/*
  Web client for HLK-RM04 in SERIAL-ETH Client mode.
 
 This sketch connects to a website (http://www.google.com)
 using a HLK-RM04 SERIAL-ETH-WiFi shield in client mode.
 
 Configuration:
 
   You must to access via LAN or WIFI to WEBUI to configure module instead of use AT commands.
 
   Using LAN: use HLK-RM04 Discover Win software to discover DHCP assigned IP.
   Using WIFI: Connect to default SSID called "HI-LINK_xxxx" with password: "1234568". Navigate with web browser to "192.168.16.254".
   
   When you prompted for login, use: User: admin, Pass: admin.

   In HLK-RM04 menu, "Serial2Net Settings" (http://192.168.202.62/Serial2Net.asp) set: 
   
      NetMode:                    ETH-SERIAL
      IP type:                    DHCP 
      Serial configure:           115200,8,n,1
      Serial framing len:         64
      Serial framing timeout:     10ms
      Network Mode:               Client   <- "Server as default, change it to Client"
      Remote Server Domain/IP:    www.google.com   
      Locale/Remote Port number:  80
      Network Protcol:            TCP
      Network timeout:            0        <- seconds. 0 for no timeout.
      
 Circuit:
 
   HLK-RM04 module mounted on Arduino uno shield. http://www.hlktech.com/en/productshow.asp?id=147   
   
 
 by J.A.Peral
 
 */

// if you don't want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
//IPAddress server(74,125,232,128);  // numeric IP for Google (no DNS)
//char server[] = "www.google.com";    // name address for Google (using DNS)

char buffer[64];
long timer=0;

void setup() {
  
  //Initialize serial and wait for port to open:
  Serial.begin(115200); 
  Serial.timeout(10);
  
}



void loop() {
  
  if(millis()-timer>10000){
    timer=0;       
    
    Serial.println("GET /search?q=arduino HTTP/1.1");
    Serial.println("Host: www.google.com");
    Serial.println("Connection: close");
    
  }

}

1066052788_104.jpg