OpenWrt Forum Archive

Topic: Hi-Link wireless module HLK-RM04

The content of this topic has been archived between 31 Dec 2017 and 26 Apr 2018. Unfortunately there are posts – most likely complete pages – missing.

Hello Everyone,

I also bought a HLK RM-04 an would like openwrt to run on it.
I managed to get openwrt to run on it but the standard sdram is not enough for my needs.

now i'm looking for the right IC and found a couple.
I would like some confirmations if these are good and what the differences are since some are twice the price of others.

A43L4616AV-7F
H57V2562GTR-75C
IS42S16160G-7BLI
IS42S16160G-7TLI
MT48LC16M16A2P-6A
MT48LC16M16A2P-6A IT
MT48LC16M16A2P-7E

As of my research i think i can just replace them and use the right uboot and it should work right out of the box, please correct me if i'm wrong.

For the Flash ram i can imagine there are extra steps involved if i want to upgrade it, does anyone know a good guide on how todo this?

Thanks in advance for any reply or answer smile

And everyone have a nice weekend.

Hey guys,

Thank you all so much for the recon and effort you share with everyone here.

I posted a tech writeup on my blog with a custom-released official firmware that enables GPIO-1 (pin #9) through the HTTP server as well as the serial interface. One of the engineers from HiLink-Tech created it when I asked them about it, amazingly good service!

You can find it, including all firmware files (default V1.78 and GPIO-enabled, unreleased V1.83) and the user manual, here:http://www.unmanageable.nl/2014/03/mess … link-rm04/.

I also made the source code for a simple home automation server that uses this GPIO functionality publicly available on github: https://github.com/tjclement/jarvis-home-automation

Enjoy!

Could someone post the details on how to pull up a serial console on this board? I've tried everything I can think of, but I can't seem to get anything. I don't have the dev board, just the module itself. I have a usb->TTL serial interface that supports both 5V and 3.3V, and I have tried connecting it to both serial ports and used a variety of baud rates. If someone can post the configuration that they have confirmed works I'd really appreciate it, so I can rule out whether it is an issue with my setup or possibly a bad flash of uboot.

I flashed the uboot128.img from https://github.com/JiapengLi/OpenWrt-HiLink-HLK-RM04 using the factory web interface, and I compiled and flashed the openwrt image from source, in case that makes any difference for the configuration.

@Maciel310

This configuration works for me:

hlk-Rm04 pin 20 (RX) to TX of FTDI
pin 21 (TX) to RX of FTDI
Pin 2 (GND)  to FTDI GND

baud rate is define in dts file

chosen {
        bootargs = "console=ttyS0,57600";
};

uboot128.img works!

Thanks @WrtQuarter! That worked. That must have been the only configuration I didn't try.

Hi! I just have got this device coming from China. I read through the messages but I still have some questions. Could you help me?

1. My one has a 1.78 firmware. I can start a telnetd using the html post in the previous messages. Should I upload a new boot image (uboot128.img) to replace the factory boot? Does it help to recover any unwanted moves or this is not necessary?

2. I only found this image: "hlk-rm04-16m-luci-ser2net-usb2serial-r38025.bin". Looks like a bit old. Are there any newer images to upload, or should I compile one for myself? As I read it, I don't need luci at all. I'm not sure in usb, as my test board has no usb connector.

3. My real purpose is to connect this device to an arduino mc. I planned to use i2c and some self developed transport protocol. I can see that it should support i2c. Do you know anything how to access that. Or should I look up available gpio and use some linux drivers?

4. What is the performance of the serial ip connection. I might use this one if I2C would be too complicated.

Thanks for any help!

I'm trying to load an OpenWRT firmware image on the device, but so far I'm not having any luck. For some reason whenever I try uploading an image from the web interface the page freezes after I click upload, but nothing ever happens. The only way it responds again is if I reset the device's power. I did upgrade uboot before trying to load the new firmware on it, so maybe that is interfering with something? I would try restoring the factory uboot but I can't seem to find an image of it anywhere. This is happening with any image I've tried including downloaded, custom compiled, and the semi-official version that TJC posted about.

I don't have the development board for the device, so I'm limited to using WiFi and Serial to perform the upload which rules out the suggested tftp upload option.

I tried following the generic serial flashing instructions in the OpenWRT wiki using Kermit, but it looks like the commands in the wiki don't match what is expected in this version of uboot. For instance, erase expects a "partition" name, rather than an offset range. This wouldn't be an issue except that for some reason I am unable to pass in a length to the `cp` command, resulting in it copying 0 bytes and doing nothing.

I'm willing to try any suggestions, and I'm comfortable using telnetd to manually flash (mtd_write?) or compiling a custom uboot to take care of this if necessary. I'd just need some pointers for the commands, since I'm not too deeply familiar with the inner workings of OpenWRT.

maciel310 wrote:

I'm trying to load an OpenWRT firmware image on the device, but so far I'm not having any luck. For some reason whenever I try uploading an image from the web interface the page freezes after I click upload, but nothing ever happens. The only way it responds again is if I reset the device's power.

So you are flashing over wifi, right? I also tried but failed with the same problem. Using the ethernet connection I've flashed without problems.
You can flash also from the bootloader (pressing "2" via serial console during boot), but still you need ethernet for copying the firmare.

Dear gaplee,
Could you please change the installation instructions on your github repository?
Those instructions are BROKEN. Please fix them..

You say:

Jeff Kent made the firmware upload much easier. We can upload the OpenWRT firmware to the HLK-RM04 directly through the upload firmware WEBUI interface.

That file is not working. A lot of peole in previous messages bricked the device due to these wrong instructions you wrote.
Also you don't say to change uboot on the new firmware upload method, so the people with bricked device can't flash it easily!
Maybe it is working for 32MB ram version, but surely not for the 16MB one.

I found out how to unbrick the device and flash the new firmware without the new version of uboot you provided.
I've setted a static IP address on my computer: 10.10.10.3 with netmask 255.255.255.0, then I've setupped a tftp server and I've placed the new firmware to upload into the tftp server folder, calling it "tim_uImage".
Then I've connected the device to my computer using the LAN ethernet port.
While keeping pressed the WPS/Default button, I gave power to the board and keep pressed the button for ~5 seconds. After releasing the button, the board starts the firmware download and then boot.

otaku22 wrote:
maciel310 wrote:

I'm trying to load an OpenWRT firmware image on the device, but so far I'm not having any luck. For some reason whenever I try uploading an image from the web interface the page freezes after I click upload, but nothing ever happens. The only way it responds again is if I reset the device's power.

So you are flashing over wifi, right? I also tried but failed with the same problem. Using the ethernet connection I've flashed without problems.
You can flash also from the bootloader (pressing "2" via serial console during boot), but still you need ethernet for copying the firmare.

Yes, I'm trying to use WiFi. I don't have the breakout board with the network jack so unfortunately ethernet isn't an option. If you had the same issue I guess the stock firmware has a bug where it won't work... That's unfortunate.

The bootloader does have an option to load the firmware over the serial connection directly, but I can't get the commands figured out since they don't match the instructions in the generic flashing wiki article. If anyone has experience with the Kermit protocol in uboot I'd really appreciate it if you could provide some assistance. Thanks!

Hi Everyone

I've followed the instructions in this post:

https://github.com/JiapengLi/OpenWrt-HiLink-HLK-RM04

I have made the uboot upgrade (without any issues) and now I want to install the OpenWRT. The image that I have generated is this one:

openwrt-ramips-rt305x-hlk-rm04-initramfs-factory.bin

In the mentioned instructions the upgrade can be done with the image that I have generated, using the WEBUI, but otaku22 says that this bricks the module, so what is your suggestion to install the openWRT image? Should I install it according with the wiki instructions, using a serial port and a tftp server? In the wiki the image name is not the same, it is openwrt-ramips-rt305x-hlk-rm04-squashfs-sysupgrade.bin, can you clarify what is the correct image?

Thanks in advance

Fernando

After updating the OpenWRT with an image built using https://github.com/JiapengLi/OpenWrt-HiLink-HLK-RM04, it hangs during boot, any tip of what could be the cause?


U-Boot 1.1.3 (Jan  9 2014 - 18:11:05)

Board: Ralink APSoC DRAM:  16 MB
relocate_code Pointer at: 80fb4000
spi_wait_nsec: 42
spi device id: ef 40 16 0 0 (40160000)
find flash: W25Q32BV
raspi_read: from:30000 len:1000
.raspi_read: from:30000 len:1000
.============================================
Ralink UBoot Version: 3.6.0.0
--------------------------------------------
ASIC 5350_MP (Port5<->None)
DRAM_CONF_FROM: EEPROM
DRAM_SIZE: 128 Mbits SDR
DRAM_TOTAL_WIDTH: 16 bits
TOTAL_MEMORY_SIZE: 16 MBytes
Flash component: SPI Flash
Date:Jan  9 2014  Time:18:11:05
============================================
icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:128, ways:4, linesz:32 ,total:16384

##### The CPU freq = 360 MHZ ####
estimate memory size =16 Mbytes

Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.                     0

3: System Boot system code via Flash.
## Booting image at bc050000 ...
raspi_read: from:50000 len:40
.   Image Name:   HLK-RM02
   Created:      2014-05-08  17:46:28 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    3765646 Bytes =  3.6 MB
   Load Address: 80000000
   Entry Point:  80000000
raspi_read: from:50040 len:39758e
..........................................................   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 16

Starting kernel ...

[    0.000000] Linux version 3.10.13 (administrator@elementaryOS) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2013.05 r38333) ) #6 Thu May 8 18:45:19 WEST 2014
[    0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0001964c (MIPS 24KEc)
[    0.000000] MIPS: machine is HILINK HLK-RM04
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 01000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x00ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x00ffffff]
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 4064
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2 mem=16M
[    0.000000] PID hash table entries: 64 (order: -4, 256 bytes)
[    0.000000] Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Writing ErrCtl register=0000f0ff
[    0.000000] Readback ErrCtl register=0000f0ff
[    0.000000] Memory: 10420k/16384k available (2118k kernel code, 5964k reserved, 536k data, 2912k init, 0k highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:128
[    0.000000] CPU Clock: 360MHz
[    0.000000] Calibrating delay loop... 239.61 BogoMIPS (lpj=1198080)
[    0.070000] pid_max: default: 32768 minimum: 301
[    0.070000] Mount-cache hash table entries: 512
[    0.080000] pinctrl core: initialized pinctrl subsystem
[    0.090000] NET: Registered protocol family 16
[    0.110000] rt2880-pinmux pinctrl.1: invalid group "rgmii" for function "gpio"
[    0.120000] rt2880-pinmux pinctrl.1: invalid group "mdio" for function "gpio"
[    0.150000] bio: create slab <bio-0> at 0
[    0.160000] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.170000] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.180000] Switching to clocksource MIPS
[    0.190000] NET: Registered protocol family 2
[    0.200000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[    0.220000] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[    0.230000] TCP: Hash tables configured (established 512 bind 512)
[    0.240000] TCP: reno registered
[    0.250000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.260000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.270000] NET: Registered protocol family 1

It hangs here :-(

The module works well (at least the module boots and I can interact with it through the serial console) with the image rt305x-hlk-rm04-generic-sysupgrade.bin obtained here: https://github.com/bogdanr/HLK-RM04. I've made the upgrade through TFTP.

Thanks in advance

Fernando

(Last edited by fgomes on 9 May 2014, 11:51)

Well we are all getting stuff now! I managed to load the new uboot via the web interface but now my system hangs at "starting kernel..."

Do I need to do the resistor mod after the flash? I tried flashing via TFTP after changing the resistors and it hangs mid flash, so i changed the resistors back to stock and it seems to work and restarts and then hangs at ".Bad Magic Number,39689D76".

Any ideas?

Hi forsakenrider

Some thoughts: For the "Bad Magic Number" I think you are uploading by TFTP an image that is not for TFTP upload - if you try to upload by TFTP the image that is for the first update you get this error, you should use a sysupgrade image to update by TFTP
For the resistors, if you use the sugested kernel hack (kernel command line forcing 16M), it works even without changing the resistors. It is easy to find out if yu forgot the kernel hack and have the wrong resistors setup, the kernel boot stops like this:

Starting kernel ...

[    0.000000] Linux version 3.10.13 (jonas@mint) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2013.05 r38333) ) #1 Thu Oct 24 13:49:23 CEST 2013
[    0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0001964c (MIPS 24KEc)
[    0.000000] MIPS: machine is HILINK HLK-RM04
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x01ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x01ffffff]

Fernando

Well I've upgraded my RAM and Uboot but openwrt still seems to only see 16mb on ram. Any idea on why? Do I have to do some kernel hacking to make it see it?

@forsakenrider

I believe you have to modify the dts file and recompile.

hlkrm04.dts is located in trunk/target/linux/ramips/dts/

    memory@0 {
        device_type = "memory";
        //reg = <0x0 0x1000000>; /* 16 MB*/
        reg = <0x0 0x2000000>; /* 32 MB*/
    };

Hey WrtQuater,

I did, make kernel_menuconfig and changed the line in kernal hacking to "rootfstype=squashfs,jffs2 mem=32M" and its working great!

Can anyone advice, how can I build a custom system for this device?
I'd like to have mjpg-streamer, kmod-video-uvc, kmod-video-core, kmod-video-videobuf2, kmod-usb2, some i2c driver for the i2c interface and i2c-tools.
Of course, I'd like to remove as much "crap" from the kernel and the core system as possible - e.g. I do not need IPv6, no firewall, ...
Whenever I try to compile the trunk version, I end up with error on Curl sad
I tried to use the trunk build, but even opkg list kill the device - I run out of memory sad

(Last edited by sancho on 1 Jun 2014, 22:31)

Wow. never mind.
I disabled the dnsmasq (not needed), edited the list in  /etc/modules.d - removed ipv6 modules (20-ipv6 and 42-ip6tables), led trigger module for USB and both ppp files and now I have almost 3MB free after boot smile
Now I am able to list opkg packages and gre the result with no out-of-memory problem smile

Hi

I just got the nake HLK-RM04 module from BangGood: http://www.banggood.com/Uart-Serial-Por … 30217.html

Still default firmware.

Playing with the WEB interface I set "Serial to Wifi AP"

Now the WEB GUI is not working anymore. Nor I'm able to see or make any command on the serial interface.

Factory reset is via RS/EST pin .. but none of the 28 pin is named in this way ...  any idea ?

I would like to have the most simple way to use the serial port (as server) and have a client over Wifi, possibly using telnet that send 1:1 what is over telnet to the serial server ...

How can I do it .. and how I can reset my board to default mode ?

Thanks

e_lm_70

Looking at the picture on post #17 .... it is looking that one of the two switch is connected to pin 19 ... still if I put pin 19 to gnd, I can't make any factory reset ... pin 19 per specs is RTS_N ... that is more the Ready To Send serial input signal ...

Still messing around with this module. I did notice that the change in the GUI did change the IP address used for the GUI itself , from 192.168.16.254 to 192.168.11.254

Anyhow, apparently my TCP test client can open the 192.168.11.245 or 192.168.16.254 port 8080 ... but still I can't see anything over my USB-Serial adapter .. connected to the primary TX pins ...

I'm using directly the naked board, without the "adapter" ... not sure what I'm doing wrong ... at least it is still alive my module

Problem fixed ... at least ... I get the basic to work .. still I don't know how to get the AT "console"

The documentation was quite poor.

The main serial interface is the one on pin 20 and 21 ... not the one on pin 22 and 26

Using the the default setting, the TCP client work on port 192.168.16.254 ... and I can communicate over serial ... nice smile

The pin documentation here is more clean:
http://www.hlktech.net/product_detail.php?ProId=39

The one from the PDF manual is quite confusing

The reset button is looking is pin 25 from this page ...  what was documented as RIN in the PDF

Ups not .. pin 10 is ES/RST smile

(Last edited by e_lm_70 on 16 Jun 2014, 16:27)

Hello!
How correspondens the GPIO numbers and module pin?
For example, I do (patched dts):
echo 11 >  /sys/class/gpio/export
ls -l
root@OpenWrt:/# ls -l /sys/class/gpio/
--w-------    1 root     root          4096 Jun 19 08:30 export
lrwxrwxrwx    1 root     root             0 Jun 19 08:26 gpio11 -> ../../devices/10000000.palmbus/10000600.gpio/gpio/gpio11
lrwxrwxrwx    1 root     root             0 Jan  1  1970 gpiochip0 -> ../../devices/10000000.palmbus/10000600.gpio/gpio/gpiochi0
--w-------    1 root     root          4096 Jan  1  1970 unexport

What pin corresponds to GPIO 11?

ABATAPA wrote:

What pin corresponds to GPIO 11?

GPIO11 isn't available on the HLK-RM04 module pins. Look at the link provided by e_lm_70 above to see which GPIOs are available.