Add support for Cudy X6 (Wifi 6 router)?

Hi, thanks for your reply. This is a screenshot of the firmware after I installed the Openwrt from Cudy's website (linked above):

and here is the content of the .dts file

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "mt7621.dtsi"

#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>

/ {
	compatible = "cudy-x6", "mediatek,mt7621-soc";
	model = "CUDY X6";

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

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

	keys {
		compatible = "gpio-keys";

		reset {
			label = "reset";
			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};

		wps {
			label = "wps";
			gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_WPS_BUTTON>;
		};
	};

	leds {
		compatible = "gpio-leds";

		led_blue: blue {
			label = "blue";
			gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
		};

		led_red: red {
			label = "red";
			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
		};
	};

};

&spi0 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <80000000>;
		m25p,fast-read;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			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>;
			};

			debug: partition@1fd0000 {
				label = "debug";
				reg = <0x1fd0000 0x10000>;
			};

			backup: partition@1fe0000 {
				label = "backup";
				reg = <0x1fe0000 0x10000>;
			};

			bdinfo: partition@ff0000 {
				label = "bdinfo";
				reg = <0x1ff0000 0x10000>;
				read-only;
			};

			firmware: partition@50000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x50000 0x1f80000>;
			};
		};
	};
};

&pcie {
	status = "okay";
};

&pcie1 {
	wifi@0,0 {
		compatible = "mediatek,mt76";
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x0000>;
	};
};

&gmac0 {
	mtd-mac-address = <&bdinfo 0xDE00>;
};

&switch0 {
	ports {
		port@0 {
			status = "okay";
			label = "lan1";
		};

		port@1 {
			status = "okay";
			label = "lan2";
		};

		port@2 {
			status = "okay";
			label = "lan3";
		};

		port@3 {
			status = "okay";
			label = "lan4";
		};

		port@4 {
			status = "okay";
			label = "wan";
			mtd-mac-address = <&factory 0xA>;
		};
	};
};

&state_default {
	gpio {
		groups = "i2c", "wdt";
		function = "gpio";
	};
};

Reach out to them, and request the source tarball for the openwrt image they posted on their home page.

They're should provide one, in compliance with GPL.

2 Likes

yes belkin is very good for more powerfull :wink:

Someone is based on this to make Cudy WR2100 officially released, and it says this could also be used for develop X6. You may take a look.

1 Like

Thank you, I will look at this

Small update to this topic:

Using the mirror that @fatreedl pointed me to, I found the commit that added support for Cudy X6:
ramips-add support for cudy wr2100-x6 · zxg120-openwrt@2cb83c9

From there, I figured out where to add the .dts file Cudy provided and edit the .mk file. I then cloned the official Openwrt v21.02.0-rc3 tag and added Cudy X6.

My resulting build had the same behavior as the Openwrt provided by Cudy. It seems that the driver detects two wifi devices but really only knows how to access one of them.

So this is a waiting game for the MT7915E drivers to mature (I say waiting game because I, in no way, have the skills to fix the drivers myself).

For Cudy X6 I think the switch is not managed correctly with version 21.02 as for the Tenbay WR1800K WIFI-6 and Huasifei WR1800K-AX-NAND boxes

I am expecting 2 products this week to see this ...

fist test:

serial port TX ( near r5314 ) RX GND +3V

For recover firmware request a file with name: recovery.bin in tftp folder
Power up ans push reset button ( some 10 seconds ) and you have tftp recovery request in the serial console
For recovery.bin file
download X6 For Developer.zip
https://www.cudytech.com/openwrt_software_download
Extract , rename openwrt-ramips-mt7621-cudy-x6-flash.bin to recovery.bin & copy in your tftp folder

flash is 16 pins Winbond W25Q256JVFQ

to use the 8-pin spi memory, components are not wired

with openwrt developper no wifi AC/AX

build:

git clone https://git.openwrt.org/openwrt/openwrt.git
./scripts/feeds update -a
./scripts/feeds install -a

add this mt7621_cudy_x6.dts in ramips dts folder

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "mt7621.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	compatible = "cudy,x6", "mediatek,mt7621-soc";
	model = "CUDY X6";

	aliases {
		led-boot = &led_internet_blue;
		led-failsafe = &led_internet_blue;
		led-running = &led_internet_blue;
		led-upgrade = &led_internet_blue;
		label-mac-device = &gmac0;
	};

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

	keys {
		compatible = "gpio-keys";

		reset {
			label = "reset";
			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};

		wps {
			label = "wps";
			gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_WPS_BUTTON>;
		};
	};

	leds {
		compatible = "gpio-leds";

		led_internet_blue: internet_blue {
			label = "blue:internet";
			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
		};

		internet_red {
			label = "red:internet";
			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
		};
	};

};

&spi0 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <50000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			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>;
			};

			partition@50000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x50000 0x1f80000>;
			};

			partition@1fd0000 {
				label = "debug";
				reg = <0x1fd0000 0x10000>;
			};

			partition@1fe0000 {
				label = "backup";
				reg = <0x1fe0000 0x10000>;
			};

			bdinfo: partition@1ff0000 {
				label = "bdinfo";
				reg = <0x1ff0000 0x10000>;
			};
		};
	};
};

&pcie {
	status = "okay";
};

&pcie1 {
	wifi@0,0 {
		compatible = "mediatek,mt76";
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x0000>;
	};
};

&gmac0 {
	mtd-mac-address = <&bdinfo 0xde00>;
};

&switch0 {
	ports {
		port@0 {
			status = "okay";
			label = "lan1";
		};

		port@1 {
			status = "okay";
			label = "lan2";
		};

		port@2 {
			status = "okay";
			label = "lan3";
		};

		port@3 {
			status = "okay";
			label = "lan4";
		};

		port@4 {
			status = "okay";
			label = "wan";
			mtd-mac-address = <&bdinfo 0xde00>;
			mtd-mac-address-increment = <1>;
		};
	};
};

&state_default {
	gpio {
		groups = "wdt", "i2c", "jtag";
		function = "gpio";
	};
};

edit mt7621.mk in image folder and add a section with this:

define Device/cudy_x6
  $(Device/dsa-migration)
  IMAGE_SIZE := 32448k
  DEVICE_VENDOR := Cudy
  DEVICE_MODEL := X6
  UIMAGE_NAME := R13
  DEVICE_PACKAGES := kmod-mt7915e
endef
TARGET_DEVICES += cudy_x6

found problem with opkg , i use this:

src/gz openwrt_core https://downloads.openwrt.org/snapshots/targets/ramips/mt7621/packages
src/gz openwrt_base https://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base
src/gz openwrt_luci https://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci
src/gz openwrt_packages https://downloads.openwrt.org/snapshots/packages/mipsel_24kc/packages
src/gz openwrt_routing https://downloads.openwrt.org/snapshots/packages/mipsel_24kc/routing
src/gz openwrt_telephony https://downloads.openwrt.org/snapshots/packages/mipsel_24kc/telephony

Photos:




Thanks! That should be somehow pinned or added to wiki.

These are down to $39 now on Amazon -- was looking at the Belkin RT3200, but I'm skeptical that one Belkin will provide better coverage than 2 of these in a mesh.

In terms of wireless coverage and throughput, two (even slightly lower-class) APs are always better than one single high-end wireless router. The concern about the combination of mt7621a and wifi6 mt7915e is about the SOC performance, yes it's good at offloading, but when speed is required, it's still a comparatively old/ low-end 2*880 MHz mips CPU, which isn't the best match to keep a fast WAN and wifi6 network busy.

1 Like

For speed i not use WAN because i have a 2 * 1 GBs fiber Livebox 5 Orange

I have replaced WR1200JS by the Cudy X6 ( managed switch + WIfi AX access )

41183caa75a3ccb36ab3ccb78c74fba9625bd44e_2_637x500

Hi everyone,
I've build the OpenWRT-Master with the support to Cudy X6 and it seems to work great, i was wondering how can i share what i did.
Should i create a New Branch etc?
Also, there's one small problem, 160MHZ channel don't work, it errors out with DFS and won't work even with channels manually set, but i found this: https://patchwork.kernel.org/project/linux-wireless/patch/20210804134337.2582-5-greearb@candelatech.com/

pushed to the linux kernel, i think that's what causing the problem on openwrt, because the latest update to mt76 is from july and the commit linked above is from Aug.
(Was wondering if we can manually update the mt76 files ourselves(?))

Anyway can't wait for an answer :slight_smile:

(Also first time posting ever replying to some post :slight_smile: )

1 Like

For the DFS I also have problems when I use the 80 MHz and the WIFI FR configuration

For example if I want to create a bridge with my LiveBox 5 (Orange) which uses the French DFS channels it does not work
I have three tries and time out

[  562.465351] wlan1: authenticate with f8:08:4f:eb:95:xx
[  562.481267] wlan1: send auth to f8:08:4f:eb:95:xx (try 1/3)
[  564.003627] wlan1: send auth to f8:08:4f:eb:95:xx (try 2/3)
[  565.051575] wlan1: send auth to f8:08:4f:eb:95:xx (try 3/3)
[  566.036233] wlan1: authentication with f8:08:4f:eb:95:xx timed out
[  569.004898] wlan1: authenticate with f8:08:4f:eb:95:xx
[  569.020599] wlan1: send auth to f8:08:4f:eb:95:xx (try 1/3)
[  570.002198] wlan1: send auth to f8:08:4f:eb:95:4f (try 2/3)
[  571.041600] wlan1: send auth to f8:08:4f:eb:95:xx (try 3/3)
[  572.036277] wlan1: authentication with f8:08:4f:eb:95:xx timed out
[  575.404863] wlan1: authenticate with f8:08:4f:eb:95:xx
[  575.420530] wlan1: send auth to f8:08:4f:eb:95:xx (try 1/3)
[  575.986244] wlan1: send auth to f8:08:4f:eb:95:xx (try 2/3)
[  577.076330] wlan1: send auth to f8:08:4f:eb:95:xx (try 3/3)
[  578.056645] wlan1: authentication with f8:08:4f:eb:95:xx timed out


I have not found a solution for the moment except to program in default mode for the country

It's OpenWrt because with another Tenbay AX1800K router it's the same

if I have time I will try the patch

Hi again,

I've created the pull request (https://github.com/openwrt/openwrt/pull/4582), now i'll get to work on the patch in: https://github.com/openwrt/mt76.
The pain in the back is that changing the mt76 requires: Fork, branch, commit, push and pull request (all pretty standard here) AND needs to be referenced in the openwrt (this is referred as "updating mt76" in openwrt's commit)

I'll keep this post updated :slight_smile:

UPDATE:

I've also applied the 160 mhz patch to the MT76 and created a pull request, is smth at least :slight_smile: here's the request: https://github.com/openwrt/mt76/pull/587

I modified the init.c and the 3 * time out problem disappeared with the router Tenday AX1800K

not tested with the CUDY X6 ...

1 Like

Small update, i closed the MT76 pull request, the problem is not solved for the CudyX6, still can't get the 5ghz up with 160mhz

Good morning,
I kindly ask where I can find the complete openwrt file with all services for the cudy x1800, as I am interested in entering the DDNS and possibly the vnp
Thank you

Hi :),
pls refer to this: https://github.com/openwrt/openwrt/pull/4582