Alter0ne / rtl8196e

OpenWRT for Realtek rtl8196e with working packages and USB
GNU General Public License v2.0
38 stars 16 forks source link

Would it work on rtl8196eu ? #3

Open xromansx opened 4 years ago

xromansx commented 4 years ago

Hi, on what router did you use it ?

Alter0ne commented 4 years ago

Now I can't find solution for xz decompressor bug. It's need to fulfil latest mtd_utils or make possible compilation with old glibc 2.28.

xromansx commented 4 years ago

Hi, device can be recovered with any 3$ spi flasher from ebay or even arduino if you have one. I'll see if I can find the device. Where are you located ?

Alter0ne commented 4 years ago

@xromansx, the router is working. But I gave it to distant relatives who live in other town. Now I has other device. Debugging without rtl8196e device is very complicated.

xromansx commented 4 years ago

Sorry I was asking @chaolue, as I understood he has plenty of devices but I need also working one so I can see what's goin on.

chaolue commented 4 years ago

@xromansx I live in New Zealand so I guess I'm too far away to send. A local store has the Sengled Hubs on clearance .

I've got a SOP8 clamp on the way to flash chips.

xromansx commented 4 years ago

Recovered some of my old files can tell that openwrt will only boot on this bootloader : ---RealTek(RTL8196E)at 2014.10.24-17:33+0800 v1.2 16bit I took it from another device same version I found in totolink ex200 (I needed to flash bootloader with SPI programmer after I could boot OpenWRT) without alwais got an error.

xromansx commented 4 years ago

have this error during compilation: package/Makefile:170: recipe for target '/home/x/rtl8196e/staging_dir/target-mips-rlx4181-linux/stamp/.package_compile' failed make[1]: *** [/home/x/rtl8196e/staging_dir/target-mips-rlx4181-linux/stamp/.package_compile] Error 2 make[1]: Leaving directory '/home/x/rtl8196e'

RomSand commented 4 years ago

doe someone know how to extract bootloader from dump ?

chaolue commented 4 years ago

@xromansx I finding it a little hard to believe that this is a bootloader issue. Because with the current bootloader on my devices I have several firmware bins running fine, but I am unable to build one that boots from this repo. I was even able to build ggbruno's one (https://github.com/ggbruno/openwrt) based on OpenWRT master and it is booting fine. But it isn't much use without networking currently.

If it is a bootloader issue can you provide me with a link to a bootloader to try. I can program the flash directly now with SPI programmer. The current bootloader is: ---RealTek(RTL8196E)at 2015.01.06-18:13-0800 v1.6 [16bit](380MHz)

xromansx commented 4 years ago

I tried this repo and also openwrt rtk sources and non of them worked with stock bootloader can you please provide the bin that works not from "https://github.com/ggbruno/openwrt" bootloader that I use if from ex200 you can find it's dump here : https://forum.openwrt.org/t/fun-has-anyone-seen-where-ram-chip-locate/23069

chaolue commented 4 years ago

@xromansx here are the working firmwares with current bootloader: v0.2 - https://github.com/Alter0ne/rtl8196e/releases/download/v0.2-prealpha/openwrt-realtek-rtl8196e-AP-fw.bin RomSands above - https://drive.google.com/file/d/1Zw0_EYM0OESQ5U8Dn9gipWguV6Q_KMo5/view?usp=sharing AirShark bin (from a Russian forum I can't find link) AirShark.bin.zip

ggbruno only works with ramdisk, not squashfs

chaolue commented 4 years ago

Tried the bootloader provided and same results with v0.3 version:

---RealTek(RTL8196E)at 2014.10.24-17:33+0800 v1.2 [16bit](380MHz)
Jump to image start=0x80500000...

OpenWrt kernel loader for Realtek 819X
Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
Decompressing kernel... done!
Starting kernel at 80000000...

[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.10.49 (alter0ne@alter0ne-pc) (gcc version 4.6.4 (Realtek RSDK-4.6.4 Build 424) ) #2 Mon Jul 20 19:06:52 MSK 2020
[    0.000000] CPU revision is: 0000cd01
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x01ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x01ffffff]
[    0.000000] icache: 16kB/16B, dcache: 8kB/16B, scache: 0kB/0B
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line:  board=AP console=ttyS0,38400 linuxpart=0x10000
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Memory: 28616k/32768k available (2991k kernel code, 4152k reserved, 532k data, 188k init, 0k highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:128
[    0.000000] console [ttyS0] enabled
[    0.230000] Calibrating delay loop... 378.47 BogoMIPS (lpj=1892352)
[    0.290000] pid_max: default: 32768 minimum: 301
[    0.300000] Mount-cache hash table entries: 512
[    0.320000] Initializing cgroup subsys devices
[    0.330000] Initializing cgroup subsys net_cls
[    0.340000] Initializing cgroup subsys blkio
[    0.350000] Initializing cgroup subsys net_prio
[    0.390000] reg e0=0
[    0.430000] reg e1=0
[    0.470000] reg e2=0
[    0.510000] reg e3=0
[    0.550000] reg e4=0
[    0.580000] reg e5=0
[    0.620000] reg e6=0
[    0.660000] reg e7=0
[    0.700000] reg f0=0
[    0.740000] reg f1=0
[    0.770000] reg f2=0
[    0.810000] reg f3=0
[    0.850000] reg f4=0
[    0.890000] reg f5=0
[    0.930000] reg f6=0
[    0.940000] NET: Registered protocol family 16
[    1.090000] bio: create slab <bio-0> at 0
[    1.110000] SCSI subsystem initialized
[    1.130000] usbcore: registered new interface driver usbfs
[    1.150000] usbcore: registered new interface driver hub
[    1.160000] usbcore: registered new device driver usb
[    1.190000] NET: Registered protocol family 2
[    1.200000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[    1.210000] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[    1.220000] TCP: Hash tables configured (established 512 bind 512)
[    1.230000] TCP: reno registered
[    1.240000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    1.250000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    1.260000] NET: Registered protocol family 1
[    1.330000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.340000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    1.350000] msgmni has been set to 55
[    1.360000] io scheduler noop registered
[    1.370000] io scheduler deadline registered (default)
[    1.390000] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    1.400000] serial8250: ttyS0 at MMIO 0x18002000 (irq = 9) is a 16550A
[    1.440000] SPI INIT
[    1.450000]  ------------------------- Force into Single IO Mode ------------------------ 
[    1.460000] |No chipID  Sft chipSize blkSize secSize pageSize sdCk opCk      chipName    |
[    1.470000] | 0 c84017h  0h  800000h  10000h   1000h     100h   80    0           GD25Q64|
[    1.480000]  ---------------------------------------------------------------------------- 
[    1.490000] SPI flash(GD25Q64) was found at CS0, size 0x800000
[    1.510000] Creating 3 MTD partitions on "flash_bank_1":
[    1.520000] 0x000000000000-0x000000010000 : "boot"
[    1.540000] 0x000000010000-0x000000800000 : "linux"
[    1.560000] 0x00000012d000-0x000000800000 : "rootfs"
[    1.570000] mtd: device 2 (rootfs) set to be root filesystem
[    1.580000] mtd: partition "rootfs_data" created automatically, ofs=0x3f1000, len=0x40f000
[    1.590000] 0x0000003f1000-0x000000800000 : "rootfs_data"
[    1.600000] 
[    1.600000] Probing RTL819X NIC-kenel stack size order[1]...
[    2.280000] eth0 added. vid=9 Member port 0x10f...
[    2.300000] eth1 added. vid=8 Member port 0x10...
[    2.320000] [peth0] added, mapping to [eth1]...
[    2.330000] usbcore: registered new interface driver usb-storage
[    2.340000] -------8196D OTG init 
[    2.570000] dwc_otg: version 2.60a 22-NOV-2006
[    2.580000] DWC_otg: OTG Device not found ! Bad value for SNPSID: 0x00000000
[    2.590000] TCP: westwood registered
[    2.600000] NET: Registered protocol family 17
[    2.610000] Bridge firewalling registered
[    2.620000] 8021q: 802.1Q VLAN Support v1.8
[    2.650000] SQUASHFS error: Failed to initialise xz decompressor
[    2.660000] VFS: Cannot open root device "(null)" or unknown-block(31,2): error -5
[    2.670000] Please append a correct "root=" boot option; here are the available partitions:
[    2.680000] 1f00              64 mtdblock0  (driver?)
[    2.700000] 1f01            8128 mtdblock1  (driver?)
[    2.710000] 1f02            6988 mtdblock2  (driver?)
[    2.720000] 1f03            4156 mtdblock3  (driver?)
[    2.740000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
[    2.740000] System halted.

So, doesn't look to be bootloader related.

xromansx commented 4 years ago

Interesting that non of them worked for me with stock bootloader. Try this one: https://drive.google.com/file/d/1ckfOzJHTjE5RbHPQcNRKuLqTXYN_wT18/view?usp=sharing

chaolue commented 4 years ago

@xromansx yes that boots - https://drive.google.com/file/d/1ckfOzJHTjE5RbHPQcNRKuLqTXYN_wT18/view?usp=sharing.

Do you have any instructions that would help me build?

xromansx commented 4 years ago

Use realtek OpenWrt SDK I think it's 2.5 , if you'll have some time try it on your stock bootloader and see if it boots.

chaolue commented 4 years ago

Thanks @xromansx, building direct from Realtek 2.5 SDK creates a bootable firmware on original and EX200 bootloader on my devices. Grateful for the help you've given me.

xromansx commented 4 years ago

No problem, still suprized that you could boot on original bootloader do you know any way to back it up ?

MattWestb commented 3 years ago

@chaolue Did you getting it working with openWRT ??

I like trying tuya zigbee gateway with ethernet that is also having the RTL8196E. I dont need WiFI only the ethernet and tunneling one of the serial port to ZHA.

Thanks in advance !!

xromansx commented 3 years ago

Hi, if you have tuya can you do SPI backup.

MattWestb commented 3 years ago

I dont knowing the schematics but the PCB have SWO for the EFR32 module (zigbee) with test points that is good marked. Its also have one row for connections but without labels. Without looking so close I think the flash for the RTL is U3 but i cant read the model number on it on the photos.

Info FCC-ID

I have seen some other zigbee gw with RTL8196E is possible using http for configure telnet and getting root access but is not working in this implantation :-(

Edit: One more photo https://user-images.githubusercontent.com/28428427/100342416-3eee9380-2fde-11eb-9a99-ed7f608693a2.jpg

xromansx commented 3 years ago

Yes it seems to be U3 can you do backup of it ? I can check if it can boot on mine. do you hace SPI programmer ?

chaolue commented 3 years ago

@MattWestb yes I was able to get mine booting up OpenWRT from the Realtek SDK2.5, but not from this repo. Though, I didn't have any success with communicating with the Zigbee chip via serial, so gave up.

xromansx commented 3 years ago

I was looking for tuya firmware was thinking maybe to see what commands are used for zigbee to adapt it, but couldn't find one. So if somone has ot and can make SPI dump would be good. Thanks.

reivajpg commented 2 years ago

Hello, have you made it work on the CF-WR302S repeater?