Topic: problem with ath9k eeprom on WRT160NL

kodex83 wrote:

I have build a version with Revision 18418.
It seams that all works fine ... WIFI with b and g works perfect ... n isn't tested.

I have upload my build on rapidshare.
Have fun

http://rapidshare.com/files/306958322/openwrt-ar71xx-wrt160nl-squashfs.bin

I used this firmware and it seems everything works fine. But my build doesn't work. Can it be because of other revision (18843) or my misconfiguring? I used some variants of config, eg. default for ar71/wrt160nl, but with normal boot no network is up, with failsafe - 192.168.1.1, I can telnet, launch firstboot, reboot does nothing, off/on - all the same, no network. And after some time working device hangs.
Can you publish somewhere you config for 18418?

All these experimenting with flashes did something wrong with wifi part:
ath9k ath9k: failed to initialize device
ath9k: probe of ath9k failed with error -22
AFAIK, it means "EEPROM checksum error". On this topic I found this page http://www.mobilnews.cz/blog/?p=36
I want try to fix this error, but I need proper data to write. I have another same WRT160NL with original firmware, how can I read EEPROM? I am not sure that my firmware wouldn't brake 2nd router, but original or your version doesn't have needed programs to read/write EEPROM. Also, will EEPROM from one copy of router will suit to another copy?

Now in EEPROM all 0xFFFF

/dev/mtd5 (art) and EEPROM is the same?
Can anybody post/send me the "hexdump -C /dev/mtd5" output?

2 (edited by solca 2009-12-24 16:45:03)

Re: problem with ath9k eeprom on WRT160NL

ForeverYoung,

You're lucky, I used to had the same problem, for some reason when I update from original Linksys firmware v1.00.01.15 to v1.00.01.17 both nvram and art flash partitions where erased and then just contain 0xFF values. Flash partition "art" contains the Atheros wireless EEPROM settings so if you corrupted your WRT160NL maybe this can help you:

1. Dump from a good WRT160NL with something like this:

NVRAM:
dd bs=64k if=/dev/mtdblock3 of=/tmp/nvram.bin
ART:
dd bs=64k if=/dev/mtdblock4 of=/tmp/art.bin

2. Transfer those files to your host, I used netcat:

On WRT160NL: nc -c -l -p 1234 </tmp/nvram.bin
On host: nc 192.168.1.1 1234 >nvram.bin
(Repeat for art.bin file)

3. Build a new OpenWRT firmware with this patch applied and don't forget to select the 'mtd' _and_ 'nvram' tools:

cd <trunk>
wget "http://home.galileo.edu/~solca/openwrt/wrt160nl-forfixeeprom.patch" -O- | patch -p0

4. Transfer the nvram.bin and art.bin files to flash:

On WRT160NL: nc -l -p 1234 | mtd write - nvram
On host: nc -q0 192.168.1.1 1234 <nvram.bin

On WRT160NL: nc -l -p 1234 | mtd write - art
On host: nc -q0 192.168.1.1 1234 <art.bin

5. Fix your NVRAM settings with the usual nvram tool:

You can check your original lan_hwaddr MAC address in your device's case, wan is lan + 1 and wl0 is lan + 2.

nvram set lan_hwaddr=xx:xx:xx:xx:xx:xx
nvram set wan_hwaddr=xx:xx:xx:xx:xx:xx
nvram set wl0_hwaddr=xx:xx:xx:xx:xx:xx
nvram commit

6. Enjoy again your restored device!

NOTE: You will end up with both devices having the same wireless MAC address as that it is stored in the EEPROM area, you can change it as I did, but you need to deal with offsets and XOR checksums.

Edit: fix patch application.
Edit2: use -q0 arguments to netcat

Re: problem with ath9k eeprom on WRT160NL

Can I access a command line on good router (with original firmware)? I have a serial cable

4 (edited by ForeverYoung 2009-12-22 16:27:25)

Re: problem with ath9k eeprom on WRT160NL

And can you give me your art data?

Re: problem with ath9k eeprom on WRT160NL

ForeverYoung wrote:

Can I access a command line on good router (with original firmware)? I have a serial cable

I don't know if you can access the CLI from a router with original Linksys firmware but I would do it from a working WRT160NL _with_ OpenWRT.

ForeverYoung wrote:

And can you give me your art data?

Sure.

Re: problem with ath9k eeprom on WRT160NL

Thank you very much, I repaired my router smile

There is access to CLI in original firmware (thru serial cable)

Re: problem with ath9k eeprom on WRT160NL

ForeverYoung wrote:

Thank you very much, I repaired my router :)

There is access to CLI in original firmware (thru serial cable)

Great!

Now just to understand better this potential bug, do you clobber those partitions when upgrading to OpenWRT or (like me) when updating between original Linksys firmwares?

Re: problem with ath9k eeprom on WRT160NL

I don't know, first I flashed OpenWRT, after that - B17. I didn't chech the wifi, but I think problem was also in flashing B17 (updated original)