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,

Does anybody ever made the 1-wire bus work ?

I searched and did a bunch of tests to setup 1-wire on gpio0 (using kmod-w1, kmod-w1-gpio-custom, kmod-w1-slave-therm), but always got errors like:

unable to select pin group

or

[   23.250000] w1-gpio w1-gpio.0: no of_node; not parsing pinctrl DT
[   23.250000] w1-gpio w1-gpio.0: Failed to parse gpio property for data pin (-2)
[   23.250000] w1-gpio: probe of w1-gpio.0 failed with error -2

I think the HLKRM04.dts have the wrong parameters and I don't know what to do ... I tried with the default .dts file, by freeing gpio or by adding the following section

w1-gpio {
        compatible = "w1-gpio";
        gpios = <&gpio0 0 1>;
};

I tried with Barrier Breaker (revision 42625) and nightly builds Chaos Calmer rev 45xxx

If someone succeeded on setting up the 1-wire bus, could he explain how he have done it !

Thanks

(Last edited by Faren on 30 Apr 2015, 07:36)

I got 1-wire bus running but not on that device. THis looks like a bug.I would suggest you come to IRC and talk to devs about this issue. If it turns out to be a bug then open a new bug ticket.

Dear OpenWrt Community!

I want to use these nice little modul in my network, but first I need to bridge their two network interface (LAN+WAN) together. I have two methods to make it.

See below my /etc/config/network config file:

1. method

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config interface 'lan'
    option ifname 'eth0'
    option proto 'dhcp'

config switch
    option name 'switch0'
    option reset '1'
    option enable_vlan '1'

config switch_vlan
    option device 'switch0'
    option vlan '0'
    option ports '0 1 2 3 4 6'

Result:

root@OpenWrt:~# swconfig dev switch0 show
Global attributes:
        enable_vlan: 1
        alternate_vlan_disable: 0
        bc_storm_protect: 0
        led_frequency: 0
Port 0:
        disable: 0
        doubletag: 0
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: 0
        tr_good: 0
        pvid: 0
        link: port:0 link:down
Port 1:
        disable: 0
        doubletag: 0
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: 0
        tr_good: 0
        pvid: 0
        link: port:1 link:down
Port 2:
        disable: 0
        doubletag: 0
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: 0
        tr_good: 0
        pvid: 0
        link: port:2 link:down
Port 3:
        disable: 0
        doubletag: 0
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: 0
        tr_good: 0
        pvid: 0
        link: port:3 link:down
Port 4:
        disable: 0
        doubletag: 0
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 262
        tr_bad: 0
        tr_good: 121
        pvid: 0
        link: port:4 link:up speed:100baseT full-duplex
Port 5:
        disable: 1
        doubletag: 0
        untag: 0
        led: ???
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: 0
        tr_good: 0
        pvid: 0
        link: port:5 link:down
Port 6:
        disable: 0
        doubletag: 0
        untag: 1
        led: ???
        lan: ???
        recv_bad: ???
        recv_good: ???
        tr_bad: ???
        tr_good: ???
        pvid: 0
        link: port:6 link:up speed:1000baseT full-duplex
VLAN 0:
        ports: 0 1 2 3 4 6


root@OpenWrt:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 44:33:4C:C9:AC:00
          inet addr:192.168.0.13  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:279 errors:0 dropped:0 overruns:0 frame:0
          TX packets:141 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:53596 (52.3 KiB)  TX bytes:17581 (17.1 KiB)
          Interrupt:5

eth0.1    Link encap:Ethernet  HWaddr 44:33:4C:C9:AC:00
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:1043 (1.0 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1968 (1.9 KiB)  TX bytes:1968 (1.9 KiB)

2. method

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config interface 'lan'
    option ifname 'eth0'
    option proto 'dhcp'

config switch
    option name 'switch0'
    option reset '1'
    option enable_vlan '0'

Result:

root@OpenWrt:/# swconfig dev switch0 show
Global attributes:
        enable_vlan: 0
        alternate_vlan_disable: 0
        bc_storm_protect: 0
        led_frequency: 0
Port 0:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: 0
        tr_good: 0
        pvid: 0
        link: port:0 link:down
Port 1:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: 0
        tr_good: 0
        pvid: 0
        link: port:1 link:down
Port 2:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: 0
        tr_good: 0
        pvid: 0
        link: port:2 link:down
Port 3:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: 0
        tr_good: 0
        pvid: 0
        link: port:3 link:down
Port 4:
        disable: 0
        doubletag: 1
        untag: 1
        led: 5
        lan: 1
        recv_bad: 0
        recv_good: 4000
        tr_bad: 0
        tr_good: 711
        pvid: 0
        link: port:4 link:up speed:100baseT full-duplex
Port 5:
        disable: 1
        doubletag: 1
        untag: 1
        led: ???
        lan: 1
        recv_bad: 0
        recv_good: 0
        tr_bad: 0
        tr_good: 0
        pvid: 0
        link: port:5 link:down
Port 6:
        disable: 0
        doubletag: 1
        untag: 1
        led: ???
        lan: ???
        recv_bad: ???
        recv_good: ???
        tr_bad: ???
        tr_good: ???
        pvid: 0
        link: port:6 link:up speed:1000baseT full-duplex
VLAN 0:
        ports: 0 1 2 3 4 5 6


root@OpenWrt:/# ifconfig
eth0      Link encap:Ethernet  HWaddr 44:33:4C:C9:AC:00
          inet addr:192.168.0.13  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3633 errors:0 dropped:0 overruns:0 frame:0
          TX packets:726 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:971390 (948.6 KiB)  TX bytes:88656 (86.5 KiB)
          Interrupt:5

eth0.1    Link encap:Ethernet  HWaddr 44:33:4C:C9:AC:00
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:1043 (1.0 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:474 (474.0 B)  TX bytes:474 (474.0 B)

The two result is almost the same.
I don't know why the eth0.1 interface appears in the interface list. In the first method I use VLAN0, but in the second method I disable the VLAN. I don't use other tagged VLAN, especially not VLAN1. I think maybe it is a bug. Can somebody confirm that, or tell me why is there smile?

My OpenWrt version is r45707

Sorry for my bad English!
Thank You!

Viktor

I am not an expert, but you forgot to the define the bridge, didn't you?

Some like this in /etc/config/network:

config 'interface' 'lan'
    option 'type' 'bridge'
    option 'ifname' 'eth0.1 eth0.2'

Something similar worked for me on a livebox.

Thank You for your answer suso!

I know these method, but my goal was, to bridge the two LAN port without VLAN (software bridge eth0.1 + eth0.2). Because RT5350 have built in switch it can make it in the hardware layer. My problem was that the eth0.1 virtual ethernet interface appears, but I disable the VLAN support in the config file (2. method).

At the time, I solved the problem by disabled the VLAN support in the kernel_menuconfig, and use the second config file. So the result is full hardware bridge, and the ifconfig show only one ethernet interface (eth0).

I think these is a bug in the VLAN support, because eth0.1 have to disappear when the VLAN is disabled.

Dear OpenWrt Community!

I am interested in that does someone have experiance with the mixed uartf (gpio uartf) node config in the dts file? I try almost everything, but no succes. It is registering always as full uart. Does the newest trunk support it? I use 45707 version.

My dts file:

/dts-v1/;

/include/ "rt5350.dtsi"

/ {
    compatible = "HLKRM04", "ralink,rt5350-soc";
    model = "HILINK HLK-RM04";

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

    palmbus@10000000 {
        spi@b00 {
            status = "okay";
            m25p80@0 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "gd25q64";
                reg = <0 0>;
                linux,modalias = "m25p80", "s25fl064k";
                spi-max-frequency = <10000000>;

                partition@0 {
                    label = "u-boot";
                    reg = <0x0 0x30000>;
                    read-only;
                };

                partition@30000 {
                    label = "u-boot-env";
                    reg = <0x30000 0x10000>;
                    read-only;
                };

                factory: partition@40000 {
                    label = "factory";
                    reg = <0x40000 0x10000>;
                    read-only;
                };

                partition@50000 {
                    label = "firmware";
                    reg = <0x50000 0x3b0000>;
                };
            };
        };

        uart@500 {
            status = "okay";
        };
    };

    pinctrl {
        state_default: pinctrl0 {
            gpio {
                ralink,group = "i2c", "jtag";
                ralink,function = "gpio";
            };
        };

        uartf_pins: uartf {
            uartf {
                ralink,group = "uartf";
                ralink,function = "gpio uartf";
            };
        };
    };

    ethernet@10100000 {
        mtd-mac-address = <&factory 0x4>;
    };

    wmac@10180000 {
        ralink,mtd-eeprom = <&factory 0>;
    };

    ehci@101c0000 {
        status = "okay";
    };

    ohci@101c1000 {
        status = "okay";
    };

    gpio-keys-polled {
        compatible = "gpio-keys-polled";
        #address-cells = <1>;
        #size-cells = <0>;
        poll-interval = <20>;

        exit {
            label = "reset";
            gpios = <&gpio0 0 1>;
            linux,code = <0x198>;
        };

        wps {
            label = "wps";
            gpios = <&gpio0 14 1>;
            linux,code = <0x211>;
        };
    };
};

Thank You!

Viktor

Hello, guys.

Who can't see GPIO in /sys/class/gpio - use this link: http://wiki.openwrt.org/doc/hardware/port.gpio , "Finding GPIO pins on the PCB".

I have a little questions. How do you use GPIO on this device? I want to connect DHT22 and can't find driver. Will you help me?

Does any body had used USB host on RM04 successfully.
When I was trying to use it as USB host
it did not register I just wanted to verify the hardware is perfect

Thnaks In advance

uboot128.img is for 16MB version
uboot256.img is for 32MB version

wpagnon wrote:

Hi Guys,

same thing,

I'm trying to install openWRT without success, I've bricked 3 modules already.

I've followed those instructions too

http://wiki.openwrt.org/toh/hilink/hlk-rm04

I'm using the dev board Kit-V2.3 of the HLK-RM04. any help would be greatfull. My main aim is to get it to work as Wi-Fi client with a device connected to the HLK-RM04 ethernet port, ATM it seem that the client Wi-Fi workes only for RS232 connection

as well, a question, I've used the bootloader uboot128.img but there is as well uboot256.img.... is this an updated one or is it for diferent memory setup?

Hi, I have successfully build CC++ (DESIGNATED DRIVER (Bleeding Edge, r47199)) and flashed it using the uboot.
I'm unclear if I have a 16M or 32M device: is there a way to tell without removing the RF shield? 
What happens if I put the uboot256.img on the device and I don't have 32M?

Itry to flash my hlk-rm04
but when enter in ftpf mode it's freeze with that
System Load Linux Kernel then write to Flash via TFTP.


Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N)


Please Input new ones /or Ctrl-C to discard


    Input device IP (10.10.10.123) ==:10.10.10.123



btw what kind of serial I must use on windows xp sp3?


can anybody help me ?

(Last edited by cjmcx on 30 Nov 2015, 17:22)

cjmcx wrote:

Itry to flash my hlk-rm04
but when enter in ftpf mode it's freeze with that
System Load Linux Kernel then write to Flash via TFTP.


Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N)


Please Input new ones /or Ctrl-C to discard


    Input device IP (10.10.10.123) ==:10.10.10.123



btw what kind of serial I must use on windows xp sp3?


can anybody help me ?

Any FTDI or PL2303 serial adapters. If you have a Raspberry Pi, it has already one.

I just flash it
but when I go in web ui and try to setup anything the router is gone in reset
in serial window write
"[  585.150000] Out of memory: Kill process 992 (luci) score 70 or sacrifice child
[  585.160000] Killed process 992 (luci) total-vm:3068kB, anon-rss:1284kB, file-rss:0kB"
If I try to reload original firmware a got error mesage
"Booting image at bc050000 ...

raspi_read: from:50000 len:40

.Bad Magic Number,9FF792FB "

know anyone what is that number?
if I try to flash via web ui an  hlk ro04 whit original firmware, whit any openwrt I got same error
can i edit u-boot.img  for that magic number ?

anoder stupid question
can I change winbond flash memory 25q32 whit an sd card 1G ?

(Last edited by cjmcx on 2 Dec 2015, 10:13)

Newbie with Openwrt
i have flashed my Hi-Link board successfully Openwrt start I have tested serial and ssh connection
but I am not able to config wifi

The command "wifi detect" return nothing

I have also configure manually the /etc/config/wireless file but nothing happen

config wifi-device 'radio0'
        option type 'mac80211'
        option channel 'auto'
        option hwmode  '11ng'
        option disabled '0'

config wifi-iface
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'openwrt'
        option hidden '0'
        option encryption 'none'

Thanks to all for help or suggestions

I have dowloaded this image
openwrt-ramips-rt305x-hlk-rm04-squashfs-sysupgrade.bin

(Last edited by accacca on 8 Feb 2016, 01:59)

I use "iwinfo wlan0 scan" to find wireless networks. However I built my own image.

You are trying to setup AP, I don't know if that's compatible with scanning.

I have:

config wifi-device  radio0
    option type     mac80211
    option channel  11
    option hwmode    11g
    option path    '10180000.wmac'
    option htmode    HT20
    # REMOVE THIS LINE TO ENABLE WIFI:
    option disabled 0

Do you have a proper "config interface lan" in /etc/config/network? Is "hostapd" up and running?

(Last edited by suso on 8 Feb 2016, 14:51)

Thanks for reply suso
Sorry for delay but sometime I can't access forum (The page is not available)

The command "iwinfo wlan0 scan" return
No such wireless device:  wlan0

I don't know hostapd config (I must study!)
I have also changed the wireless config from ap to sta but nothing happen sob...

Did you have a look at the output of dmesg?

after
wifi down
wifi up
dmesg end with these lines:

0.996699] rt3050-esw 10110000.esw: link changed 0x00
[   22.586531] rt3050-esw 10110000.esw: link changed 0x08
[   28.530723] device eth0.1 entered promiscuous mode
[   28.540425] device eth0 entered promiscuous mode
[   28.568229] br-lan: port 1(eth0.1) entered forwarding state
[   28.579571] br-lan: port 1(eth0.1) entered forwarding state
[   30.577447] br-lan: port 1(eth0.1) entered forwarding state
[   68.027466] random: nonblocking pool is initialized

I have also installed a minimal image (link in message 153 pg7 by sskriblo)
the wlan ap seem start but I dont see the ap

Sorry. I missed your reply. I meant dmesg after boot, i.e.:

dmesg | grep 80211

BTW, did you check the modules?

lsmod | grep 80211

I have a device that is similar to the HLK-RM04, it's the HLK-SW16 and I'm trying to integrate with some automation infrastructure. I managed to get some SDK's, serial apps, a firmware image and Docs from the manufacturer here but they don't seem to be interested in giving out the actual firmware source code like they are supposed to even though I'm making it the condition of a bulk purchase. I found out by default the device uses a service at nat.vveye.net to punch a hole through NAT and establish a connection with the controller app using a simplistic user/password authentication scheme which is obviously a huge security risk, the binary on the device that appears to be making the external connection is "T2uSvr" which establishes a connection with the library in the client side SDK's. Any idea if I can use the HLK-RM04 OpenWRT firmware with this device and if I'll be able to control the relay switches with it?

sancho wrote:

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 :(
I tried to use the trunk build, but even opkg list kill the device - I run out of memory :(


Hello Sancho, I'm trying to do the same, but I have not enough memory, How did you resolve this? I can't install packages, because when I used opkg the process is killed by the same reason.

In case anyone is interested in starting the original firmware (HLK_RM04_v1.78.img) from flash after programming uboot128/256, with output on its ttyS1 (the interface with Sub-D9 on the devkit), use the following commands from U-Boot command line (and "saveenv" if you want the functionality permanently):

# setenv ramargs
# setenv bootargs console=ttyS1,57600 mem=16M root=/dev/mtdblock5
# bootm bc050000
...
Image Name:   HLK-RM02
   Created:      2013-07-23  12:01:07 UTC
...
Starting kernel ...
Linux version 2.6.21 (tim@debian6) (gcc version 3.4.2) #103 Tue Jun 18 22:27:43 HKT 2013

Any HLK firmware image intended to be uploaded via Web UI first has be decrypted, using the mkhilinkfw tool, before it can be flashed using the bootloader's option 2.

mkhilinkfw -d -i HLK_RM04_v1.78.img -o bootable.img

The tool now comes with the OpenWRT toolchain.

(Last edited by kawk on 26 Aug 2016, 19:04)

Hi
I have an rm04 (4MB flash , 16MB ram)
it has uboot128 on it
and openwrt-ramips-rt305x-hlk-rm04-squashfs-sysupgrade.bin
From -- downloads.openwrt.org/snapshots/trunk/ramips/generic/ --
It works as a basic router , but I can't load the web interface@192.168.1.1
I presume this is a memory constraint ?
I would like to load HLK_RM04_v1.83.img onto it but it appears it needs to be decrypted .
is there a method to do this in a windows enviroment or perhaps someone has a copy I can download ?

Thanks
Barry

(Last edited by BarryP on 28 Oct 2016, 23:45)

The discussion might have continued from here.