Re: Hi-Link wireless module HLK-RM04

>there is logread.

After booting, what is the output of logread?

Re: Hi-Link wireless module HLK-RM04

lizby wrote:

After booting, what is the output of logread?

jkent@quark:~$ telnet 192.168.16.254
Trying 192.168.16.254...
Connected to 192.168.16.254.
Escape character is '^]'.
ralink login: admin
Password: 


BusyBox v1.12.1 (2013-03-07 10:08:05 HKT) built-in shell (ash)
Enter 'help' for a list of built-in commands.

# cat /proc/version 
Linux version 2.6.21 (tim@debian6) (gcc version 3.4.2) #87 Fri Mar 29 16:20:02 HKT 2013
# logread
Jan  1 00:00:20 ralink user.info kernel: NET: Registered protocol family 24
Jan  1 00:00:20 ralink user.info kernel: PPPoL2TP kernel driver, V0.17
Jan  1 00:00:20 ralink user.info kernel: PPTP driver version 0.8.1
Jan  1 00:00:20 ralink user.info kernel: tun: Universal TUN/TAP device driver, 1.6
Jan  1 00:00:20 ralink user.info kernel: tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
Jan  1 00:00:20 ralink user.info kernel: block2mtd: version $Revision: 1.1.1.1 $
Jan  1 00:00:20 ralink user.warn kernel: GACT probability on
Jan  1 00:00:20 ralink user.warn kernel: Mirror/redirect action on
Jan  1 00:00:20 ralink user.warn kernel: Simple TC action Loaded
Jan  1 00:00:20 ralink user.warn kernel: u32 classifier
Jan  1 00:00:20 ralink user.warn kernel:     Performance counters on
Jan  1 00:00:20 ralink user.warn kernel:     input device check on 
Jan  1 00:00:20 ralink user.warn kernel:     Actions configured 
Jan  1 00:00:20 ralink user.warn kernel: nf_conntrack version 0.5.0 (128 buckets, 1024 max)
Jan  1 00:00:20 ralink user.warn kernel: ip_tables: (C) 2000-2006 Netfilter 
Jan  1 00:00:20 ralink user.info kernel: Core Team, Type=Linux
Jan  1 00:00:20 ralink user.warn kernel: ipt_time loading
Jan  1 00:00:20 ralink user.warn kernel: arp_tables: (C) 2002 David S. Miller
Jan  1 00:00:20 ralink user.info kernel: TCP cubic registered
Jan  1 00:00:20 ralink user.info kernel: NET: Registered protocol family 1
Jan  1 00:00:20 ralink user.info kernel: NET: Registered protocol family 17
Jan  1 00:00:20 ralink user.notice kernel: Ebtables v2.0 registered
Jan  1 00:00:20 ralink user.info kernel: 802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
Jan  1 00:00:20 ralink user.info kernel: All bugs added by David S. Miller <davem@redhat.com>
Jan  1 00:00:20 ralink user.warn kernel: VFS: Mounted root (squashfs filesystem) readonly.
Jan  1 00:00:20 ralink user.info kernel: Freeing unused kernel memory: 108k freed
Jan  1 00:00:20 ralink user.warn kernel: Warning: unable to open an initial console.
Jan  1 00:00:20 ralink user.warn kernel: Algorithmics/MIPS FPU Emulator v1.5
Jan  1 00:00:20 ralink user.err kernel: devpts: called with bogus options
Jan  1 00:00:20 ralink user.warn kernel: baud 9600^M
Jan  1 00:00:20 ralink user.warn kernel: xxxxx:-2144892024 9600 260 baud 57600^M
Jan  1 00:00:20 ralink user.warn kernel: xxxxx:-2144892024 57600 43 <4>rt2860v2_ap: module license 'unspecified' taints kernel.
Jan  1 00:00:20 ralink user.warn kernel: 
Jan  1 00:00:20 ralink user.warn kernel: 
Jan  1 00:00:20 ralink user.warn kernel: === pAd = c0083000, size = 805120 ===
Jan  1 00:00:20 ralink user.warn kernel: 
Jan  1 00:00:20 ralink user.warn kernel: <-- RTMPAllocAdapterBlock, Status=0
Jan  1 00:00:20 ralink user.warn kernel: RX DESC a0f6b000  size = 2048
Jan  1 00:00:20 ralink user.warn kernel: <-- RTMPAllocTxRxRingMemory, Status=0
Jan  1 00:00:20 ralink user.warn kernel: Key1Str is Invalid key length(0) or Type(0)
Jan  1 00:00:20 ralink user.warn kernel: Key2Str is Invalid key length(0) or Type(0)
Jan  1 00:00:20 ralink user.warn kernel: Key3Str is Invalid key length(0) or Type(0)
Jan  1 00:00:20 ralink user.warn kernel: Key4Str is Invalid key length(0) or Type(0)
Jan  1 00:00:20 ralink user.warn kernel: 1. Phy Mode = 9
Jan  1 00:00:20 ralink user.warn kernel: 2. Phy Mode = 9
Jan  1 00:00:20 ralink user.warn kernel: 3. Phy Mode = 9
Jan  1 00:00:20 ralink user.warn kernel: pAd->TxPowerCtrl.bInternalTxALC == FALSE !
Jan  1 00:00:20 ralink user.warn kernel: MCS Set = ff 00 00 00 01
Jan  1 00:00:20 ralink user.warn kernel: SYNC - BBP R4 to 20MHz.l
Jan  1 00:00:20 ralink user.warn kernel: SYNC - BBP R4 to 20MHz.l
Jan  1 00:00:20 ralink user.warn kernel: SYNC - BBP R4 to 20MHz.l
Jan  1 00:00:20 ralink user.warn kernel: SYNC - BBP R4 to 20MHz.l
Jan  1 00:00:20 ralink user.warn kernel: SYNC - BBP R4 to 20MHz.l
Jan  1 00:00:20 ralink user.warn kernel: SYNC - BBP R4 to 20MHz.l
Jan  1 00:00:20 ralink user.warn kernel: SYNC - BBP R4 to 20MHz.l
Jan  1 00:00:20 ralink user.warn kernel: SYNC - BBP R4 to 20MHz.l
Jan  1 00:00:20 ralink user.warn kernel: SYNC - BBP R4 to 20MHz.l
Jan  1 00:00:20 ralink user.warn kernel: Main bssid = 44:33:4c:b1:b1:6a
Jan  1 00:00:20 ralink user.warn kernel: <==== rt28xx_init, Status=0
Jan  1 00:00:20 ralink user.warn kernel: 0x1300 = 00064380
Jan  1 00:00:20 ralink user.warn kernel: 
Jan  1 00:00:20 ralink user.warn kernel: phy_tx_ring = 0x00409000, tx_ring = 0xa0409000
Jan  1 00:00:20 ralink user.warn kernel: 
Jan  1 00:00:20 ralink user.warn kernel: phy_rx_ring0 = 0x0040a000, rx_ring0 = 0xa040a000
Jan  1 00:00:20 ralink user.warn kernel: MAC_ADRH -- : 0x00004433
Jan  1 00:00:20 ralink user.warn kernel: MAC_ADRL -- : 0x4cb1b16a
Jan  1 00:00:20 ralink user.warn kernel: RT305x_ESW: Link Status Changed
Jan  1 00:00:20 ralink user.warn kernel: eth2.2: Setting MAC address to  44 33 4c b1 b1 6b.
Jan  1 00:00:20 ralink user.info kernel: device eth2 entered promiscuous mode
Jan  1 00:00:20 ralink user.warn kernel: VLAN (eth2.2):  Setting underlying device (eth2) to promiscious mode.
Jan  1 00:00:20 ralink user.debug kernel: eth2.1: add 01:00:5e:00:00:01 mcast address to master interface
Jan  1 00:00:20 ralink user.debug kernel: eth2.2: add 01:00:5e:00:00:01 mcast address to master interface
Jan  1 00:00:20 ralink user.info kernel: device ra0 entered promiscuous mode
Jan  1 00:00:20 ralink user.info kernel: eth2.1: dev_set_promiscuity(master, 1)
Jan  1 00:00:20 ralink user.info kernel: device eth2.1 entered promiscuous mode
Jan  1 00:00:20 ralink user.info kernel: br0: port 2(eth2.1) entering learning state
Jan  1 00:00:20 ralink user.info kernel: br0: port 1(ra0) entering learning state
Jan  1 00:00:20 ralink user.warn kernel: RT305x_ESW: Link Status Changed
Jan  1 00:00:20 ralink user.warn kernel: RT305x_ESW: Link Status Changed
Jan  1 00:00:20 ralink user.info kernel: br0: topology change detected, propagating
Jan  1 00:00:20 ralink user.info kernel: br0: port 2(eth2.1) entering forwarding state
Jan  1 00:00:20 ralink user.info kernel: br0: topology change detected, propagating
Jan  1 00:00:20 ralink user.info kernel: br0: port 1(ra0) entering forwarding state
Jan  1 00:00:20 ralink user.warn kernel: RT305x_ESW: Link Status Changed
Jan  1 00:00:20 ralink user.warn kernel: RT305x_ESW: Link Status Changed
Jan  1 00:00:20 ralink user.warn kernel: RT305x_ESW: Link Status Changed
Jan  1 00:00:21 ralink user.warn kernel: switch register base addr to system register 0xb0000000
Jan  1 00:00:21 ralink user.warn kernel: write offset 0x60, value 0x400095
Jan  1 00:00:21 ralink user.warn kernel: baud 9600^M
Jan  1 00:00:21 ralink user.warn kernel: c_cflag (00000cbd)(1)^M
Jan  1 00:00:21 ralink user.warn kernel: c_cflag (000000ba)(0)^M
Jan  1 00:00:21 ralink user.warn kernel: c_cflag (00000001)(0)^M
Jan  1 00:00:21 ralink user.warn kernel: xxxxx:-2144891844 9600 260 
Jan  1 00:00:21 ralink user.info kernel: baud 115200^M
Jan  1 00:00:21 ralink user.warn kernel: c_cflag (000018b2)(1)^M
Jan  1 00:00:21 ralink user.warn kernel: c_cflag (000000ba)(0)^M
Jan  1 00:00:21 ralink user.warn kernel: c_cflag (00000000)(0)^M
Jan  1 00:00:21 ralink user.warn kernel: xxxxx:-2144891844 115200 21 
Jan  1 00:00:21 ralink user.info kernel: baud 38400^M
Jan  1 00:00:21 ralink user.warn kernel: c_cflag (000008bf)(1)^M
Jan  1 00:00:21 ralink user.warn kernel: c_cflag (000000ba)(0)^M
Jan  1 00:00:21 ralink user.warn kernel: c_cflag (00000000)(0)^M
Jan  1 00:00:21 ralink user.warn kernel: xxxxx:-2144891844 38400 65 
Jan  1 00:00:21 ralink user.notice kernel: ser2net sets custom speed on ttyS1. This is deprecated.
Jan  1 00:00:21 ralink user.warn kernel: baud 38400^M
Jan  1 00:00:21 ralink user.warn kernel: c_cflag (000008bf)(1)^M
Jan  1 00:00:21 ralink user.warn kernel: c_cflag (000000ba)(0)^M
Jan  1 00:00:21 ralink user.warn kernel: c_cflag (00000000)(0)^M
Jan  1 00:00:21 ralink user.warn kernel: xxxxx:-2144891844 38400 22 
Jan  1 00:00:27 ralink auth.info login[1638]: root login on 'pts/0'

Re: Hi-Link wireless module HLK-RM04

lizby wrote:

>Patch for trunk 35407

Does this mean that openWrt is now working on this device?

How is it flashed?

With the original software, when you get a telnet console, is there something like dmesg?

For details, please see the wiki, but i didn't find an easy way to flash it.
As i wrote in the WIKI, i use the MPR-A1 firmware to burn the hlk-rm04.

@jkent find some more AT commands, can hlk-rm04 be upgrade to openwrt without soldering out the flash now? I'm not sure about this.

This patch is based on Squonk42's MPR-A1 patch, i change the name from MPR-A1 to HLK-RM04, also the initialize way of several gpio so that we can use UART2 with Openwrt.

29 (edited by jkent 2013-07-15 04:34:32)

Re: Hi-Link wireless module HLK-RM04

gaplee wrote:

@jkent find some more AT commands, can hlk-rm04 be upgrade to openwrt without soldering out the flash now? I'm not sure about this.

In theory, flashing should be possible using /dev/mtdX from telnet.  I have not had the opportunity to test this yet.  gabriel.klein already posted the mtd layout for the stock firmware.

Also untested, there is a engineering update page on the httpd that would be even easier: http://192.168.16.254/adm/hlk_update_ww … ch_com.asp

For those that might be interested, here is the directory tree for the httpd. (/etc_ro/web)

Serial2Net.asp
Serial2Net_adv.asp
Serial2Net_overview.asp
Serial2Net_title.htm
Serial2Net_treeapp.asp
adm/
adm/hlk_1037283194.asp
adm/hlk_update_www_hlktech_com.asp
adm/management.asp
adm/rm04_management.asp
adm/settings.asp
adm/statistic.asp
adm/status.asp
adm/syslog.asp
adm/upload_firmware.asp
adm/wizard.asp
cgi-bin/
cgi-bin/ExportSettings.sh
cgi-bin/History
cgi-bin/history.sh
cgi-bin/reboot.sh
cgi-bin/upload.cgi
cgi-bin/upload_bootloader.cgi
cgi-bin/upload_settings.cgi
demo.asp
demo_value.asp
dtree/
dtree/dtree.css
dtree/dtree.js
dtree/img/
dtree/img/base.gif
dtree/img/empty.gif
dtree/img/empty2.gif
dtree/img/folder.gif
dtree/img/folderopen.gif
dtree/img/globe.gif
dtree/img/join.gif
dtree/img/joinbottom.gif
dtree/img/line.gif
dtree/img/minus.gif
dtree/img/minusbottom.gif
dtree/img/nolines_minus.gif
dtree/img/nolines_plus.gif
dtree/img/page.gif
dtree/img/plus.gif
dtree/img/plusbottom.gif
firewall/
firewall/DMZ.asp
firewall/content_filtering.asp
firewall/port_filtering.asp
firewall/port_forward.asp
firewall/system_firewall.asp
graphics/
graphics/1 logo.jpg
graphics/10.gif
graphics/100.gif
graphics/ajax-loader.gif
graphics/checkmrk.gif
graphics/empty.gif
graphics/en.gif
graphics/handshake.gif
graphics/head.jpg
graphics/head_bg.jpg
graphics/left_bg.jpg
graphics/logo.jpg
graphics/rm04_logo.jpg
graphics/topbar.jpg
graphics/uncheckmrk.gif
graphics/warning.gif
graphics/webserver_logo1.gif
graphics/wifi_n.gif
graphics/wps.gif
graphics/zhcn.gif
graphics/zhtw.gif
home.asp
internet/
internet/dhcpcliinfo.asp
internet/ipv6.asp
internet/lan.asp
internet/qos.asp
internet/qosaf.asp
internet/qosclassifier.asp
internet/routing.asp
internet/vpnpass.asp
internet/wan.asp
lang/
lang/b28n.js
lang/en/
lang/en/admin.xml
lang/en/en.rar
lang/en/firewall.xml
lang/en/internet.xml
lang/en/main.xml
lang/en/usb.xml
lang/en/wireless.xml
lang/zhcn/
lang/zhcn/admin.xml
lang/zhcn/firewall.xml
lang/zhcn/internet.xml
lang/zhcn/main.xml
lang/zhcn/usb.xml
lang/zhcn/wireless.xml
lang/zhtw/
lang/zhtw/firewall.xml
lang/zhtw/internet.xml
lang/zhtw/main.xml
lang/zhtw/usb.xml
lang/zhtw/wireless.xml
station/
station/11n_cfg.asp
station/about.asp
station/add_profile_page.asp
station/advance.asp
station/ampdu_org_add.asp
station/ampdu_org_del.asp
station/cert_cacl_upload.asp
station/cert_key_upload.asp
station/edit_profile_page.asp
station/link_status.asp
station/profile.asp
station/qos.asp
station/site_survey.asp
station/site_survey_connection.asp
station/statistics.asp
opmode.asp
overview.asp
ser2net.asp
ser2net_o.asp
style/
style/normal_ws.css
title.htm
treeapp.asp
wireless/
wireless/advanced.asp
wireless/apcli.asp
wireless/apstatistics.asp
wireless/basic.asp
wireless/security.asp
wireless/stainfo.asp
wireless/wapi_cert_as_upload.asp
wireless/wapi_cert_user_upload.asp
wireless/wds.asp
wireless/wmm.asp
wps/
wps/wps.asp
wps/wps_inic.asp
wps/wps_inic_sta.asp
wps/wps_sta.asp
wps/wps_timer.js

Re: Hi-Link wireless module HLK-RM04

Another tip.

You can install TFTP
On Ubuntu http://www.cyberciti.biz/faq/install-co … ian-howto/

Then you can get a file on the ralink using
tftp -g 192.168.16.100 -r essai.txt

Usefull if you want to transfer some executables... like mtd_read .

Re: Hi-Link wireless module HLK-RM04

Good news:
I find the memory configuartion pins.  See wiki
I also create the new DTS format patch for the latest trunk.

Bad news:
For the latest trunk i can't make the uart full (the second uart, openwrt console use uart lite) work, it seems there is a serial bug. Also for this reason i can't publish my patch. Does anyone have idea about how to fix it? See Ticket 13590 .

32 (edited by pfalcon 2013-08-29 21:18:17)

Re: Hi-Link wireless module HLK-RM04

HLK-RM04 now (?) on DX @$16.20:

http://dx.com/p/rt5350f-serial-port-eth … ver-239155

http://dx.com/p/hi-link-hlk-rm04-serial … ack-214540

And here's HiLink Aliexpress shop: http://www.aliexpress.com/store/211069 , where they have bunch of stuff, but with expensive shipping or in multiples. They have discounts from time to time tho.

And this sellers has few of different RT5350 boards with more decent shipping: http://www.aliexpress.com/item/RT5350-m … 69619.html (this one called "AP-902M-A" they say).

Re: Hi-Link wireless module HLK-RM04

Any word on whether any of these can be flashed with openWrt without unsoldering the flash chip?

Re: Hi-Link wireless module HLK-RM04

You can try to ask to the seller 'hlktech' on skype a good price.
He is quite nice!

Re: Hi-Link wireless module HLK-RM04

Hello everybody,
if anybody succeed with dumping original HKL-RM04 flash, i'll be appreciate if you upload it here in bin format.
I flashed the device with OWRT and now could not revert back.

Thanks in advance

36 (edited by gabriel.klein 2013-09-01 15:12:29)

Re: Hi-Link wireless module HLK-RM04

@Kabron: I can probably help. Just need to know how I can dump it smile Probably something with mtd.

Do you have access to uBoot?

Especially this command.
   2: Load system code then write to Flash via TFTP.

@all
Do you have a compiled version I can upload using uBoot or some tips?
Mine is not working sad

I tried to compile OpenWRT with success... but it stops after a few seconds.

[    0.000000] Linux version 3.10.4 (gabriel@GabLap) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2012.12 r37767) ) #4 Sun Sep 1 11:56:41 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] DTB has bad magic, ignoring builtin OF DTB
[    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]

Or any idea how to fix it?

My goal is to build application on top of this really nice device (And some ardumio). I need to be able to build my own firmware. smile

37 (edited by Kabron 2013-09-01 15:50:16)

Re: Hi-Link wireless module HLK-RM04

gabriel.klein wrote:

@Kabron: I can probably help. Just need to know how I can dump it smile Probably something with mtd.

Do you have access to uBoot?

Especially this command.
   2: Load system code then write to Flash via TFTP.

@all
Do you have a compiled version I can upload using uBoot or some tips?
Mine is not working sad

I tried to compile OpenWRT with success... but it stops after a few seconds.

[    0.000000] Linux version 3.10.4 (gabriel@GabLap) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2012.12 r37767) ) #4 Sun Sep 1 11:56:41 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] DTB has bad magic, ignoring builtin OF DTB
[    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]

Or any idea how to fix it?

My goal is to build application on top of this really nice device (And some ardumio). I need to be able to build my own firmware. smile

Hi, Gabriel
I mean to read flash with programmer. I successfuly did it with TL866A from autoelectric.cn. And I plan to write flash back in the same manner. You do not need to desolder the chip, read works fine.   
I do have modified uboot with programming features, but the native firmware from HI LINK is packed in unknown manner. From the other side OWRT FW is totally unusable due to very slow operation(Luci&16MB RAM?) and the chip became very hot. Trying to build OWRT on the basis of carambola tutorial I spent 2 hours on pure compilation, so time to polish OWRT for proper operation is unpredictable.
IMHO, better  to use working native FW.

38 (edited by gabriel.klein 2013-09-02 01:35:42)

Re: Hi-Link wireless module HLK-RM04

How to dump the firmware content

Tip: Do it before trying to change the firmware!!

------------------------

# First enable telnet access and telnet to your device.
Check: https://gist.github.com/jkent/5748249

# On your device
# Make some space, mount a ram device on the web server, dump mtd0
killall -9 syslogd; killall -9 udhcpd; killall -9 klogd; killall -9 getty; killall -9 udhcpc;
killall -9 wscd; killall -9 ser2net;
killall -9 nvram_daemon; killall -9 dnsmasq;
mount -t ramfs -o size=4G ramfs /etc_ro/web/graphics
cat /dev/mtd0 > /etc_ro/web/graphics/mtd0.jpg

# Locally, on your linux
wget --user=admin --password='admin' http://192.168.16.254/graphics/mtd0.jpg
mv mtd0.jpg mtd0

And you are done.
You can do the same with mtd1, mtd2, etc..

mtd0: 00400000 00010000 "ALL"
mtd1: 00030000 00010000 "Bootloader"
mtd2: 00010000 00010000 "Config"
mtd3: 00010000 00010000 "Factory"
mtd4: 000c1295 00010000 "Kernel"
mtd5: 002eed6b 00010000 "RootFS"
mtd6: 003b0000 00010000 "Kernel_RootFS"

------------------------

Now you can install the new uboot (with some more actions).
https://github.com/JiapengLi/OpenWrt-HiLink-HLK-RM04 => uboot128.img

Note: Using uboot, you can flash mtd6 if you want to have the default firmware of Hi-Link.

My Firmware is
.   Image Name:   HLK-RM02
   Created:      2013-04-01  14:09:22 UTC
What is your firmware?

39 (edited by gabriel.klein 2013-09-02 13:31:35)

Re: Hi-Link wireless module HLK-RM04

To extract the content of the directory. (Using Ubuntu...)

Install the software from
http://www.binaryanalysis.org/en/content/show/download
and install binwalk:
apt-get install binwalk

Note: you can *probably* do it with mtd0 as it contains everything!

Install binwalk and analyse mtd6 that was previously extracted.
binwalk mtd6

You see something like
791189        0xC1295       Squashfs filesystem, little endian, non-standard signature,  version 3.0, size: 2449471 bytes, 563 inodes, blocksize: 65536 bytes, created: Mon Apr  1 16:09:18 2013

Extract the squashfs image (filesystem image)
dd if=DIR-320A1_FW121WWb03.bin bs=1 skip=721024 count=2960636 of=fs.squashfs

And run
sudo bat-unsquashfs-ralink data.squashfs

You should have now the file system of your ralink/HLK-RM02 device in a local folder.


Next step: Modify and repackage the file system.

40 (edited by gabriel.klein 2013-09-02 21:54:46)

Re: Hi-Link wireless module HLK-RM04

1)
Any idea how I can write back the file system in mtd6 smile (ie: How I can build uImage using modified file system.)

2)
What is the Ralink SDK version they use for this firmware?

Re: Hi-Link wireless module HLK-RM04

Kabron wrote:
gabriel.klein wrote:

@Kabron: I can probably help. Just need to know how I can dump it smile Probably something with mtd.

Do you have access to uBoot?

Especially this command.
   2: Load system code then write to Flash via TFTP.

@all
Do you have a compiled version I can upload using uBoot or some tips?
Mine is not working sad

I tried to compile OpenWRT with success... but it stops after a few seconds.

[    0.000000] Linux version 3.10.4 (gabriel@GabLap) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2012.12 r37767) ) #4 Sun Sep 1 11:56:41 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] DTB has bad magic, ignoring builtin OF DTB
[    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]

Or any idea how to fix it?

My goal is to build application on top of this really nice device (And some ardumio). I need to be able to build my own firmware. smile

Hi, Gabriel
I mean to read flash with programmer. I successfuly did it with TL866A from autoelectric.cn. And I plan to write flash back in the same manner. You do not need to desolder the chip, read works fine.   
I do have modified uboot with programming features, but the native firmware from HI LINK is packed in unknown manner. From the other side OWRT FW is totally unusable due to very slow operation(Luci&16MB RAM?) and the chip became very hot. Trying to build OWRT on the basis of carambola tutorial I spent 2 hours on pure compilation, so time to polish OWRT for proper operation is unpredictable.
IMHO, better  to use working native FW.

This boot failure is concerned about memory configure, i must say this is a hardware bug of HLK-RM04, by default HLK-RM04 use 16MB SDRAM, but the memory configure select is 32MB, so Openwrt Linux kernel can't detect the memory automatically. to solve this there is two ways:
1. Modify the memory configuration resistor to fit your SDRAM size. See wiki memory configuration
2. Force Openwrt firmware to use 16MB SDRAM, add these lines to the dts file. reference: https://github.com/JiapengLi/OpenWrt-Hi … rm04.patch

    memory@0 {
        reg = <0x0 0x1000000>;
    };

Re: Hi-Link wireless module HLK-RM04

Some more info.

The SDK they use is Ralink SDK 4.0.1.0
The driver is RT2860V2_ap

Re: Hi-Link wireless module HLK-RM04

Apology if this is not the right place to ask this question

I am using HLK-RM04 in Serial Net mode as TCP Server
So in browser I enter Request eg (192.168.1.99:8081) which connects -> Router->Wifi->RM04 -> Serial -> Arduino. i.e. RM-04 is connected on one side via WiFi to my router and the other to Arduino using serial pins

Arduino Code basically waits for serial data terminated with blank line (http request). Once is received it sends HTTP 200 OK response to RM-04 followed by web page to be displayed on client

Problem I have
•   Chrome show OK web screen send back  from Arduino but cursor is ‘hourglass/waiting’. Chrome on Android Mobile same
•  Internet explorer do not display web page, it just waits…

I suspect the problem is with incorrectly formatted http 200 OK packet send back from Arduino or incorrectly formatted subsequent web page. Any suggestions would be appreciated

Debug info:
Request Received by Arduino on serial from HLK-RM04
GET / HTTP/1.1
Host: 192.168.1.99:8081
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
<<blank line>>

Response I send from Arduino via serial to HLK-rm04
HTTP/1.1 200 OK
Content-Type: text/html
Connection: close
<<blank line>>
<form METHOD=get>
Lets go...<br />
Hello: <br />
</form>

In Chrome I get this http web screen, in IE nothing
Lets go...
Hello:

Re: Hi-Link wireless module HLK-RM04

i dont use the line "Connection: close".
instead, i use "Content-Length: xxxx".

here is a sample test i did before. black box with antenna has hlk wifi module.
http://www.youtube.com/watch?v=O3aQIKMA6Nk

Re: Hi-Link wireless module HLK-RM04

Thanks a lot elaber, works OK
BTW I found that closing the connection ensure that if multiple clients connect then each gets own response . otherwise responses for all clients got to 1st connected client

for anyone else benefit here is http OK & form sample code
>>>
void sendOK (){
  Serial.println("HTTP/1.1 200 OK");
  Serial.println("Content-Type: text/html");
  //on HLF-RM04 better to close connection so that each client gets its own response
  //otherwise if Conn not closed then response to Client2 will actually be send to 1st unclosed connection to Client1 (try it by connecting from say Chrome and IE to IP running HLK-RM04 server)
  Serial.println("Connection: close");    // the connection will be closed after sending back the response to client
  //Serial.println("Refresh: 5");            // This works OK, refresh the page automatically every 5 sec
   
  String sr = "";
  sr = "<form METHOD=get>";
  sr += "Lets go...";
  sr += "<br />";   
  sr += "Command : "; 
  sr += "<input type=text name=cmd maxlength=4 size=2 value=21> nnnn";
  sr += "<br />"; 
  sr += "<input type=\"submit\" value=\"ok\">";
  sr += "<br />"; 
  sr += "</form>";
  Serial.print("Content-Length: ");    //need this otherwise Chrome shows page but Cursor 'wait', IE just 'wait'
  Serial.print(sr.length());           

  //need 2x blank lines before html; 2x blank line works ok, 1x shows wait cursor
  Serial.println("\r\n");
  Serial.println("\r\n");

  Serial.print (sr);
}
<<<

Re: Hi-Link wireless module HLK-RM04

hi elaber
I also wanted to say that your projects looks really cool
Peter

Re: Hi-Link wireless module HLK-RM04

Hello

I am new here and I am very excited about this forum since I hve been usingthis device for quite a while already.
Please excuse if this question looks too basic but while I used the device quite a lot before I have not yet worked with its software at all.
My understanding is that all the AT-commands I send via this device are interpreted in the software. When I use for example ATZ I get back the software version E.L.M. 1.5.
Is there a way for me to read out this software (ideally with XP or windows) - then change it?

I have a device which uses this HLK-RM04 and I can upload a new firmware using its webinterface.

So basically all I like to get started with is to download the firmware - "look at it" and change it and then write it back.

Is that possible somehow with XP or windows?
Many thanks for your help!

Re: Hi-Link wireless module HLK-RM04

Dear JudeWalli, do you have some software skills?

What I suggest is to find the Ralink SDK (4.x), and try to compile this SDK.

You might use the one from OpenWRT, but my experience was that it's too slow and almost impossible to use sadely.

Re: Hi-Link wireless module HLK-RM04

I'm trying make this module work, but I have the same problem as mentioned above. The kernel boots but stops after:
[    0.000000] Early memory node ranges                                                                                       
[    0.000000]   node   0: [mem 0x00000000-0x01ffffff]

I compiled openwrt today as described at https://github.com/JiapengLi/OpenWrt-HiLink-HLK-RM04 so the patch for 16M ram should be active.

Any ideas?

Re: Hi-Link wireless module HLK-RM04

jenshoej wrote:

I'm trying make this module work, but I have the same problem as mentioned above. The kernel boots but stops after:
[    0.000000] Early memory node ranges                                                                                       
[    0.000000]   node   0: [mem 0x00000000-0x01ffffff]

I compiled openwrt today as described at https://github.com/JiapengLi/OpenWrt-HiLink-HLK-RM04 so the patch for 16M ram should be active.

Any ideas?

Can you list some more detailed information(Full log info)?  How do you compile? How do you install? And the Uboot, did yo ever replace the Uboot?