OpenWrt Forum Archive

Topic: DIR-825 problems.. (WIFI devices do not work.)

The content of this topic has been archived on 31 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'll try to keep this short while still sharing enough information that hopefully one of you openwrt experts will be able to help.

The basics:
- Router: DLink DIR-825 Rev. B1
-- Was running DLink firmware 2.02NA
- OpenWRT from: http://downloads.openwrt.org/snapshots/trunk/ar71xx/
- Firmware file: openwrt-ar71xx-dir-825-b1-squashfs-backup-loader.bin (as recent as the Jan 2, 2010 build)

The process (in general)
- Installed openwrt (based on: http://fetzig.org/2009/12/24/openwrt-on … -dir-825/)
- was able to get everything up and running, including wireless
- Decided to try dd-wrt.  Downloaded and installed from:http://www.dd-wrt.com/site/support/other-downloads?path=others%2Feko%2FBrainSlayer-V24-preSP2%2F12-28-09-r13525%2Fdlink-dir825-revb%2F
- Configured and tested.  Everything working well.
- I unplugged and moved the device from my work area to my network area.  Plugged unit back in and couldn't get an address from DHCP and wireless radios were not broadcasting.
- The next two days were spent resetting, installing different firmware and overall getting very frustrated.

Current status:
- openwrt installed and functioning, EXCEPT the wireless.
- interesting fact is that the /sys/class/ieee80211/phy0 and /sys/class/ieee80211/phy1 folders are not there.
- the /etc/config/wireless in completely unpopulated.
-- I have populated it, but still no wireless and I get the following:

root@OpenWrt:/sys/class/ieee80211# wifi
PHY for wifi device radio0 not found
PHY for wifi device radio1 not found


I'm open trying just about anything at this point.  Any and all ideas (other than the throw it out the window one) will be greatly appreciated.  I want to thank Mactalla from the DLink forum for all of his time and effort as well as his recommendation I post here.

I have additional details including logs if anyone needs more information.

Thank you,
Marc

Have you tried flashing back to original dlink firmware?

oleg106 wrote:

Have you tried flashing back to original dlink firmware?

I did that a couple of time yesterday and while the firmware installs and boots fine, the radios are still not broadcasting.  I feel like there is something stuck in some portion of memory that I can't get cleared out, even by flashing the firmware.  I can't figure it out though.

Marc

BTW: If I install the dd-wrt firmware again, I'm at the same place I was when the problems all began.
- dd-wrt installed
- no client can get an ip from dhcp
- cannot access web interface or telnet, even when client is assigned a static ip.

ARGH!!!!!!

Bootlog?

Is in flash @ 0xbf661000 and 0xbf665000 magic number 0xA55A? If not, this can be problem caused by DDWrt.

I've been trying to help out waffull with this, but so far not much success.  Helping him debug things, I've just discovered that his wireless card is being reported as 168c:ff1d (rev 01), which is what ValXdater was getting initially but eventually fixed it.  (https://forum.openwrt.org/viewtopic.php … 695#p92695)

@ValXdater: you mention doing a PCI init workaround to get the correct ID.  Can this be done manually for him to try?  You also ask about magic numbers in flash at particular addresses, but I don't know how to fetch them.  Is there a command to to dump the flash and inspect the addresses?

Cheers.

mactalla wrote:

@ValXdater: you mention doing a PCI init workaround to get the correct ID.  Can this be done manually for him to try?  You also ask about magic numbers in flash at particular addresses, but I don't know how to fetch them.  Is there a command to to dump the flash and inspect the addresses?

in openwrt from caldata mtd partition:

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00040000 00010000 "uboot"
mtd1: 00010000 00010000 "config"
mtd2: 00100000 00010000 "kernel"
mtd3: 00510000 00010000 "rootfs"
mtd4: 00370000 00010000 "rootfs_data"
mtd5: 00010000 00010000 "caldata"
mtd6: 00610000 00010000 "firmware"

caldata is mtd5:

root@OpenWrt:/# hexdump /dev/mtd5ro -x | grep ^0001000
0001000    a55a    0000    0003    6000    168c    0029    6008    0001
root@OpenWrt:/# hexdump /dev/mtd5ro -x | grep ^0005000
0005000    a55a    0000    0003    6000    168c    0029    6008    0001
root@OpenWrt:/#

magic 0xa55a in second column

Here is the output from commands above:

root@OpenWrt:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00040000 00010000 "uboot"
mtd1: 00010000 00010000 "config"
mtd2: 00100000 00010000 "kernel"
mtd3: 00510000 00010000 "rootfs"
mtd4: 003e0000 00010000 "rootfs_data"
mtd5: 00010000 00010000 "caldata"
mtd6: 00610000 00010000 "firmware"

No output from the following:

root@OpenWrt:/# hexdump /dev/mtd5ro -x | grep ^0001000
root@OpenWrt:/# hexdump /dev/mtd5ro -x | grep ^0005000

and if it helps:

root@OpenWrt:/# hexdump /dev/mtd5ro -x
0000000    1985    2003    0000    000c    f060    dc98    ffff    ffff
0000010    ffff    ffff    ffff    ffff    ffff    ffff    ffff    ffff
*
0010000



I've flashed with the newest openwrt build from 1-8-2010 (Kamikaze (r19060).) But no changes....


Let me know if there is any additional information I could provide to help out.

I appreciate all of your help..

Marc

Just wanted to add is that I have the the EXACT same symptoms as the OP. Also with a DIR-825 B1 NA

DD-WRT worked fine for a day, I rebooted can't access WiFi or LAN no matter what I do (30/30/30 trick, reflash DD-WRT, etc..). I'm able to get LAN working by restoring stock or OpenWRT, but WiFi is non existent, with same command line output for various commands that the OP has run.  Also my wireless config was also empty, in summary every little detail the OP has experienced, I have too.

So if his problem gets solved, I'm guessing mine will too.

(Last edited by TalynOne on 10 Jan 2010, 01:36)

waffull wrote:

root@OpenWrt:/# hexdump /dev/mtd5ro -x | grep ^0001000
root@OpenWrt:/# hexdump /dev/mtd5ro -x | grep ^0005000

and if it helps:

root@OpenWrt:/# hexdump /dev/mtd5ro -x
0000000    1985    2003    0000    000c    f060    dc98    ffff    ffff
0000010    ffff    ffff    ffff    ffff    ffff    ffff    ffff    ffff
*
0010000

yes, broken calibration data, 0x1985 is JFFS2 magic (ddwrt bug?)

i can do backup of my calibration data (next week)...

Can we read/write the mtd data directly?  If it's just a matter of

dd if=/dev/mtd5ro of=/tmp/mtd5.dump
dd if=/tmp/mtd5.dump of=/dev/mtd5

then I can give them my caldata to use.  Is the caldata identical for all 825 routers, or does it contain things like the mac addresses that should be massaged when they load it?

Hi guys!

I really appreciate your work on this, as I had the exact same problem with this router.  I replaced it already though, now I have a new one.

Sorry for the dumb question, but is it safe to say that dd-wrt caused this problem, but OpenWRT will not cause this problem?

I just want know if it's safe to install OpenWRT, and if I'll be able to go back to stock firmware after that. 

My experience was much the same, I only lost wireless forever after installing dd-wrt and setting up some of the advanced settings, like jffs, samba/cifs, USB support, etc.

Thanks!

(Last edited by Hellbore on 10 Jan 2010, 08:33)

mactalla wrote:

Can we read/write the mtd data directly?  If it's just a matter of

dd if=/dev/mtd5ro of=/tmp/mtd5.dump
dd if=/tmp/mtd5.dump of=/dev/mtd5

then I can give them my caldata to use.  Is the caldata identical for all 825 routers, or does it contain things like the mac addresses that should be massaged when they load it?

calibration data is maybe same (part of caldata partition), min. mac address in caldata partition is different (you can find in plain text @ offset 0xffa0 and 0xffb4

is possibly necessary "unlock" caldata partition for rw (in this file):
dir825b1_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata)ro,1600k(unknown)ro,6208k@0x50000(firmware)
to
dir825b1_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata),1600k(unknown)ro,6208k@0x50000(firmware)

i recommend to use mtd utility

Hellbore wrote:

Sorry for the dumb question, but is it safe to say that dd-wrt caused this problem, but OpenWRT will not cause this problem?

I just want know if it's safe to install OpenWRT, and if I'll be able to go back to stock firmware after that.

yes, for me it works fine: orig <-> openwrt

(Last edited by ValXdater on 10 Jan 2010, 16:22)

ValXdater wrote:

is possibly necessary "unlock" caldata partition for rw (in this file):
dir825b1_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata)ro,1600k(unknown)ro,6208k@0x50000(firmware)
to
dir825b1_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata),1600k(unknown)ro,6208k@0x50000(firmware)

i recommend to use mtd utility

Thanks for your help, ValXdater.  Looking at that link, it appears this is hardcoded in the kernel build.  Is that correct?  In order to gain access, we must rebuild the firmware & flash with that one?  Can we not somehow pass this as a boot option?

mactalla wrote:

Thanks for your help, ValXdater.  Looking at that link, it appears this is hardcoded in the kernel build.  Is that correct?  In order to gain access, we must rebuild the firmware & flash with that one?  Can we not somehow pass this as a boot option?

you need change this line in Makefile and rebuild image

(Last edited by ValXdater on 11 Jan 2010, 06:06)

I've setup a build environment and am building an image for him.  Turned out to be much simpler than I expected.  Kudos to you and the rest of the OpenWrt team!

Any progress on this, is there anything I can test or provide to help?

TalynOne wrote:

Any progress on this, is there anything I can test or provide to help?

can you execute this commands?

TalynOne wrote:

Any progress on this, is there anything I can test or provide to help?

Waffull was away for a couple days.  I expect he'll have time later tonight to run the most recent (and final?) test.  If it's successful I'll write up step-by-step instructions here.

Thanks to Mactalla and ValXdater, I can once again see the wireless radios and the proper id is showing for them.

I'm going to let Mactalla put together the instructions (unless you would like me to Mactalla?) so that you get the exact details correct.  I've uploaded the modified firmware image that Mactalla created to make it easy for everyone to get.  I gave him a link to it, so he'll include that in the directions.

I really want to thank Mactalla and ValXdater for their help.  You are both a huge asset to this forum and this project, from all of us, THANK YOU!

eeprom data is not same for all devices, but you can use this steps for dir825b1:
1. flash this firmware
2. telnet 192.168.1.1 & cd /tmp
3. download this files: part_01 part_02 part_03 from http://download.openwrt.net/ar71xx/tmp/caldata/
4. echo -n "XX:XX:XX:XX:XX:XX" > mac1 (router mac minus 1)
5. echo -n "XX:XX:XX:XX:XX:XX" > mac2 (router mac)
6. cat part_01 mac1 part_02 mac2 part_03 > caldata
7. ls -l caldata <- check caldata length (65536 bytes)
8. mtd unlock caldata
9. mtd -e caldata write caldata caldata
10. reboot

(Last edited by ValXdater on 15 Jan 2010, 10:38)

Thanks, ValXdater!

No point posting my instructions as it does the same job.  Just to expand a little on the above instructions:

* These instructions are for you if the commands

hexdump /dev/mtd5ro -x | grep ^0001000
hexdump /dev/mtd5ro -x | grep ^0005000

either do not produce any output, or the output they produce does not contain 'a55a' as the second number.
Example of good output:

0001000    a55a    0000    0003    6000    168c    0029    6008    0001

* Your MAC for step 5 is printed on your box.  Use this address to calculate the MAC for step 4.

* After doing this fix and rebooting / confirming the radios are working, I recommend flashing with a standard firmware to ensure this storage area remains readonly.

THANK YOU GUYS so much for doing this!

Now I am not afraid to try OpenWRT and dd-wrt again!


Now a question, if you don't mind...  In these instructions, you created a file "caldata" and then wrote that to the caldata area of the flash, right?  Well, if I have a working dir-825 where the caldata is already good, what command would I need to execute in order to create a backup of my existing calibration data, in case dd-wrt breaks it? 

Just wondering how I could create a backup of my existing caldata if it is not yet broken, in case I need it later (in case I try dd-wrt again).

Hello

Thanks for this solution.

I was able to rescue my DIR after using DD-WRT with 'clear jffs' or something (maybe that was the cause ?). I used files from ValXdater and now from EU I have NA router (at least dmesg is saying that wink)

anyone has cdata for EU ? wink

BTW: There is one strange thing about MAC handling in openwrt. MAC on my DIR box is ending with _:58 and dd-wrt (original dlink firmware as well) is assigning that mac to WAN port. What is strange with openwrt is that _:59 is assigned to LAN, _:5a is assigned to WAN (I noticed it just because my ISP is filtering MAC adresses).

The discussion might have continued from here.