Cudy WR1300 support?

Thank you for your suggestions and your explanations!

There are no other APs around, the neighbours are far away so I don't think it's a problem of interference.

I set the 2.4ghz to channel 6, but it seems to behave the same. Are you in auto for both bands?

For 5ghz, it could be as you say. I'm in Europe and all channels have restrictions (according to command iw reg get). If I set the country to India (no restrictions there ...), it keeps the channel I choose in the UI (but the network is still not stable).

What puzzles me is that no matter what setting I put, the situation is the same.
For example, I could connect with my phone from the garden with original fw whereas with openwrt, it doesnt even list the access points there. Since there is no other network around, I wonder whereas it could be a power issue. Maybe openwrt driver is not setting the transmit power to the max even though it says it is?

1 Like

Do the default firmware has DFS channels?

I would guess so, it is a legal requirement and it seems based off openwrt which supports this so ...

1 Like

Thanks for your work! :slight_smile:

How would I compare this to the original image builder to get an idea about the changes? I had a look at the image builder files and there are many ipk packages that are gzip compressed. Since the image builder is used to add precompiled packages it is pretty useless to diff them to the original image builder via e.g. GitHub … Is there some step by step howto to get a reproducible image? That would be awesome! :slight_smile:

Secondly, adding new device support would require a list of the chips and access to the bootloader, and then get the source and build images and once done, issue a PR. Is anyone working on this?

1 Like

Hi

I have two questions:

How image-WR1300.dtb is obtained?
And why WR1300.dts is so different to the one provided by Cudy in its web?

Thanks

image-WR1300.dtb was compiled from source WR1300.dts by command.
WR1300.dts was corrected for latest stable branch openwrt-19.07

1 Like

So, for Image Builder would be :

$ wget https://downloads.openwrt.org/releases/19.07.4/targets/ramips/mt7621/openwrt-imagebuilder-19.07.4-ramips-mt7621.Linux-x86_64.tar.xz
$ tar xf openwrt-imagebuilder-19.07.4-ramips-mt7621.Linux-x86_64.tar.xz

ADD ./files/etc/board.d/02_network

ADD ./target/linux/ramips/dts/WR1300.dts

MODIFY ./.targetinfo
 Build firmware images for ZBT WG3526 (32MB flash)
 @@
+
+Target-Profile: DEVICE_cudy_wr1300
+Target-Profile-Name: Cudy WR1300
+Target-Profile-Packages: kmod-mt7603 kmod-mt76x2 kmod-usb2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
+Target-Profile-hasImageMetadata: 1
+Target-Profile-SupportedDevices: cudy-wr1300 wr1300 cudy,wr1300
+
+Target-Profile-Description:
+Build firmware images for Cudy WR1300
+@@

 Target: ramips/mt76x8

MODIFY ./target/linux/ramips/image/mt7621.mk
        kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
 endef
 TARGET_DEVICES += zbt-wg3526-32M
+
+define Device/cudy_wr1300
+  DTS := WR1300
+  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  SUPPORTED_DEVICES += cudy-wr1300 wr1300
+  DEVICE_TITLE := Cudy WR1300
+  DEVICE_PACKAGES :=  kmod-mt7603 kmod-mt76x2 kmod-usb2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
+endef
+TARGET_DEVICES += cudy_wr1300
+

MODIFY ./target/linux/ramips/base-files/etc/board.d/02_network
                ucidef_add_switch "switch0" \
                        "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
                ;;
+       cudy,wr1300)
+               ucidef_add_switch "switch0" \
+                       "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6t@eth0"
+               ;;
        gehua,ghl-r-001)
                ucidef_add_switch "switch0" \
                        "0:lan" "1:lan" "2:lan" "4:wan" "6@eth0"

ADD ./build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-WR1300.dtb

$ cat build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/vmlinux \
build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-WR1300.dtb \
>cudy_wr1300-kernel
$ ./staging_dir/host/bin/lzma e -lc1 -lp2 -pb2 cudy_wr1300-kernel cudy_wr1300-kernel.lzma
$ ./staging_dir/host/bin/mkimage -A MIPS -O linux -T kernel -C lzma \
-a 8001000 -e 80001000 -n "MIPS OpenWrt Linux-4.14.195" \
-d cudy_wr1300-kernel.lzma  \
build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/cudy_wr1300-kernel.bin

$ make image PROFILE=cudy_wr1300 FILES=files PACKAGES=luci

And for compiling :

$ git clone https://git.openwrt.org/openwrt/openwrt.git
$ cd openwrt
$ git checkout v19.07.4 -b mybranch

ADD target/linux/ramips/dts/WR1300.dts
MODIFY target/linux/ramips/base-files/etc/board.d/02_network
                ucidef_add_switch "switch0" \
                        "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
                ;;
+       cudy,wr1300)
+               ucidef_add_switch "switch0" \
+                       "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6t@eth0"
+               ;;
        gehua,ghl-r-001)
                ucidef_add_switch "switch0" \
                        "0:lan" "1:lan" "2:lan" "4:wan" "6@eth0"
MODIFY target/linux/ramips/image/mt7621.mk
        kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
 endef
 TARGET_DEVICES += zbt-wg3526-32M
+
+define Device/cudy_wr1300
+  DTS := WR1300
+  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  SUPPORTED_DEVICES += cudy-wr1300 wr1300
+  DEVICE_TITLE := Cudy WR1300
+  DEVICE_PACKAGES :=  kmod-mt7603 kmod-mt76x2 kmod-usb2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
+endef
+TARGET_DEVICES += cudy_wr1300
+

$ ./scripts/feeds update -a
$ ./scripts/feeds install -a
$ make menuconfig
        Target System (MediaTek Ralink MIPS)
        Subtarget (MT7621 based boards)
        Target Profile (CUDY WR1300)
$ make
$ ls -l ./build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-WR1300.dtb

Hi,

I am using the system image provided by @lrussell887. I use my CR 1300 as Ethernet Switch and Access point, everything works like a charm, so thanks for the work.

I am new to openwrt and have some questions.

Is anybody currently working on a pull request, so openwrt will officially support the Cudy WR 1300? Will this mean that new firmware versions will automatically be created for this hardware? I am not sure, if openwrt has some kind of CI/CD behind, that builds each profile automatically...

After installing openwrt I see that I am still running a quite old Kernel (4.14, this is from 2017). Is this kernel part of the image I flashed or am I still using the kernel provided by cudy?

bests

Sascha

Seems like 4.14 is the current kernel for 19.07: https://openwrt.org/about/history

1 Like

Any news about adding support for this device submitting a PR ?

That would be awesome if they did, but in the meantime, I found that Cudy does provide their own firmware image for OpenWRT.

Hi,

I am trying to build my own image with imagebuilder of openwrt 19.7.5. Therefore I downloaded the imagebuilder. Next I wanted to apply the pach that you described above. But I have no ide waht i shall do with the lines after the tar command and before the cat. I thought this shall be some kind of patch, but if I paste the date in patch it tell me that my input is garbage. Can you tell me, what I have to do with that lines?

bests

Sascha

Hi

With ADD I would mean just to copy the files provided by @123serge123 Cudy WR1300 support?

With MODIFY, just to edit the file and doing the changes in it.

I suggest you to compiling rather than using image builder. I think I get some kernel magic numer issue installing some kernel modules packages, when image was built using image builder.

Regards

i don't think you can do this by using imagebuilder, this is only for cases where you want to change packages, configuration and similar, not actual code.

Yes, you can modify image builder for adding support to Cudy wr1300 as described in Cudy WR1300 support?

Hi,

it worked at least for the imagebuilder. I created a patchfile with the changes from @jgora against the official openwrt imagebuilder for openwrt 19.07.4. I placed the patch file here: https://drive.google.com/file/d/1itulmANNQ3_546vXDq32_b6Iqcg0ZOhS/view?usp=sharing. Thereafter I downloaded the openwrt imagebuilder for 19.07.5 from https://downloads.openwrt.org/releases/19.07.5/targets/ramips/mt7621/openwrt-imagebuilder-19.07.5-ramips-mt7621.Linux-x86_64.tar.xz. Then I did

$ tar xf openwrt-imagebuilder-19.07.5-ramips-mt7621.Linux-x86_64.tar.xz
$ cd openwrt-imagebuilder-19.07.5-ramips-mt7621.Linux-x86_64
$ patch -p1 ~/cudy_openwrt_imagebuilder_19.07.5.patch
$ cat build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/vmlinux \
build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-WR1300.dtb \
>cudy_wr1300-kernel
$ ./staging_dir/host/bin/lzma e -lc1 -lp2 -pb2 cudy_wr1300-kernel cudy_wr1300-kernel.lzma
$ ./staging_dir/host/bin/mkimage -A MIPS -O linux -T kernel -C lzma \
-a 8001000 -e 80001000 -n "MIPS OpenWrt Linux-4.14.195" \
-d cudy_wr1300-kernel.lzma  \
build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/cudy_wr1300-kernel.bin

$ make image PROFILE=cudy_wr1300 FILES=files PACKAGES=luci

So mostly following jgoras description. Thereafer I found the image in bin/targets/ramips/mt7621/openwrt-19.07.5-ramips-mt7621-cudy_wr1300-squashfs-sysupgrade.bin. I flashed this to my WR 1300 and it seems to work.

Thanks, @jgora! Could you perhaps create a patch file for the sources? Or (even better) make your git repo accessible? If not, I will try it on my own to build from sources with your description.

bye

Sascha

You can get the sources here https://github.com/jgora/openwrt
The changes are https://github.com/openwrt/openwrt/compare/openwrt-19.07...jgora:jgora?diff=unified

Hi,

thanks, great. I will try this out.

bests

Sascha

Hi @jgora,

thanks, I was able to build the image also from sources with your sources. I just merged your changes into the actual openwrt 19.7 branch.

Is anything else necessary to start a pull request to openwrt? If that`s all, would you like to create the pull request? I would really like to get it into official openwrt.

bests

Sascha