OpenWrt Forum Archive

Topic: D-LINK DIR-632, wireless router with 8 ports switch!

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

OK.  My patch is here, it is rather large (~400k) because it includes a complete network device driver...

https://raw.github.com/andymc73/openwrt … dir632.txt

This applies against the git trunk as of last night anyway.

Known bugs:

1. The switch isn't "switching" - computers plugged into the switch can talk
to the router but not each other.  Hopefully just a boot configuration issue.

2. Wifi needs to be turned on as follows before it will work, at which point it succesfully registered with my other router

uci set wireless.radio0.disabled=0 ; wifi up

3. Kernel - the wlan LED doesnt work yet

4. Kernel - the Power/Status LED only works in Orange (should be able to be
Green as well)

5. Kernel - the WAN LED only works in Green (should be able to be in Orange as
well)

6. Kernel - I was getting a 'warn_slowpath_common' stacktrace once in the
kernel when the first packet is processed in the router, but it doesnt seem to
affect performance

7. MAC addresses - I am not sure what the policy should be - the factory sets
them all to the stickered MAC address, but DD-WRT reads a different MAC
address from the ART partition.  Currently I set the stickered MAC as the
default for the WLAN, and use the ART for default eth0, and the ART 6th
octet+1 for default eth1.

8. The LEDS dont seem to be doing the right thing in user space - at one point
I had power/status flashing at boot but it doesn't currently

~phew~


Bricks at the ready!

Update - after further testing on a clean total rebuild it seems the WLAN LED is actually working - it comes on after wifi up on association, and turns off on wifi down - so scratch one bug!

And USB LED turns on when you plug in a USB stick and turns off again.

An the WAN LED turns on on when I plug in a live ethernet cable.

So apart from the colours it seems the LEDs are working after all


And, devices can see each other on the switch !

Looks like my dev build was mucking around with things!

Maybe this is a goer...

I have uploaded a build that I just flashed to my github

https://github.com/andymc73/openwrt-dir … actory.bin

any takers want to try it out?

Note that my config is tweaked to put tcpdump-mini and various other debugging tools into the main squashfs, so you will have a smaller overlay partition than normal

oldcomputerjunk wrote:

any takers want to try it out?

I'll give it a crack. I'm going to try the mtd write dance and see if that works to flash from DD-WRT

UPDATE: Flash went fine. I upgraded with:

mtd -r write openwrt-ar71xx-generic-dir-632-a1-squashfs-factory.bin linux

Haven't done anything useful with it, just SSH'd into it and poked around. Nice work.

(Last edited by andybotting on 21 Apr 2013, 09:59)

Hi oldcomputerjunk;

I flashed your image as per http://wiki.openwrt.org/toh/d-link/dir-632 unbricking procedure lan port1.
Used serial port to monitor events.

Logged in via telnet and configured for ssh by passwd change and then reset and ssh'd back in.

Changed lan; dns ang gateway to local ip's.

Completed and opkg via my local network.

Updated opkg and installed luci and nano.

Configured wifi and enabled but can not connect as an ap.
Can see it on inSSIDer.
Scan works via luci.
Probably something I'm doing.

Installed a flash drive and can see it with usb-utils.

I'll continue to monitor and test.

Let me know if I can carry out further tests and how to do my own build.

Good work and well done.

~john

Quick update on wifi:

Getting these on logread;
Apr 22 04:10:10 OpenWrt daemon.notice hostapd: wlan0: STA 00:12:f0:bb:b1:56 IEEE 802.11: did not acknowledge authentication response
Apr 22 04:10:11 OpenWrt daemon.notice hostapd: wlan0: STA 00:12:f0:bb:b1:56 IEEE 802.11: did not acknowledge authentication response
Apr 22 04:10:11 OpenWrt daemon.notice hostapd: wlan0: STA 00:12:f0:bb:b1:56 IEEE 802.11: did not acknowledge authentication response
Apr 22 04:10:11 OpenWrt daemon.notice hostapd: wlan0: STA 00:12:f0:bb:b1:56 IEEE 802.11: did not acknowledge authentication response
Apr 22 04:10:11 OpenWrt daemon.notice hostapd: wlan0: STA 00:12:f0:bb:b1:56 IEEE 802.11: did not acknowledge authentication response
Apr 22 04:10:11 OpenWrt daemon.notice hostapd: wlan0: STA 00:12:f0:bb:b1:56 IEEE 802.11: did not acknowledge authentication response
Apr 22 04:10:12 OpenWrt daemon.notice hostapd: wlan0: STA 00:12:f0:bb:b1:56 IEEE 802.11: did not acknowledge authentication response
Apr 22 04:10:12 OpenWrt daemon.notice hostapd: wlan0: STA 00:12:f0:bb:b1:56 IEEE 802.11: did not acknowledge authentication response
Apr 22 04:11:15 OpenWrt kern.info kernel: [  845.200000] IPv6: ADDRCONF(NETDEV_UP): tmp.wlan0: link is not ready
Apr 22 04:11:16 OpenWrt kern.info kernel: [  846.440000] IPv6: ADDRCONF(NETDEV_UP): tmp.wlan0: link is not ready
Apr 22 04:11:17 OpenWrt kern.info kernel: [  847.680000] IPv6: ADDRCONF(NETDEV_UP): tmp.wlan0: link is not ready
root@OpenWrt:~#




~john

Boy an I dumb!!!!!!!!!!!!
Credit should be to oldcomputerjunk.
Re-edited it.

Sorry about that.

~john

Wifi now ok.

I had messed up the security.

~john

(Last edited by johnisaacson on 22 Apr 2013, 06:06)

@oldcomputerjunk: I started compiling my own image from trunk, but it seems that DIR-632 isn't listed in the 'Target Profile' list in menuconfig.

Would be nice to not have to build images for all other ar7xxx systems.

I poked around a bit and it looks like all the right pieces are there, but it just isn't coming up in the menu.

Any ideas?

andybotting wrote:

@oldcomputerjunk: I started compiling my own image from trunk, but it seems that DIR-632 isn't listed in the 'Target Profile' list in menuconfig.

Would be nice to not have to build images for all other ar7xxx systems.

I poked around a bit and it looks like all the right pieces are there, but it just isn't coming up in the menu.

Any ideas?

The patch has not gone through yet so you will need to apply it manually.

I'll post instructions on the wiki page shortly...

johnisaacson wrote:

...
Let me know if I can carry out further tests and how to do my own build.
...

Yes, that would be helpful - I am going to put the build instructions on the wiki page for the DIR-632

oldcomputerjunk;

Success on the interim build procedure on a 64 bit Windows 7, with Oracle VM.. Ubuntu 12.04 LTS.
I had some problem working around the build directories so I dropped the patch directly into the /work/openwrt/trunk/ directory
and built the patch there.

I tried to flash directly from your first build via the Luci "Backup / Flash Firmware" but it spat out a message:

"Flash Firmware - Verify
The flash image was uploaded. Below is the checksum and file size listed, compare them with the original file to ensure data integrity.
Click "Proceed" below to start the flash procedure.
It appears that you try to flash an image that does not fit into the flash memory, please verify the image file!
•Checksum: c50c4c05841e5d5041bf20d9f86397d5
•Size: 7.31 MB (1.94 MB available)
• Note: Configuration files will be erased."

I used the default Dlink firmware flash method.
Below is the new build date/time.
............................
BusyBox v1.19.4 (2013-04-23 12:19:19 PDT) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
|       |.-----.-----.-----.|  |  |  |.----.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
-----------------------------------------------------
BARRIER BREAKER (Bleeding Edge, r36370)
-----------------------------------------------------
  * 1/2 oz Galliano         Pour all ingredients into
  * 4 oz cold Coffee        an irish coffee mug filled
  * 1 1/2 oz Dark Rum       with crushed ice. Stir.
  * 2 tsp. Creme de Cacao
-----------------------------------------------------
root@OpenWrt:~#
....................................



Now for the permanent patch in Trunk.

Good work.

~john

OK, I managed to get green power and orange WAN to work, I'll try and get patches up tomorrow or wednesday

Turns out you need to set the AR724X_GPIO_FUNC_JTAG_DISABLE bit in the GPIO FUNCTION register - some of the same used pins are also pinned out to the JTAG port

Also, turns out that GPIO 13-16 are test points TP3-6, so you have 4 GPIOs spare to play with!
I feel an SDCARD hack coming... although soldering to TP3 and TP4 could be challenging as they are under the edge of the shield... although I can probably do without the bi-coloured leds

That sounds awesome.

I've been trying to flash the DIR-632 with something other than IE7, but no luck so far. I found a curl command and  a Ruby script made for different model routers, but neither of them worked unfortunately.

I usually flash my routers by sending the new image to /tmp (tmpfs) then

mtr -r write /tmp/openwrt-ar71xx-generic-dir-632-a1-squashfs-factory.bin linux

but this doesn't seem to work. It complains that the file isn't a valid TRX file - although this method worked when going from DD-WRT to OpenWRT. Any ideas?

(Last edited by andybotting on 29 Apr 2013, 23:41)

Hi andybotting;

I used the default built in web flash method as per http://wiki.openwrt.org/toh/d-link/dir-632 Unbricking Procedure
with 32 bit xp and IE7 with no problem. I did not disable my AVG antivirus either.

I also had the serial port up.

I could not get it to flash with 64 bit Windows 7 with IE10.
Apparently IE10 causes problems.

It may work with 64 bit Windows 7 and Firefox but I haven't tried it yet.
When  oldcomputerjunk  posts the new patches I'll try a new build and give it a try.

~john

I have updated the patches and a bin file in my github, this time all the LEDs should work when you write to them using /sys/class/led/...

https://github.com/andymc73/openwrt-dir632

I dont know about TRX files, I thought they were for broadcom?

I just did a test flash, through telnet, like this:

root@OpenWrt:/# umount /sys/kernel/debug ; umount /overlay
root@OpenWrt:/# killall ntpd dnsmasq dropbear hotplug2 udhcpc netifd procd klogd syslogd
root@OpenWrt:/# cd /tmp
root@OpenWrt:/tmp# wget http://192.168.1.27/~andrew/openwrt/bin/ar71xx/openwrt-ar71xx-generic-dir-632-a1-squashfs-factory.bin
--1970-01-01 00:16:02--  http://192.168.1.27/~andrew/openwrt/bin/ar71xx/openwrt-ar71xx-generic-dir-632-a1-squashfs-factory.bin
Connecting to 192.168.1.27:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7667736 (7.3M) [application/octet-stream]
Saving to: 'openwrt-ar71xx-generic-dir-632-a1-squashfs-factory.bin'

100%[==================================================================================================================================================>] 7,667,736   11.2MB/s   in 0.7s   

1970-01-01 00:16:03 (11.2 MB/s) - 'openwrt-ar71xx-generic-dir-632-a1-squashfs-factory.bin' saved [7667736/7667736]

root@OpenWrt:/tmp# mtd unlock firmware
Unlocking firmware ...
root@OpenWrt:/tmp# mtd write openwrt-ar71xx-generic-dir-632-a1-squashfs-factory.bin firmware
Unlocking firmware ...

Writing from openwrt-ar71xx-generic-dir-632-a1-squashfs-factory.bin to firmware ...  [e]Failed to erase block
root@OpenWrt:/tmp# reboot
root@OpenWrt:/tmp# Connection closed by foreign host.
andrew@atlantis3:~/develop/openwrt/repos/openwrt$ telnet 192.168.1.1
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
 === IMPORTANT ============================
  Use 'passwd' to set your login password
  this will disable telnet and enable SSH
 ------------------------------------------


BusyBox v1.19.4 (2013-04-25 20:02:39 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 BARRIER BREAKER (Bleeding Edge, r36487)
 -----------------------------------------------------
  * 1/2 oz Galliano         Pour all ingredients into
  * 4 oz cold Coffee        an irish coffee mug filled
  * 1 1/2 oz Dark Rum       with crushed ice. Stir.
  * 2 tsp. Creme de Cacao
 -----------------------------------------------------
root@OpenWrt:/# 

Provided the '[e]Failed to erase block' error happens after quite some time, I think this is caused by the bin file being not align with the flash erase size (because of the D-link signature needed by Uboot, perhaps?) butit otherwise has no material effect I can see - i.e. you can ignore it

@oldcomputerjunk;
Installed your latest image.

Configured network.

Tested leds ok.

Good job.

~john

...................

=== IMPORTANT ============================
  Use 'passwd' to set your login password
  this will disable telnet and enable SSH
------------------------------------------


BusyBox v1.19.4 (2013-04-25 20:02:39 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
|       |.-----.-----.-----.|  |  |  |.----.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
-----------------------------------------------------
BARRIER BREAKER (Bleeding Edge, r36487)
-----------------------------------------------------
  * 1/2 oz Galliano         Pour all ingredients into
  * 4 oz cold Coffee        an irish coffee mug filled
  * 1 1/2 oz Dark Rum       with crushed ice. Stir.
  * 2 tsp. Creme de Cacao
-----------------------------------------------------
root@OpenWrt:/# ping www.google.com
PING www.google.com (74.125.28.99): 56 data bytes
64 bytes from 74.125.28.99: seq=0 ttl=45 time=43.191 ms
64 bytes from 74.125.28.99: seq=1 ttl=45 time=40.982 ms
^C
--- www.google.com ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 40.982/42.086/43.191 ms
.....

root@OpenWrt:cd /sys/class/leds
root@OpenWrt:/sys/class/leds# ls
ath9k-phy0          d-link:amber:power  d-link:amber:wan    d-link:blue:wps     d-link:green:power  d-link:green:usb    d-link:green:wan
root@OpenWrt:/sys/class/leds# cd /
root@OpenWrt:/# echo 1 > /sys/class/leds/d-link:green:power/brightness
root@OpenWrt:/# echo 0 > /sys/class/leds/d-link:green:power/brightness
root@OpenWrt:/# echo 1 > /sys/class/leds/d-link:amber:wan/brightness
root@OpenWrt:/# echo 0 > /sys/class/leds/d-link:amber:wan/brightness
root@OpenWrt:/# echo 1 > /sys/class/leds/d-link:blue:wps/brightness
root@OpenWrt:/# echo 0 > /sys/class/leds/d-link:blue:wps/brightness
root@OpenWrt:/# echo 1 > /sys/class/leds/d-link:green:usb/brightness
root@OpenWrt:/# echo 0 > /sys/class/leds/d-link:green:usb/brightness
root@OpenWrt:/# echo 1 > /sys/class/leds/d-link:green:wan/brightness
root@OpenWrt:/# echo 0 > /sys/class/leds/d-link:green:wan/brightness
root@OpenWrt:/#

@oldcomputerjunk;
Update:
I applied your latest patch to the most recent trunk build and tested a few of the the gpio leds ok.

I also loaded it up with mmc-gpio, gpioctl-sysfs, etc.

@andybotting:
I used Windows 7, 64 bit with Firefox and flashed via the web browser method.

............
=== IMPORTANT ============================
  Use 'passwd' to set your login password
  this will disable telnet and enable SSH
------------------------------------------


BusyBox v1.19.4 (2013-04-30 19:13:45 PDT) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
|       |.-----.-----.-----.|  |  |  |.----.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
-----------------------------------------------------
BARRIER BREAKER (Bleeding Edge, r36499)
-----------------------------------------------------

Linux version 3.8.10 (john@john-VirtualBox) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2012.12 r36499) ) #3 Tue Apr 30 22:10:45 PDT 2013

root@OpenWrt:/# echo 1 > /sys/class/leds/d-link:green:power/brightness
root@OpenWrt:/# echo 0 > /sys/class/leds/d-link:green:power/brightness
root@OpenWrt:/#  echo 1 > /sys/class/leds/d-link:amber:wan/brightness
root@OpenWrt:/# echo 0 > /sys/class/leds/d-link:amber:wan/brightness
...........

~john

(Last edited by johnisaacson on 1 May 2013, 07:41)

It will be a little longer before this makes it into trunk, I need to try and fix the proper network driver now.

Understandably the maintainers don't want a completely new set of code for one chip for one board that should be able to be made work with an existing driver for same chip ...

I am hoping I will have better luck with the OpenWRT ar71xx_ag7240 driver this time, because everything else works and wont be 'in my way' as a distraction so to speak

Could be a few days at least yet, at which point if I cant make it work I post my research and seek help from someone with more experience with Atheros SOC and ethernet drivers than me...

oldcomputerjunk wrote:

It will be a little longer before this makes it into trunk, I need to try and fix the proper network driver now.

I saw your patches on the mailing list this morning. Just wanted to thank you for your hard work.

cheers

Not quite - most of those patches as is wont be accepted, they need some further massaging to meet OpenWRT standards and also don't make eth1 work.. but we are getting there gradually!

oldcomputerjunk: Anything that we can do ( or at least I) to help develop a proper firmware for this router?

I don't claim that I'm really good in developing such a software or firmware but I'm really enthusiastic on getting this router to work properly with OpenWRT. I have done some coding in C/C++/Java as well as Python.

Let me know if I can be of any help.

oldcomputerjunk: thanks for your work on this.

i used win7 x64 and firefox for the Unbricking Procedure for DIR632 - web browser for initial flash (wouldnt work in ubuntu/firefox)

to get luci happening, telnet 192.168.1.1 and "vi /etc/opkg.conf" and edit the first line to read "src/gz snapshots http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages" hit esc then ":x" should exit you out of vi. "opkg update" then "opkg install luci" should work its magic. once thats finished "/etc/init.d/uhttpd enable" then "/etc/init.d/uhttpd start" and you should have web config via 192.168.1.1

hope i didnt forget anything. im quite the linux noob.

A may be to make patch for attitude_adjustment ? Trunk very very no stable - 1 day no on-link,but RAM is free :-(
p.s. I make openwrt for 632 follow instruction + luci+ pppoe + some packets. 500кб от nand free and 10mb RAM free.

(Last edited by alecs-art on 5 Sep 2013, 14:21)

hi, guys!

my DIR-632 is totally bricked. can you provide me with boot loader ?

Old computer junk been using your image, and has been working well. Do we just follow your build procedure for newer builds and apply your patch to that? Very new to openwrt not sure how and upgrade could happen. I'd love to continue using openwrt on this router since it's been working very well.