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");
}
}
