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.

well, i have Attitude Adjustment 12.09 and i don't know why because i uploaded the barrier breaker firmware through DLINK Router Recovery Mode and still have the AA 12.09 even when success message appears.
Also i tried to upload the firmware through the luci interface but i get this error:
"The uploaded image file does not contain a supported format. Make sure that you choose the generic image format for your platform."

i'ts safe to do the following?

sysupgrade -v /tmp/openwrt-r37738-dir505-A1-factory.bin

thanks in advance!

Found some errors in the file "target/linux/ar71xx/image/Makefile", in the trunk source.
After editing 2 lines in this file, I was able to compile a factory image.
Here is the patch to fix it:

http://pastie.org/8235862

I like this unit and would like to add it as another choice of platform for my meteobridge offering (www.meteobridge.com). In order to provide an easy to install route for the weather guys target audience, flashing via D-Links web interface is a must. I did see that there is a firmware compiled that can be flashed by the web interface (and I did that sucessfully), but the tool chain provided to compile my own kernel/rootfs does just generate a sysupgrade and not a factory-bin file.
Could anyone give a hint how to make a factory-bin? From this thread I understand that the header needs some update regarding the hornet string, but to be honest I don't fully understand that. Any help is welcome.

(Last edited by docbee on 18 Aug 2013, 09:36)

nix-v wrote:

well, i have Attitude Adjustment 12.09 and i don't know why because i uploaded the barrier breaker firmware through DLINK Router Recovery Mode and still have the AA 12.09 even when success message appears.
Also i tried to upload the firmware through the luci interface but i get this error:
"The uploaded image file does not contain a supported format. Make sure that you choose the generic image format for your platform."

meanwhile i believe you managed to flash it on a Windows system, the dlink web recovery page has issues on some browsers (i couldnt flash on Linux with neither Firefox nor Chrome..) but on Win7 with Chrome seems okay.

brsinal wrote:

Found some errors in the file "target/linux/ar71xx/image/Makefile", in the trunk source.
After editing 2 lines in this file, I was able to compile a factory image.
Here is the patch to fix it:

http://pastie.org/8235862

cool, it's fixed in latest trunk anyway..

docbee wrote:

but the tool chain provided to compile my own kernel/rootfs does just generate a sysupgrade and not a factory-bin file.
Could anyone give a hint how to make a factory-bin? From this thread I understand that the header needs some update regarding the hornet string

fixed in latest trunk !

The error with my Huawei E-3276 modem appears to be power-related. The modem consumes too much power that it sometimes activates  the USB over-current protection. I'll try to fix it with external power source.

http://paulphilippov.com/articles/how-t … ress-error

Worked like a charm!
I connected a hub with an external power source (max 2000mA) to my dir-505, and connected my modem to the hub.
That error message never appeared again, even with several reboots. smile

Thanks for the new updates!

Which is the flashing address for the factory image?
Can any developer update the installation instructions on the wiki?

Best regards

dape wrote:
docbee wrote:

but the tool chain provided to compile my own kernel/rootfs does just generate a sysupgrade and not a factory-bin file.
Could anyone give a hint how to make a factory-bin? From this thread I understand that the header needs some update regarding the hornet string

fixed in latest trunk !

I just downloaded trunk (svn co svn://svn.openwrt.org/openwrt/trunk/), compiled through and in "trunk/bin/ar71xx/" I still only find "openwrt-ar71xx-generic-dir-505-a1-squashfs-sysupgrade.bin" but not the factory image.

What is going wrong? Am I missing a config setting?

docbee wrote:
dape wrote:
docbee wrote:

but the tool chain provided to compile my own kernel/rootfs does just generate a sysupgrade and not a factory-bin file.
Could anyone give a hint how to make a factory-bin? From this thread I understand that the header needs some update regarding the hornet string

fixed in latest trunk !

I just downloaded trunk (svn co svn://svn.openwrt.org/openwrt/trunk/), compiled through and in "trunk/bin/ar71xx/" I still only find "openwrt-ar71xx-generic-dir-505-a1-squashfs-sysupgrade.bin" but not the factory image.

What is going wrong? Am I missing a config setting?

rm -fr tmp/ ; make clean

maybe?

docbee wrote:

I just downloaded trunk (svn co svn://svn.openwrt.org/openwrt/trunk/), compiled through and in "trunk/bin/ar71xx/" I still only find "openwrt-ar71xx-generic-dir-505-a1-squashfs-sysupgrade.bin" but not the factory image.

What is going wrong? Am I missing a config setting?

I checked https://github.com/mirrors/openwrt/blob … e/Makefile

The file /target/linux/ar71xx/image/Makefile at the source is still incorrect. They fixed the image header, but the mtd layout has no information about the image max size.  Try to edit this file.
Find the line:

define Image/Build/Cameo933x_8M
$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo933x_mtdlayout_8M),1048576,6422528,$(4))
endef

and edit it:

define Image/Build/Cameo933x_8M
$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo933x_mtdlayout_8M),1048576,6422528,$(4),$(5),$(6),7864320)
endef

brsinal wrote:

define Image/Build/Cameo933x_8M
$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo933x_mtdlayout_8M),1048576,6422528,$(4),$(5),$(6),7864320)
endef

Thank you for the welcome hint! I did edit this but when i compile with "make V=99" I can see that code fragment below does not make the "mkcameofw" calls, because $(9) is an empty string and therefore for-loop does not run through.

define Image/Build/CameoHornet
        $(call MkuImageLzma,$(2),$(3) $(4))
        $(call Sysupgrade/KRuImage,$(1),$(2),$(5),$(6))
        if [ -e "$(call sysupname,$(1),$(2))" ]; then \
                for r in $(9); do \
                        [ -n "$$$$r" ] && dashr="-$$$$r" || dashr=; \
                        [ -z "$$$$r" ] && r="DEF"; \
                        mkcameofw -M HORNET -R "$$$$r" -S $(7) -V $(8) -c \
                                -K 0xe0000 -I $(10) \
                                -k "$(call sysupname,$(1),$(2))" \
                                -o $(call imgname,$(1),$(2))-factory$$$$dashr.bin; \
                done; \
        fi
endef

Any idea how to get $(9) populated with something useful?

(Last edited by docbee on 23 Aug 2013, 22:05)

docbee wrote:
define Image/Build/CameoHornet
        $(call MkuImageLzma,$(2),$(3) $(4))
        $(call Sysupgrade/KRuImage,$(1),$(2),$(5),$(6))
        if [ -e "$(call sysupname,$(1),$(2))" ]; then \
                for r in $(9); do \
                        [ -n "$$$$r" ] && dashr="-$$$$r" || dashr=; \
                        [ -z "$$$$r" ] && r="DEF"; \
                        mkcameofw -M HORNET -R "$$$$r" -S $(7) -V $(8) -c \
                                -K 0xe0000 -I $(10) \
                                -k "$(call sysupname,$(1),$(2))" \
                                -o $(call imgname,$(1),$(2))-factory$$$$dashr.bin; \
                done; \
        fi
endef

Any idea how to get $(9) populated with something useful?

As far as I could sneak the code, the source of the program "mkcameofk" gave me the parameters:

"  -k <file>       read kernel image from the file <file>\n"
"  -c              use the kernel image as a combined image\n"
"  -M <model>      set model to <model>\n"
"  -o <file>       write output to the file <file>\n"
"  -r <file>       read rootfs image from the file <file>\n"
"  -S <signature>  set image signature to <signature>\n"
"  -R <region>     set image region to <region>\n"
"  -V <version>    set image version to <version>\n"
"  -I <size>       set image size to <size>\n"
"  -K <size>       set kernel size to <size>\n"
"  -h              show this screen\n"

So, if -S is the signature (variable $(7)), and the signature is "HORNET-PACKET-DIR505A1-3", you can search the file target/linux/ar71xx/image/Makefile for the line:

$(eval $(call SingleProfile,Cameo933x_8M,$(fs_squash),DIR505A1,dir-505-a1,DIR-505-A1,ttyATH0,115200,"HORNET-PACKET-DIR505A1-3"))

This line is probably the input for these variables.

Thanks, I don't think "-S" is the issue but "-R". When it compiles via V=99 it executes this line where the "for r in"-loop expecting to get a list of things to loop through is not feeded, because $(9) is empty.

if [ -e "/home/boris/openwrt.na/trunk/bin/ar71xx/openwrt-ar71xx-generic-dir-505-a1-squashfs-sysupgrade.bin" ]; then for r in ; do [ -n "$r" ] && dashr="-$r" || dashr=; [ -z "$r" ] && r="DEF"; mkcameofw -M HORNET -R "$r" -S "HORNET-PACKET-DIR505A1-3" -V  -c -K 0xe0000 -I 7864320 -k "/home/boris/openwrt.na/trunk/bin/ar71xx/openwrt-ar71xx-generic-dir-505-a1-squashfs-sysupgrade.bin" -o /home/boris/openwrt.na/trunk/bin/ar71xx/openwrt-ar71xx-generic-dir-505-a1-squashfs-factory$dashr.bin; done; fi

Looking at these definitions in the Makefile

define Image/Build/Cameo933x_8M
        $(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo933x_mtdlayout_8M),1048576,6422528,$(4),$(5),$(6),7864320)
endef

define Image/Build/CameoHornet
        $(call MkuImageLzma,$(2),$(3) $(4))
        $(call Sysupgrade/KRuImage,$(1),$(2),$(5),$(6))
        if [ -e "$(call sysupname,$(1),$(2))" ]; then \
                for r in $(9); do \
                        [ -n "$$$$r" ] && dashr="-$$$$r" || dashr=; \
                        [ -z "$$$$r" ] && r="DEF"; \
                        mkcameofw -M HORNET -R "$$$$r" -S $(7) -V $(8) -c \
                                -K 0xe0000 -I $(10) \
                                -k "$(call sysupname,$(1),$(2))" \
                                -o $(call imgname,$(1),$(2))-factory$$$$dashr.bin; \
                done; \
        fi
endef

makes me think that the call to "Image/Build/Cameo933x_8M" is not done correctly as $(6) (which is then passed as $(9) to the sub) seems to be errornously empty.

Unfortunately, I can't find the code calling "Image/Build/Cameo933x_8M" in the source tree.

Any ideas on that? ...and sorry for being such a pain.

(Last edited by docbee on 24 Aug 2013, 11:45)

docbee wrote:

makes me think that the call to "Image/Build/Cameo933x_8M" is not done correctly as $(6) (which is then passed as $(9) to the sub) seems to be errornously empty.

They updated it and fixed the empty vars. Check this out:
https://dev.openwrt.org/changeset/37834/

dape wrote:

Hey guys, maybe the following Barrier Breaker images work for you (they seem okay on my A1) :

Thanks to everyone for getting this going...
I bought a USA DIR-505L and flashed with dape's image.  (I needed to hex-edit the device name in the header of the .bin to match what was in the US D-Link firmware file.)  It works great so far.

However, as you all know, the RJ-45 port is configured as a LAN port by default.  I want to turn this into a router/hotspot I can take on the road with me.  So I need to reconfigure this port to act as a WAN port.  Additionally, I will install openVPN on it to create a VPN back to my home network for when I'm on the road.  I have a similar device that I use this on, and it works great, but the DIR-505L is SO much more tiny and easy to pack.  Anyway, the OpenVPN project is for another day...

For NOW, I'm trying to figure out how to reconfigure the port (eth1?) to act as as WAN port and create a NAT'ted network with the Wifi.
Of course, I will setup DHCP as well to serve the wireless clients.

Can someone point me to clear instructions on how to do this, either via the Luci interface (preferred) or via SSH (also ok)?

Any help is much appreciated.  By the way, I'm a TOTAL OpenWRT noob, though I've done quite a bit of hacking on my other (tomato based) Linux router. (An Asus RT-N16)

(Last edited by mraneri on 25 Aug 2013, 00:24)

mraneri wrote:
dape wrote:

Hey guys, maybe the following Barrier Breaker images work for you (they seem okay on my A1) :

Thanks to everyone for getting this going...
I bought a USA DIR-505L and flashed with dape's image.

hehe, thanks, new firmware version out by the way..

For NOW, I'm trying to figure out how to reconfigure the port (eth1?) to act as as WAN port and create a NAT'ted network with the Wifi.
Of course, I will setup DHCP as well to serve the wireless clients.

Can someone point me to clear instructions on how to do this, either via the Luci interface (preferred) or via SSH (also ok)?

Here's what i use for PPPoE on the ethernet port with LAN on the wifi (/etc/config/network) :

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd17:c6d4:848c::/48'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '64'
        option ipaddr '192.168.1.1'

config interface 'wan'
        option proto 'pppoe'
        option ifname 'eth0'
        option username 'USERNAME'
        option password 'PASSWORD'
        option ipv6 '1'

config interface 'wan6'
        option ifname '@wan'
        option proto 'dhcpv6'

(Last edited by dape on 25 Aug 2013, 02:11)

dape wrote:

hehe, thanks, new firmware version out by the way..

I'll try the network config first, in case I lose communication like I did the last few times I tried to get it going!!
Then I can reflash with the new version.

Thanks...

dape wrote:

Here's what i use for PPPoE on the ethernet port with LAN on the wifi (/etc/config/network) :

I needed to change:
config interface 'wan'
    option ifname 'eth1'

eth0 didn't work.
Seems the double natting is working now.
I'll check it a little more thoroughly and then start on the openVPN piece...

Thanks for the pointer.

- Mike

brsinal wrote:
docbee wrote:

makes me think that the call to "Image/Build/Cameo933x_8M" is not done correctly as $(6) (which is then passed as $(9) to the sub) seems to be errornously empty.

They updated it and fixed the empty vars. Check this out:
https://dev.openwrt.org/changeset/37834/

Great news! I did a try yesterday. This time problems with a not reachable openwrt server (needed as it downloads material during make cycle on a fresh sources download) did not occur as last time. But this time compile stops at a new position to keep me busy

[100%] Generating ../Docs/cmake.txt
make[6]: Leaving directory `/home/boris/openwrt.na/trunk/build_dir/host/cmake-2.8.11.2'
[100%] Built target documentation
make[5]: Leaving directory `/home/boris/openwrt.na/trunk/build_dir/host/cmake-2.8.11.2'
make[4]: Leaving directory `/home/boris/openwrt.na/trunk/build_dir/host/cmake-2.8.11.2'
touch /home/boris/openwrt.na/trunk/build_dir/host/cmake-2.8.11.2/.built
make[3]: Leaving directory `/home/boris/openwrt.na/trunk/tools/cmake'
make[2]: Leaving directory `/home/boris/openwrt.na/trunk'
make[1]: *** [/home/boris/openwrt.na/trunk/staging_dir/target-mips_r2_uClibc-0.9.33.2/stamp/.tools_install_nnnnn] Error 2
make[1]: Leaving directory `/home/boris/openwrt.na/trunk'
make: *** [world] Error 2

sorry for bothering here again with this "low level" problems, but trunk seem sto be a bit shaky at the moment... smile


SOLVED!
It was again a download issue (but a bit more hard to find). I downloaded file "http://tioan.org/openwrt/trunk/dl/mklibs_0.1.35.tar.gz" manually into "trunk/dl" folder, restarted compilation and it went through fine this time.

(Last edited by docbee on 25 Aug 2013, 10:24)

Hi guys I need your help, want to install a new factory image but so far without success.
The image boot address from 'printenv bootcmd' is 9f080000 plus the 780054 image size it gives error:
"Error: end address (0x9f800053) not in flash!
Bad address format"

What am I doing wrong?

Finally, after a downloading three files (that Makefile cannot find) with script below, I was able to get a "factory.bin".

#!/bin/sh
#
unset TAR_OPTIONS
export TAR_OPTIONS
mkdir -p trunk/dl
cd trunk/dl
wget -O carl9170-1.fw-1.9.6 http://tioan.org/openwrt/trunk/dl/carl9170-1.fw-1.9.6
wget -O mklibs_0.1.35.tar.gz http://tioan.org/openwrt/trunk/dl/mklibs_0.1.35.tar.gz
wget -O compat-wireless-2013-06-27.1.tar.bz2 http://enduser.subsignal.org/~trondah/tree/dl/compat-wireless-2013-06-27.1.tar.bz2

I started my DIR-505 that I have patched with one of the precompiled images from this thread and I tried to load the newly generated image for flashing. But to my surprise the format is not accepted (see error message below)?

http://www.meteohub.de/files/openwrt-flasherror.png

Any idea how to circumvent this? Can't I flash an image generated from trunk onto an AA 12.09 installation? Neither factory nor sysupgrade files did work.

docbee wrote:

I started my DIR-505 that I have patched with one of the precompiled images from this thread and I tried to load the newly generated image for flashing. But to my surprise the format is not accepted (see error message below)?

Any idea how to circumvent this? Can't I flash an image generated from trunk onto an AA 12.09 installation? Neither factory nor sysupgrade files did work.

I noticed that too, the d-link web upgrade accepts the image, but the sysupgrade don't. It looks like a bug on sysupgrade. You can either use the option -F (force) at command-line via SSH, or use the emergency recovery of the dir-505 instead.

To use emergency recovery of dir-505:
-Hold reset button with the router turned-off, then turn on, and the led will keep blinking red.
-On your computer, put manually the ip 192.168.0.2 at the ethernet device, then connect it with the ethernet port of the router.
-Open the web browser and go to the address 192.168.0.1. You'll see the emergency recovery interface of the router.

(Last edited by brsinal on 25 Aug 2013, 23:02)