Support for Cudy WR3000

further OEM firmware investigation got me this line blocking dropbear

/etc/init.d/dropbear
[ -f /etc/rom_release -a x"$(bdinfo factory)" != x1 ] && return

removing it was faster than puzzling this code :slight_smile:

then to make it survive sysupgrade
echo "/etc/init.d/dropbear" >> /etc/sysupgrade.conf

I've done it by booting initramfs-kernel in safemode and mount root but there might be other solution like sysupgrade edit .

2 Likes

So OpenWrt is ready and tested
Flashing now only work from TTL / uboot TFTP initramfs.bin route or via ssh (If you enable it already) with mtd -r write sysupgrade.bin firmware

2 notes here:

WiFi work only with [RFC] add support for MT7981 by dangowrt Β· Pull Request #771 Β· openwrt/mt76 (github.com) mt76 version.

Flashing might be possible from OEM if any willing dev help me to puzzle it out

OEM

root@WR3000:~# cat /tmp/sysupgrade.meta
{  "metadata_version": "1.1", "compat_version": "1.0",   "supported_devices":["R31"], "version": { "dist": "OpenWrt", "version": "21.02-SNAPSHOT", "revision": "1.15.6", "target": "mediatek/mt7981", "board": "R31" } }

OpenWrt vanilla

root@WR3000:~# cat /tmp/sysupgrade.meta
{  "metadata_version": "1.1", "compat_version": "1.0",   "supported_devices":["cudy,wr3000"], "version": { "dist": "OpenWrt", "version": "SNAPSHOT", "revision": "unknown", "target": "mediatek/filogic", "board": "cudy_wr3000" } }

Image check failed

root@WR3000:~# sysupgrade -T /tmp/openwrt-mediatek-filogic-cudy_wr3000-squashfs-sysupgrade.bin
Thu Apr 20 17:12:50 CEST 2023 upgrade: Device R31 not supported by this image
Thu Apr 20 17:12:50 CEST 2023 upgrade: Supported devices: cudy,wr3000
Segmentation fault (core dumped)
Image check failed.

forcing flash with sysuprgrade -F result router not boot installed firmware
edit:
tags "supported_devices":["R31"] and "board": "R31" are now set correctly and sysupgrade fails anyway as well as GUI upgrade

2 Likes

Well, what is the serial output of it failing to boot? :slight_smile:

supported_devices is the way to go to silence that warning, good that you found that already.

That only thing now shows .

Segmentation fault (core dumped)
Image check failed. 

last one is standard from sysupgrad ofc .I've looked in OEM \lib\upgrade but unable to figure it out

which openwrt version is cudy's rom based on? do you maybe need to add a UIMAGE_NAME line like other cudy's have? (just a guess why a check might fail)
Is there no other error output if you run logread afterwards? :slight_smile:

Maybe you need to actually reverse engineer the differences to the image(s) that they provide.
compare both images using binwalker

maybe the image needs a jcg header like the wr1000 does?
Or they forgot to lock the bootloader and they still expect images to be rsa signed or whatever it is they did with earlier devices that made their signed openwrt fork necessary as a prestep for installing actual openwrt.
No clue, honestly. Can you share /lib/upgrade somehow maybe?

Just extract fw in 7zip

*now latest is 1.15.6

edit:
so I've hit the bug with the
BOARD_NAME := R31
SUPPORTED_DEVICES := R31

Image check failed:

Sun Apr 23 17:30:30 UTC 2023 upgrade: Device cudy,wr3000 not supported by this image Sun Apr 23 17:30:30 UTC 2023 upgrade: Supported devices: R31 Image check failed.

In console

root@OpenWrt:~# sysupgrade -T /tmp/openwrt-mediatek-filogic-cudy_wr3000-squashfs-sysupgrade.bin
Sun Apr 23 17:34:26 UTC 2023 upgrade: Device cudy,wr3000 not supported by this image
Sun Apr 23 17:34:26 UTC 2023 upgrade: Supported devices: R31
root@OpenWrt:~# cat /tmp/sysupgrade.meta
{  "metadata_version": "1.1", "compat_version": "1.0",   "supported_devices":["R31"], "version": { "dist": "OpenWrt", "version": "SNAPSHOT", "revision": "unknown", "target": "mediatek/filogic", "board": "R31" } }

using same as currenty installed sysupgrade

This can be dangerous but did you try forcing sysupgrade using the -F or --force flag?
Do not check keep settings while using this flag.

That was already fixed by setting .And Yes you can save settings while -F in my case.

SUPPORTED_DEVICES += R31

So now tere are two supported devices "cudy,wr3000" and "R31"
For now I'm running my build as production device and most of my troubles come from not reliable bridger that hangs and doesn't catch traffic.
But You can always skip this by disabling WED until it get fix

Excellent news if I understand correctly. It is now possible to flash from upgrade page, correct?
If so, and if you need a tester, please share the build.

not yet As I'm too weak to understand the code behind sysupgrade verification. For now only method is to use TTL

Could you share the images needed for TTL, please?

//EDIT: Tried to compile for myself but can't load via tftp. Router:

*** Loading image ***

Input load address: 0x46000000

Available load methods:
    0 - TFTP client (Default)
    1 - Xmodem
    2 - Ymodem
    3 - Kermit
    4 - S-Record
    5 - RAM

Select (enter for default): 

Input U-Boot's IP address: 192.168.178.2
Input TFTP server's IP address: 192.168.178.35
Input IP netmask: 255.255.255.0
Input file name: 4.bin

Using ethernet@15100000 device
TFTP from server 192.168.178.35; our IP address is 192.168.178.2
Filename '4.bin'.
Load address: 0x46000000
Loading: T T T T T T T T T T 
Retry count exceeded; starting again

*** TFTP client failure: -64 ***
*** Operation Aborted! ***

Server:

atftpd[651426]: Serving 4.bin to 192.168.178.2:2570
atftpd[651426]: window block 0 not complete/ordered: 0/1 valid, delay: 0 usec
atftpd[651426]: window block 0 not complete/ordered: 0/1 valid, delay: 9 usec
...
atftpd[651426]: window block 0 not complete/ordered: 0/1 valid, delay: 72 usec
atftpd[651426]: window block 0 not complete/ordered: 0/1 valid, delay: 81 usec
atftpd[651426]: timeout block 0: retrying ...
atftpd[651426]: timeout block 0: retrying ...
atftpd[651426]: timeout block 0: retrying ...
atftpd[651426]: timeout block 0: retrying ...
atftpd[651426]: timeout block 0: retrying ...

What am I doing wrong?

//EDITΒ²: Was able to upload via YMODEM but didn't even get LAN to work, so waiting for your image. :slight_smile:

don't know if You're using linux on your desktop but here I've used tftpd32 (x64) under windows no problem . Seems there some issue with atftpd server or firewall
but You've asked for images
https://drive.google.com/drive/folders/1tw_IeL5VhWYpEs3OGVxslCrsplQneUNA

1 Like

Thanks a lot but your config.buildinfo would be helpful, too. :slight_smile:

//EDIT: Finally managed to compile a working image, so here are my steps:

  1. git clone https://github.com/nicefile/openwrt-vector.git && cd openwrt-vector && git checkout wr3000
  2. ./scripts/feeds update -a && ./scripts/feeds install -a
  3. Apply this patch: https://pastebin.com/KdbiCVwk
  4. Delete package/kernel/mt76/patches/100-api_update.patch and package/kernel/mt76/patches/110-wifi-mt76-ignore-key-disable-commands.patch.
  5. Apply this config file: https://pastebin.com/FSh4jQhZ
  6. make -j$(nproc) defconfig download clean world

can somebody plz do an energy-consumption test ?

:checkered_flag: support was added to OpenWrt snapshot in commit:
c9cb6411c1a70516d5922e88c45b338de041baba
Now day or two and it will be available in firmware selector. For now without wireless offloading firmware.

1 Like

Hopefully Cudy will provide a image for disabling their signature-protection soon.

Have they done this before?

I know it sound bad to use serial console adapter but in fact is quite easy. Also You might get yourself ssh access for OEM that way and recover from bad flash or broken firmware. At least Cudy WR3000 is easy to open in compare to some.
@shdf
Yes . Few other Cudy router have their OpenWrt fork without signature check available for download

1 Like

there is a new firmware posted today : http://www.cudytech.com/wr3000_software_download

Looks like it's at the firmware selector now. Thanks a lot for all your work. :slight_smile:

Here's my package list for the firmware selector:

base-files busybox ca-bundle dnsmasq dropbear firewall4 fstools kmod-crypto-hw-safexcel kmod-gpio-button-hotplug kmod-leds-gpio kmod-mt7915e kmod-mt7981-firmware kmod-nft-offload libc libgcc libustream-mbedtls logd mtd netifd nftables odhcp6c odhcpd-ipv6only opkg ppp ppp-mod-pppoe procd procd-seccomp procd-ujail uboot-envtools uci uclient-fetch urandom-seed urngd arp-scan htop nano-full luci luci-app-dawn luci-theme-material openssh-sftp-server wpad-mbedtls mt7981-wo-firmware

It's just the default with wpad-basic-mbedtls removed and arp-scan htop nano-full luci luci-app-dawn luci-theme-material openssh-sftp-server wpad-mbedtls mt7981-wo-firmware added, which I think is a nicer default (having full wpad, luci and some useful tools).

2 Likes