OpenWrt Forum Archive

Topic: D-link DIR-505 support?

The content of this topic has been archived between 2 Apr 2018 and 5 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

gibz wrote:

At this point, I'm a bit stuck on how to flash the dir505 with openwrt. I can't do the serial port thing (i got a dongle specifically for this, and managed to burn/scrape the pads off, so that's totally out).

Without access to the serial port, I wouldn't risk flashing with OpenWrt. Unless there's a way to boot OpenWrt without flashing (load to ram), which is normally done from the boot loader interface (serial port), there's too much risk of bricking.

Get a new one, practice your soldering. Use hot glue to keep the wire from pulling the pads. smile

I used micro tweezer probes to hook up the contacts; better double isolate with tape the other side of pcb. It's unreliable, but if you don't move the whole it works wink

rAndy wrote:

I used micro tweezer probes to hook up the contacts; better double isolate with tape the other side of pcb. It's unreliable, but if you don't move the whole it works wink

I was trying something similar with a binder clip that got me output but no input, hence the soldering fiasco.

Based on what danz posted, you tftp boot the openwrt image and then write to mtd7.
Based on this: http://wiki.openwrt.org/doc/techref/flash.layout
mtd7 probably doesn't include u-boot. Which means that if I can get a copy of mtd and u-boot onto the 505 (horray usb!), I should be able to mtd write without the tftp boot.

Based on rAndy's dmesg (thanks for this)
[    3.040000] m25p80 spi0.0: found mx25l6405d, expected m25p80
[    3.040000] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    3.050000] 8 cmdlinepart partitions found on MTD device spi0.0
[    3.050000] Creating 8 MTD partitions on "spi0.0":
[    3.060000] 0x000000000000-0x000000010000 : "u-boot"
[    3.070000] 0x000000010000-0x000000020000 : "art"
[    3.070000] 0x000000020000-0x000000030000 : "mac"
[    3.080000] 0x000000030000-0x000000040000 : "nvram"
[    3.080000] 0x000000040000-0x000000070000 : "language"
[    3.090000] 0x000000070000-0x000000150000 : "kernel"
[    3.090000] 0x000000150000-0x000000400000 : "rootfs"
[    3.100000] mtd: partition "rootfs" set to be root filesystem
[    3.100000] split_squashfs: no squashfs found in "spi0.0"
[    3.110000] 0x000000070000-0x000000400000 : "firmware"

it looks like mtd7 is probably "firmware", which doesn't explicitly exist in stock. I think my logical equivalent is both uImage (= kernel) and rootfs.

I'm going to have to get a copy of dmesg over to this thing tonight and see what else i can dig out of the stock kernel boot messages.

Also: the gpl package from d-link appears to also include a way to update the uboot partition, so I maaaaay look into seeing if I can put together an update that adds automatic tftp with a timeout and fallback to local boot. Long term, this is probably a better goal since it'll give me a debricking capability.

@gibz

You don't need to update the uboot partition; i wouldn't anyway without jtag support, it's too risky.

The only todos now are:

* find a way to package a self compiled image with dlink header so that http flash via original firmware works

* my patch is outdated: actual kernel version in trunk is using devtree now, so either compile a specific older trunk version (see my previous posts) or create a devtree profile (don't know atm how many drivers are ported to devtree)

rAndy wrote:

You don't need to update the uboot partition; i wouldn't anyway without jtag support, it's too risky.

I flashed it with the root image from gpl build - it is identical to the 1.03 firmware. This is where I got the idea to modify the rootfs to have telnet enabled (and how I'm able to access it currently).

Based on that, I'm reasonably confident that the other image that's generated is a uboot image. My only concern is that it looks like a very old version of u-boot (1.1.4), and it might be difficult/impossible to do the boot script the way I want to.

rAndy wrote:

The only todos now are:

* find a way to package a self compiled image with dlink header so that http flash via original firmware works

The d-link header seems to revolve around the 'imghdr' binary that comes with the gpl tree, but doesn't appear to have source available. There's a similar copy on the stock rom, that un-does whatever the pc-side does, and flashes it. I suspect the settings that you pass in control where to write.

It works out to this for the stock rom:
./imghdr image/root_uImage image/DIR-505A1-image.bin 1048576 HORNET HORNET-PACKET-DIR505A1-3 DEF 1.00.12
and this for the uboot blob.
./imghdr image/tuboot.bin image/DIR-505A1-tuboot.bin 1048576 HORNET HORNET-PACKET-DIR505A1-1 DEF 1.00.12

Usage: imghdr <src> <dest> <kernel size> <model:19> <signature:29> <fw_reg:3> <fw_ver:11>
which loosely corresponds to:
kernel size = set in .config, converted to base-10 from base-16 0x100000 (=1048576)
model = (this is actually 'platform') set in .config, 'HORNET'
signature = platform-devicetype-model-type = HORNET, PACKET, DIR505A1, 3 (= firmware) or 1 (= uboot).
fw_reg = always 'DEF' (not sure what this does)
fw_ver = 1.00.12, which is firmware version + build.

As far as the image itself is concerned, it appears to be built with a squashfs compressed rootfs and lzma'd vmlinux. I'll spend some time looking into the OpenWRT build process to see if I can just generate this layout and then run it through imghdr.

rAndy wrote:

* my patch is outdated: actual kernel version in trunk is using devtree now, so either compile a specific older trunk version (see my previous posts) or create a devtree profile (don't know atm how many drivers are ported to devtree)

Yeah, I manually applied it to 35181; I haven't updated in a while. I also haven't spent as much time looking through the Makefiles to figure out how similar the stock rom is to OpenWRT.

I am keen to install the OpenWrt firmware but the current method sounds a little too risky just now.

What are the chances that there will be a version that can be flashed from the existing BIOS any time soon? Happy to test and report back findings!

Based in UK, just got hold of a DIR-505 (P/N EIR505BEU....A1E) but yet to open up to access serial.  Been tearing apart the stock firmware and interestingly the tftpd seems to allow the download of anything on the filesystem.  It's therefore possible to backup all the mtd partitions by doing a get on /dev/mtdblock[0-6]   (but writing appears to be blocked)

rAndy wrote:

Great news, got gpl pack from d-link, it includes u-boot src code!! \\o o//

Trying now to compile with net console activated, as serial console hookup with this device is a pain in the back...

did it happen to get the net console activated in customized u-boot?
I added something into config.h file as following:

./platform/Atheros/AR9331/u-boot/DIR-505A1/u-boot/include/config.h
#define CONFIG_NETCONSOLE 1
#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1

and found maybe the following file is the source code for net console:
./platform/Atheros/AR9331/u-boot/DIR-505A1/u-boot/tools/ncb.c

(Last edited by tangsoft on 5 Apr 2013, 09:15)

Hello everyone!

My name is Michael and this is my first post in this forum after reading along for a while...

I'm looking for a way to run a simple ftp-server on the DIR-505 to get access to files on an attached usb-drive.

And I really need it to be flashable throught the original firmware interface...

Does anyone have an idea how to do this?

Will I have to wait until there is a way of flashing OpenWRT without soldering?

@gibz: Do you see a way of activating a ftp-daemon in the stock firmware like you did it with telnet?

I've already contacted D-Link support and asked them if there will be an ftp-server in further firmware versions, but they denied.

lee181 wrote:

Will I have to wait until there is a way of flashing OpenWRT without soldering?

I felt like that one year ago. Then I took my courage and purchased a USB-Serial adapter and soldered 4 tiny pins on my TP-Link board. It took 10 minutes, and now I can un-brick most devices as a bonus.

Even if you do get an image that can be flashed through the original firmware, once you start playing with the network settings, you can block yourself access pretty easily.

Don't wait. Do it yourself smile

Newbie Question:
Sorry got lost in all the discussions going on here ,  can anyone tell me do we have a custom firmware for DIR-505 now ?? and can we flash it through web-interface  ?? Plus if we have an custom firmware what new features have you guys pushed into it ?

as i dont see DIR-505 in list of supported routers on openwrt site .. sad

(Last edited by gagan97 on 6 Apr 2013, 08:21)

gagan97 wrote:

Newbie Question:
Sorry got lost in all the discussions going on here ,  can anyone tell me do we have a custom firmware for DIR-505 now ?? and can we flash it through web-interface  ?? Plus if we have an custom firmware what new features have you guys pushed into it ?

as i dont see DIR-505 in list of supported routers on openwrt site .. sad


I have the same question:|

@elecnix: Thanks for that hint, but I don't have any idea about how to open the housing of the DIR-505 at all without destroying it.

@anyone else: Any news about flashing it via the web interface? Or at least a foolprof manual to open the housing and doing the rest via the serial cable?

It's not that hard to open the thing.

To open the unit, just remove the screw, pull the back cover off the shell, then pry the shell open.

Just stick a screwdriver in the hole at the bottom next to the ethernet port, and pry the two halves apart.

Then stick the screwdriver in on the other side in the topmost air vent and pry the top part of the shell apart.

Then just pull it open.



It's not that difficult.

(Last edited by danz on 18 Apr 2013, 18:20)

rAndy wrote:

I used micro tweezer probes to hook up the contacts; better double isolate with tape the other side of pcb. It's unreliable, but if you don't move the whole it works wink


What I did was take a couple strands of individual wires from a stranded ethernet cable wire. They're like fine wiskers. Then I soldered the individual strands to the rx and tx pads. I used small allegator clips to attach to the strands.

The advantage is that the strands of wire will break before the pads do, and they're ultra flexible, so it's much easier to work with.

Ultimately though, these pads are supposed to be used with pogo pins and a custom jig at the factory. You could make up a custom jig if you wanted, I've considered that myself.

danz wrote:

According to the gpl code from dlink I compiled, it looks like the header for the squashfs needs to be HORNET-PACKET-DIR505A1-3. That's different from the TP-Link device.


-Dan N7NMD

Hi Danz

Based on the above I assume you have v.A1 of the DIR-505 ?

A few weeks ago I wrote a generic set of instructions for creating a device Wiki so I'm going to test those by creating a template Wiki page for the DIR-505. I will also create an entry in the TOH as well, completed to the best of my knowledge, but I just need to be sure the information is accurate.

As a short term measure there will be a link from the device Wiki page to this thread. Longer term the device Wiki could be updated as well by the various developers. smile

(I wish my router had this much interest!)

jeq

EDIT: created the device wiki for DIR-505 in the 'supported' section of the TOH using the Wiki template. However the template is not necessarily complete. Someone has edited it for their router instead of copying it. What's there now for DIR-505 *could* be used but the original template had more information within it.

(Last edited by jeq on 18 Apr 2013, 23:19)

jeq wrote:
danz wrote:

According to the gpl code from dlink I compiled, it looks like the header for the squashfs needs to be HORNET-PACKET-DIR505A1-3. That's different from the TP-Link device.


-Dan N7NMD

Hi Danz

Based on the above I assume you have v.A1 of the DIR-505 ?

I wrote a set of instructions for creating a device Wiki so I'm going to test these by creating a template Wiki page for the DIR-505. I will also create an entry in the TOH as well, all completed, but I just need to be sure the information is accurate.

As a short term measure there will be a link from the device Wiki page to this thread. Longer term the device Wiki could be updated as well by the various developers. smile

(I wish my router had this much interest!)

jeq


I've actually flashed over 200 of these so far, and there's another 30 next to me waiting. I've been planning on working on the wiki page, whether or not the machine is actually flashable via the web interface thus far. If you want to put it together, I can update it with what I know.

That's great Danz. I just edited my last post which is worth a look.

jeq wrote:

That's great Danz. I just edited my last post which is worth a look.

The template is fine, actually. I just put in a bunch of information that I had for it, and cleaned it up.

I'll keep adding over the next few days.

danz wrote:
jeq wrote:
danz wrote:

According to the gpl code from dlink I compiled, it looks like the header for the squashfs needs to be HORNET-PACKET-DIR505A1-3. That's different from the TP-Link device.


-Dan N7NMD

Hi Danz

Based on the above I assume you have v.A1 of the DIR-505 ?

I wrote a set of instructions for creating a device Wiki so I'm going to test these by creating a template Wiki page for the DIR-505. I will also create an entry in the TOH as well, all completed, but I just need to be sure the information is accurate.

As a short term measure there will be a link from the device Wiki page to this thread. Longer term the device Wiki could be updated as well by the various developers. smile

(I wish my router had this much interest!)

jeq


I've actually flashed over 200 of these so far, and there's another 30 next to me waiting. I've been planning on working on the wiki page, whether or not the machine is actually flashable via the web interface thus far. If you want to put it together, I can update it with what I know.

Can we have all the instructions to flash via the web interface?
I gave it up when I ruined the pins by my poor soldering skills.

danz wrote:
jeq wrote:
danz wrote:

According to the gpl code from dlink I compiled, it looks like the header for the squashfs needs to be HORNET-PACKET-DIR505A1-3. That's different from the TP-Link device.


-Dan N7NMD

Hi Danz

Based on the above I assume you have v.A1 of the DIR-505 ?

I wrote a set of instructions for creating a device Wiki so I'm going to test these by creating a template Wiki page for the DIR-505. I will also create an entry in the TOH as well, all completed, but I just need to be sure the information is accurate.

As a short term measure there will be a link from the device Wiki page to this thread. Longer term the device Wiki could be updated as well by the various developers. smile

(I wish my router had this much interest!)

jeq


I've actually flashed over 200 of these so far, and there's another 30 next to me waiting. I've been planning on working on the wiki page, whether or not the machine is actually flashable via the web interface thus far. If you want to put it together, I can update it with what I know.

I know few things about these technical stuff. Can you please tell me how can I install the OpenWrt into my router, because I saw this router is "Supported", but I cannot understand what shall I do according this webpage http://wiki.openwrt.org/toh/d-link/dir-505.

(Last edited by amime on 23 Apr 2013, 11:36)

Okay, so I created a patch that applies to AA 12.09, and it allows the image to be uploaded from the web interface.

Let me clean it up, and I'll post a link to it.

danz wrote:

Okay, so I created a patch that applies to AA 12.09, and it allows the image to be uploaded from the web interface.

Let me clean it up, and I'll post a link to it.

super cool...

Okay here it is.
http://pastie.org/7936110

This is against AA 12.09, not trunk. Haven't tried it against trunk, haven't had time. If somebody would try it that would help.

So this is rAndy's orig patch, plus some changes that make it flashable from the web interface. rAndy i don't have your info so to put in that patch. PM me if you would plz, have question anwyas.

It's not quite a compete patch, sysupgrade still requires an -F to get it to upgrade, and i'm sure there's other loose ends, but I just can't find documentation on it all.

So anyways, directions:

1) Check out the code (git is your friend)
2) patch -p0 < patch.txt or somesuch.
3) make menuconfig, choose D-Link 505 profile, and anything else you want.
4) make, go get coffee or tea depending on your cultural affinity.
5) /bin/ar71xx will have the file openwrt-ar71xx-generic-dir-505-a1-squashfs-factory.bin

Then: plug the 505 in, set the switch to router/AP mode and connect ethernet to your computer.

Assign 192.168.0.100 to your computer, wait for bootup, then in a browser go to 192.168.0.1. You'll see the startup wizard (ugly orange/white screen), click on cancel to get to the main menu, then Maintenance, Firmware, Click on Browse, choose the .bin file from above, and upload.

Then don't touch the thing till it comes up, or you might brick it. If you reset your ip to 192.168.1.10, you should be able to login.

what version number of code shall I check out?

danz wrote:

Okay here it is.
http://pastie.org/7936110

This is against AA 12.09, not trunk. Haven't tried it against trunk, haven't had time. If somebody would try it that would help.

So this is rAndy's orig patch, plus some changes that make it flashable from the web interface. rAndy i don't have your info so to put in that patch. PM me if you would plz, have question anwyas.

It's not quite a compete patch, sysupgrade still requires an -F to get it to upgrade, and i'm sure there's other loose ends, but I just can't find documentation on it all.

So anyways, directions:

1) Check out the code (git is your friend)
2) patch -p0 < patch.txt or somesuch.
3) make menuconfig, choose D-Link 505 profile, and anything else you want.
4) make, go get coffee or tea depending on your cultural affinity.
5) /bin/ar71xx will have the file openwrt-ar71xx-generic-dir-505-a1-squashfs-factory.bin

Then: plug the 505 in, set the switch to router/AP mode and connect ethernet to your computer.

Assign 192.168.0.100 to your computer, wait for bootup, then in a browser go to 192.168.0.1. You'll see the startup wizard (ugly orange/white screen), click on cancel to get to the main menu, then Maintenance, Firmware, Click on Browse, choose the .bin file from above, and upload.

Then don't touch the thing till it comes up, or you might brick it. If you reset your ip to 192.168.1.10, you should be able to login.