Hi~ guys, i have been playing around this HLK-RM04 modules for weeks, this is the official product page: http://www.hlktech.net/product_detail.php?ProId=39
It seems to be a very handy device to do projects about internet of things, The price is very cheap($15), and it can run openwrt, i have built them successfully following the github's information here: GitHub - JiapengLi/OpenWrt-HiLink-HLK-RM04: OpenWrt patch and installation guide for HiLink HLK-RM04
At first the instructions is incorrect about the trunk version, so you have to modify a patch, i have pull an issue and the author correct the instructions now, just follow the instructions, you'll be fine, the building take about a half hour, during building keep internet access, a lots of package have to be downloaded. Tell me if you have any questions.
Back to arduino side, the original firmware with two uarts support is really handy, you can use one uart to listen to local network as a server, while use the other as a client to send requests to internet website at the same time.
i'm thinking about creating an arduino library for this module, two plans are listed: 1.Try to follow Arduino Yun's design, and migrate the Linino(the linux running on Yun's Atheros SoC) to HLK-RM04 module.
Pros:
It will be nice to use Bridge library to communicate with the HLK-RM04 module just like the Yun's board, the arduino code can be directly used without any modify.
Cons:
Linino project seems not mature, i can not even find the source code(if you know it, tell me please! looking for building them on HLK-RM04) .
2.Create a library based on the HiLink-HLK-RM04 original firmware, That is about creating a middle layer to simplify the AT commends and the http requests and so on.
Pros:
It seems easier to just make a api layer to translate some code to uart, and the original firmware prove to be extremely stable.(especially the auto reconnect after disconnect function in TCP layer).
Cons:
You have to use a new library and it will be greatly different from the Bridge library. And due to the closed source firmware, you cant build a module youself(in fact i dont think the module can be build by individuals even with the source, the PCB are just too complicated).
So what's you guys opinion about what the library should be?
I'm actually trying to use this little module, I think that having all the Bridge functionalities would be good, but as you say, Linino is far from being mature and the stock firmware seems to work quite well...
Although I cannot actually communicate with it in nice way... I always get mixed up characters in the echo when I send an at command, like:
at+ver=?
×%W?®Oþ
V1.59(Apr 1 2013)
also, I am not able to perform requests, but that will come later XD
junk out is usually due to the difference of baud rate setting, suggest to check it again.
BTW, I found if your Arduino board is using USB cable as the power source and your USB cable is not
good enough, RM04 will keep rebooting and can't work normally.
junk out is usually due to the difference of baud rate setting, suggest to check it again.
BTW, I found if your Arduino board is using USB cable as the power source and your USB cable is not
good enough, RM04 will keep rebooting and can't work normally.
Thanks, I bought the TestBoard that comes with the HLK-RM04 module. It has its own power supply so I can rule that out.
I also agree that the Junk being received looks like the wrong baud rate. unfortunately I have check it multiple times and I have also checked it on a third device with no improvement.
Only think that I can see that might cause it is an extra Serial to RS232 converter that the test board has. (3.3v -> 5V serail converter)
Or... I might have a non working unit... have order a second one just to make sure.
Protoneer:
Thanks, I bought the TestBoard that comes with the HLK-RM04 module. It has its own power supply so I can rule that out.
......
Only think that I can see that might cause it is an extra Serial to RS232 converter that the test board has. (3.3v -> 5V serail converter)
.......
Hi,
The TestBoard you mentioned is something like this?
As I know, there is no 3.3V -> 5V converter on this board.
The only converter on this board is a MAX232ACPE, which will convert +- 3.3v to +- 12V.
You can't connect Arduino's UART with the UART of DB9 connector (or the UART testing points) on the board, because
the voltage level of those pins have been converted to +-12V by MAX232ACPE.
As I know, there is no 3.3V -> 5V converter on this board.
The only converter on this board is a MAX232ACPE, which will convert +- 3.3v to +- 12V.
You can't connect Arduino's UART with the UART of DB9 connector (or the UART testing points) on the board, because
the voltage level of those pins have been converted to +-12V by MAX232ACPE.
Thanks for the info. I will try and connect it directly to the HLK-RM04 unit next...
I've just bought this module and realised I can't plug it tu arduino, as shield.
Is it any way to connect it to arduino? I need to send notifications using this module and AVVISO. only one command like:
if digitalread = 1
send notification blah-blah...
C:\Users\Philipp\Documents\Arduino\libraries\WiFiRM04\utility\at_drv.cpp:2207: error: 'Serial1' was not declared in this scope
C:\Users\Philipp\Documents\Arduino\libraries\WiFiRM04\utility\at_drv.cpp:2207: error: 'AT_DRV_SERIAL1' was not declared in this scope
Black_Parrot:
hmmm now i even can't upload the sketch
C:\Users\Philipp\Documents\Arduino\libraries\WiFiRM04\utility\at_drv.cpp:2207: error: 'Serial1' was not declared in this scope
C:\Users\Philipp\Documents\Arduino\libraries\WiFiRM04\utility\at_drv.cpp:2207: error: 'AT_DRV_SERIAL1' was not declared in this scope
The Library is build to work with 2 physical serial ports, like on a Mega, you have to modify it to make it work with another board, when I tried, I failed XD, but I didn't give it a lot of effort... if you succeed please upload
Black_Parrot:
hmmm now i even can't upload the sketch
C:\Users\Philipp\Documents\Arduino\libraries\WiFiRM04\utility\at_drv.cpp:2207: error: 'Serial1' was not declared in this scope
C:\Users\Philipp\Documents\Arduino\libraries\WiFiRM04\utility\at_drv.cpp:2207: error: 'AT_DRV_SERIAL1' was not declared in this scope
The Library is build to work with 2 physical serial ports, like on a Mega, you have to modify it to make it work with another board, when I tried, I failed XD, but I didn't give it a lot of effort... if you succeed please upload
I am also facing the same problem using this shield. I looked at the at_drv.cpp but am not sure where to make changes... Anyone can help?
I looked at the library and tried to find where the second serial is used... is it required and where in the code is it used, I only see it initialized.
I would like to make it work with the Arduino Shield that is everywhere on the net. (UNO Sized)
I made the changes noted in the readme and can get a sketch to compile and load but everything stops when the first call to the library is made:
if (WiFi.status() == WL_NO_SHIELD) {
I attached a I2C LCD as the serial is used by the WiFi Module and serial debugging is not available.
Another 'problem' with this shield is it does not have the ES/RST connected to anything but a switch. I added a jumper and connected it to an I/O Pin and added that pin in the proper place in the library files.
Has anyone gotten the serial-to-WiFi to work with Ardiono, or any other device? I'm using v1.59 firmware on RM04.
Here's what I've discovered - hopefully it helps:
I'm able to get my HLK-RM04 out of transparent mode and send it at commands, I can also connect to by WiFi when it's in its default mode as a router, but what I really need is to get it set up as a client, so it can pas HTTP GET commands to a web site. I am also able to do basic commands using the configuration software from the manufacturer. (http://www.hlktech.net/inc/lib/download/download.php?DId=23), but every time it hangs on the at+net_commit=1 command, so the at+net_reconn=1 never gets executed.
I tried chunlinhan's library with his suggested changes, but he's using firmware 1.78 and I have 1.59. With this library I get "Shield not found errors".
When the RM04 is in default mode and I connect to it by WiFi, I can use its own menus to select Serial-to-WiFi, but it hangs when save and it's inaccessible through serial or WiFi until power cycle.
**NOTE Different firmware versions have different pin-outs. I ran into this problem when first bought it and the vendor's documentation was for an older firmware than what was sold to me, and the RX/TX pins were not in the same place. When I got the correct documentation from the manufacturer, I was able to at least connect to it and issue at commands and get correct responses.
I have a problem and sorry if my English is not good. I want to receive an array as a digital input of the micro (PIC or AVR) by laptop WiFi then turn it to analog signal by micro as a Mass Flow Controller (MFC) input. I am wondering if any assembled board is available for it ???
I tried using GitHub - chunlinhan/WiFiRM04: Arduino WiFi library for Hi-Link HLK-RM04 module code but could not get it to work. I did manage to connect to Arduino and get the device to send data when queried over the internet. At least it works with Chrome and Safari, but there are problems on IE. The device i have came mounted on an Arduino shield with a switch to disconnect the Rx line so that you can upload a program. One problem not solved is that the web page never stops loading. Here is the code:
Hi, I faced a problem of booting and go into the built in configuration when using this Wifi shield. The shield does not give any response to me although i connecting it serialize to my computer. Is there any steps of booting or solutions that can help me to solve this problem as fast as possible?
Did anyone find out the solution of HLK-RM04 library? I have the same problem with the serial ports and the creator of this library suggest to change the Serial ports originally called as Serial 1 and Serial 2 to other, but I don´t know how to name them using arduino uno to run an example of this library.