ice32
183
Hi @pyckle
ok i looked at,
https://github.com/pyckle/openwrt/commit/3a28fe20b26033263ca185c6eda9583a0266ab68
will then have to set up my router again because of dsa.
very nice, keep it up.
(Compiling takes about 2 hours.)
pyckle
184
ice32
185
Hi @pyckle,
Kernel 5.4
Network is DSA
Leds and Ports are correct
root@OpenWrt:~# ifconfig | grep 'lan'
br-lan Link encap:Ethernet HWaddr BX:4B:D6:23:5A:40
lan1 Link encap:Ethernet HWaddr BX:4B:D6:23:5A:40
lan2 Link encap:Ethernet HWaddr BX:4B:D6:23:5A:40
lan3 Link encap:Ethernet HWaddr BX:4B:D6:23:5A:40
lan4 Link encap:Ethernet HWaddr BX:4B:D6:23:5A:40
wlan0 Link encap:Ethernet HWaddr BX:4B:D6:23:5A:40
wlan1 5G Link encap:Ethernet HWaddr BX:4B:D6:23:5A:42
wan = BX:4B:D6:23:5A:40
all beautiful. 
However, I am not satisfied with the wifi performance, but that was already the case before.
especially 5G in terms of range and speed.
Edit: I have not tested WPS, so people please test.
ice32
187
hello @pyckle,
i installed openwrt from cudy again
and saw that wlan0 so 2.4G is not equal to lan or wan HWaddr,
but rather lan+1, because the HWaddr of 2.4G and 5G are very different from lan and wan HWaddr in the cudy original openwrt firmware.
My suggestion would be,
2g *:f0 label + 1
5g *:f2 label + 2
your opinion would be very helpful for me
pyckle
188
Hi @ice32. Thank you for looking into this. I have the mac addresses set based on the files that cudy provided to developers for openwrt. It has the mac address for the 2.4 GHz WiFi identical to that of the lan. I was unaware that what I did was different as I didn't test this myself - @fermat2a did the testing here.
If the provided openwrt sets label for lan/wan, label+1 for 2.4 GHz radio and label +2 for 5 GHz this is a trivial change. However, I am concerned that the factory firmware wireless mac address assignment is different than their provided OpenWRT image.
I would think that it is more correct to make the mac addresses match the original firmware than Cudy's provided OpenWRT build based on: https://openwrt.org/docs/guide-developer/mac.address
Perhaps a maintainer can comment here?
Dear Forum
,
I have the stock Cudy OpenWRT image installed on my Cudy WR1300.
How is the custom OpenWRT ROM by pyckle installed, may I ask?
There are two files:
(1) openwrt-ramips-mt7621-cudy_wr1300-initramfs-kernel.bin
(2) openwrt-ramips-mt7621-cudy_wr1300-squashfs-sysupgrade.bin
Excuse me if this is a noob question... 
It is still the same way gbellifemine described here in September 2020:
- Download Cudy's custom 19.07 build .
- Find the firmware update section in the Cudy' firmware, flash Cudy's custom openwrt build.
- Go to the Flash Firmware section and flash your sysupgrade file. Be sure to uncheck "Keep settings and retain the current configuration".
- At the end you'll have your openwrt installed..
So, the only thing left is taking the file (2) and flash it. 
As you say you are new to openwrt: IIRC the sysupgrade fille provided by pyckle that I tested was coming without LUCI (Web GUI). Please be aware of this before installing.
1 Like
ice32
191
hi @pyckle,
one thing is fact the MAC for LAN is identical with the sticker on the device.
Each radio has its own MAC, so should be
wifi 2.4 and wifi 5G should have their own MAC.
device mt76x3e mac xxx ?
device mt76x2e mac xxx ?
Finding this is our task.
It would have been nice if Cudy had given a correct DTS to the developers.
Furthermore, I always prefer an unequal MAC for LAN
to WAN, because of the overview.
Unfortunately I have only one router, so I always have to change the firmware to do some research...
at least a lot has been achieved here through their work. 
Hi @pyckle,
for the wireless ports I did not find the the HW Adresses in the original firmware GUI. Therefore I installed an DHPC server on an access point I build up and connected the Cudy to it. There I saw the same HW Adress. But maybe I screwed up something in that test... It sounded resonable after also checking against cudy openwrt. 
Dear fermat2a,
Thank you for being so kind as to help.
How is the LUCI web interface installed after files (1) & (2) are installed?
I assume it's a command line installation.
Would you have the commands?
pyckle
194
Hey,
The DHCP server will have the LAN MAC, not the WiFi MAC addres. The WiFi MAC can be found by scanning for wifi networks and looking for the BSSID. Because the wifi adapter doesn't have an IP address (at least not in most setups), you won't see it associated with an IP address.
I reflashed the factory firmware. I can confirm that the behavior is as follows on factory:
LAN: Label
WAN: Label + 1
WIFI 2.4 GHz: Label
WIFI 5 GHz: Label + 2
This can be trivially verified by going to the ping diagnostic tool, and entering in
1.1.1.1 ; ifconfig
in place of the ip (shell injection)
In the manufacturer's build of openwrt, the MAC addresses do not match this behavior. The WAN and LAN are both label, and wifi MAC addresses are 00:0C:43:26:60:90 and 00:0C:43:76:12:30.
I don't think it matters where these were from though. It is clear we should match the factory firmware's behavior here and Cudy has a bug in their OpenWRT build.
My suspicion is that either these are hard coded for all of the routers or randomly generated. I would appreciate (for curiosities sake) if anybody could confirm whether their wifi mac addresses match these or are different.
I made a mistake - I looked at the mac address assignment in a previous person's patch for 19.07, not what the manufacturer provided.
In any event, I have patched my pull request, and I will post a new build in a bit.
@ice32 - thank you for the testing, and pointing out this bug.
ice32
195
hello @pyckle
i was also looking and lo and behold, there they are.
LAN MAC is here,
hexdump -C /dev/mtd5 offset 0000de00
WAN is LAN+1
2.4G MAC and 5G MAC
[openwrt ~]# hexdump -s 4 -C /dev/mtd2 |grep "00 0c 43"
00000004 00 0c 43 26 60 90 = 2.4 G
00008004 00 0c 43 76 12 c8 = 5G
i hope you will be ok... 
Edit: cat /proc/mtd
ice32
196
@pyckle and one more info,
kern.info kernel: [ 2.494577] spi-mt7621 1e000b00.spi: sys_freq: 50000000
kern.info kernel: [ 2.500809] m25p80 spi32766.0: using chunked io (size=32)
kern.info kernel: [ 2.506248] m25p80 spi32766.0: w25q128 (16384 Kbytes)
you can use opkg to do so: https://openwrt.org/docs/guide-user/additional-software/opkg
I have following packages installed:
- luci
- luci-app-firewall
- luci-app-opkg
- luci-base
- luci-lib-base
- luci-lib-ip
- luci-lib-jsonc
- luci-lib-nixio
- luci-mod-admin-full
- luci-mod-network
- luci-mod-status
- luci-mod-system
- luci-proto-ipv6
- luci-proto-ppp
- luci-ssl
- luci-theme-bootstrap
Installing packages this way takes more storage then bringing them direktly into the image. Therefore I build my own image.
pyckle
198
I believe that is the default place where the WiFi drivers look for the MAC address.
I'm not sure what you are suggesting with the SPI flash - do you think it should be clocked lower? It has been stable for me (and as far as I know everybody else) with 80 MHz and fast read in the DTS.
The new build is here: https://mrpickles.fr.to/946563faeb68850ccdf07cfe5eb2e78600620bed672754e7c0e496b18006c18c/
The MAC addresses should now be correct.
1 Like
ice32
199
hi @pyckle,
all good,
cudy says 50 MHz, well 80MHz is good, I would go to 100. at least cudy has at wr1000
100MHz in the DTS.
so it's late in Germany, will test the new sysupgrade tomorrow.
good night
ice32
200
hi @pyckle,
have made sysupgrade via luci.
Runs well so far, luci is with it 192.168.1.1
Use openwrt already since version 7.09 and must
now first with the network special DSA deal with.
First I will set up extroot or block-mount, so I have enough space for adblock.
the mac addresses for wifi I will adjust with
option macaddr '00:0c:43:26:60:90' for 2g and
option macaddr '00:0c:43:76:12:c8' for 5g in
/etc/config/wireless
these are the original mac's for wlan
because it can't be that lan and wlan have the same mac.
Thanks and more later.
Dear @fermat2a,
Would you consider, if you have the time, posting your latest build image you mentioned above with WiFi enabled?
Hello, I tested this latest image, the only issue is when I want to run the wifi at the same time as an client and master mode. It works fine as client, but the Master mode does not show up.
The other interface works fine MediaTek MT7603E 802.11bgn, when the client and master mode are used at the same time.