WR841N(D) V7 USB 2.0 Mod

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Hardware DIY / Hardware Mods
Goto page 1, 2, 3, 4  Next
Author Message
Simon94
DD-WRT Novice


Joined: 24 Jul 2009
Posts: 32

PostPosted: Sat Jan 22, 2011 18:04    Post subject: WR841N(D) V7 USB 2.0 Mod Reply with quote
Hi, here is the result after some hours of testing and research..

Serial port pinout:


USB 2.0 pinout:

You have to add an power supply for the USB port. I just used an 7805. It works very vell.


At the moment, the USB Port only works with OpenWRT trunk + Kernel Patch. The WR841ND V7 seems to be mostly the same as se WR741ND V2, so you have to build OpenWRT for WR741ND.
Code:
--- a/files/arch/mips/ar71xx/Kconfig
+++ b/files/arch/mips/ar71xx/Kconfig
@@ -167,6 +167,7 @@
        select AR71XX_DEV_AP91_PCI if PCI
        select AR71XX_DEV_GPIO_BUTTONS
        select AR71XX_DEV_LEDS_GPIO
+       select AR71XX_DEV_USB
        default n
 
 config AR71XX_MACH_TL_WR841N_V1
--- a/files/arch/mips/ar71xx/mach-tl-wr741nd.c
+++ b/files/arch/mips/ar71xx/mach-tl-wr741nd.c
@@ -20,6 +20,7 @@
 #include "dev-ap91-pci.h"
 #include "dev-gpio-buttons.h"
 #include "dev-leds-gpio.h"
+#include "dev-usb.h"
 
 #define TL_WR741ND_GPIO_LED_QSS                0
 #define TL_WR741ND_GPIO_LED_SYSTEM     1
@@ -99,6 +100,8 @@
        u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
        u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
 
+       ar71xx_add_device_usb();
+
        ar71xx_add_device_m25p80(&tl_wr741nd_flash_data);
 
        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wr741nd_leds_gpio),


Here you can see, that it works very well. I connected an USB Hub to the router.
Code:

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ar71xx-ehci ar71xx-ehci: Atheros AR91xx built-in EHCI controller
ar71xx-ehci ar71xx-ehci: new USB bus registered, assigned bus number 1
ar71xx-ehci ar71xx-ehci: irq 3, io mem 0x1b000000
ar71xx-ehci ar71xx-ehci: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
[....]
USB Mass Storage support registered.
usb 1-1: new high speed USB device using ar71xx-ehci and address 2
usb 1-1: configuration #1 chosen from 1 choice
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usb 1-1.4: new high speed USB device using ar71xx-ehci and address 3
usb 1-1.4: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
scsi 0:0:0:0: Direct-Access     SanDisk  Cruzer Blade     1.00 PQ: 0 ANSI: 2
sd 0:0:0:0: [sda] 31250432 512-byte logical blocks: (16.0 GB/14.9 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI removable disk


A Benchmark...
Code:
root@OpenWrt:/# hdparm -t /dev/sda
/dev/sda:
 Timing buffered disk reads:   50 MB in  3.11 seconds =  16.07 MB/sec


Last edited by Simon94 on Wed Feb 02, 2011 15:25; edited 1 time in total
Sponsor
Simon94
DD-WRT Novice


Joined: 24 Jul 2009
Posts: 32

PostPosted: Wed Feb 02, 2011 0:07    Post subject: Reply with quote
Hope there will be USB support for DD-WRT soon!

The old Wiki post: http://www.dd-wrt.com/wiki/index.php?title=TP-LINK_TL-WR841ND

I dont like wiki-posting, so i´wont update it!!


Greets, simon94!
DrStein
DD-WRT Novice


Joined: 19 Feb 2011
Posts: 12

PostPosted: Sat Feb 19, 2011 9:06    Post subject: Reply with quote
Hi people!
Is there any success with patching WR841N v7 for USB 2.0?
Simon94
DD-WRT Novice


Joined: 24 Jul 2009
Posts: 32

PostPosted: Sat Feb 19, 2011 15:04    Post subject: Reply with quote
DrStein wrote:
Hello!
Have you succeded in patching kernel for this device? If YES, please, post your results or answer me in pm.
Thanks in advance!


Simon94 wrote:
are you from Germany? Können wa ja Deutsch reden.. Ja, nein. DD-WRT hat keine USB Unterstützung für ar71xx mit 4MB flash. Ich habe lediglich die USB initialisierung zum OpenWRT Kernel hinzugepatcht und dann gings auf anhieb... Kann auch bei Interesse mal ein fertiges Image hochladen, indem extroot und all das Gedösn enthalten ist... Läuft Spitze, einzig der Compat-Wireless Treiber sollte mal wieder ein Update erfahren..Der WLAN Support ist soo schlecht... Grüße, Simon

arent you from germany? its ok too Smile No, DD-WRT dont has USB Support for ar71xx units with 4mb flash, such like the wr841nd. what i´ve done is adding the usb initialisation to the openwrt kernel... it just works then Smile if you want, i can send you my image including block-extroot and all that stuff for mounting USB as Rootfs... It works very well. Only the wifi support for ath9k isnt really good...Hope they will update the Compat-Wireless drivers Smile

regards from germany..
Simon94
DD-WRT Novice


Joined: 24 Jul 2009
Posts: 32

PostPosted: Mon Feb 21, 2011 18:26    Post subject: Reply with quote
Thats the Result:







My latest OpenWrt Build (r25488 + block-extroot + ext2):
http://rapidshare.com/files/449145575/841ndv7usb.zip

How to mount an USB Storage as root fs.
DrStein
DD-WRT Novice


Joined: 19 Feb 2011
Posts: 12

PostPosted: Wed Feb 23, 2011 8:52    Post subject: Reply with quote
Trying to flash my TL-WR841N v7.1 with images provided by Simon94 (openwrt-ar71xx-generic-tl-wr741nd-v1-squashfs-factory.bin), I get an Error 18005:
"Upgrade unsuccessfully because the version of the upgraded file was incorrect. Please check the file name"



I also tried to rename it to openwrt-ar71xx-generic-tl-wr841nd-v7-squashfs-factory.bin. The same result. Confused

Factory firmware version is 3.12.5 Build 101125 Rel.33533n seems to be the latest.
Simon94
DD-WRT Novice


Joined: 24 Jul 2009
Posts: 32

PostPosted: Sat Feb 26, 2011 16:48    Post subject: Reply with quote
You can´t flash it via Factory Webinterface because the header of the image isn´t correct.

Flash it directly via TFTP.

Or use the following steps:

First flash this
factory image via Factory webinterface.

Then just upgrade with the sysupgrade command to my build.
d314
DD-WRT Novice


Joined: 27 Feb 2011
Posts: 2

PostPosted: Sun Feb 27, 2011 23:36    Post subject: Reply with quote
Simon94 wrote:
Thats the Result:

...
My latest OpenWrt Build (r25488 + block-extroot + ext2):
http://rapidshare.com/files/449145575/841ndv7usb.zip

How to mount an USB Storage as root fs.


Hello Simon94!

I've tried to flash your firmware successfully,
now the router is working but there seem to be a problem with telnet access (the only possible as I underestood from nmap report on open ports).

Do I have to invoke telnet with some special switches, instead of simple
telnet 192.168.1.2 (my wr841nd ip).
In my case this command returns:
telnet 192.168.1.2
Trying 192.168.1.2...
Connected to 192.168.1.2.
Escape character is '^]'.
Login failed.
Connection closed by foreign host.

Thanks in advance
Simon94
DD-WRT Novice


Joined: 24 Jul 2009
Posts: 32

PostPosted: Tue Mar 01, 2011 10:54    Post subject: Reply with quote
I´m using PuTTY and that worked on the first try..

You changend the IP? Is it working, without changing the ip? (default should be 192.168.1.1)
DrStein
DD-WRT Novice


Joined: 19 Feb 2011
Posts: 12

PostPosted: Tue Mar 01, 2011 13:17    Post subject: Reply with quote
Here is the result of my efforts:
To obtain 5V supply, I used broken ADSL modem D-Link, which has three DC-DC converters from 12V to 5V, 3.3V and 1.5V.



I simply cut one of them (for 3.3V) and with minimal modification placed it to my WR841N


Click here to view full size image

In addition there was soldered shield over WiFi module and pasted heatsink to processor as it used to be in hw rev.5 of this device.



After finishing all hardware hacks I get the following errors from kernel
    ...
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    ar71xx-ehci ar71xx-ehci: Atheros AR91xx built-in EHCI controller
    ar71xx-ehci ar71xx-ehci: new USB bus registered, assigned bus number 1
    ar71xx-ehci ar71xx-ehci: irq 3, io mem 0x1b000000
    ar71xx-ehci ar71xx-ehci: USB 2.0 started, EHCI 1.00
    usb usb1: configuration #1 chosen from 1 choice
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    nf_conntrack version 0.5.0 (462 buckets, 1848 max)
    usb 1-1: new low speed USB device using ar71xx-ehci and address 2
    usb 1-1: device descriptor read/64, error -71
    usb 1-1: device descriptor read/64, error -71
    nf_conntrack_rtsp v0.6.21 loading
    usb 1-1: new low speed USB device using ar71xx-ehci and address 3
    usb 1-1: device descriptor read/64, error -71
    ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    usbcore: registered new interface driver cdc_acm
    cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters
    usb 1-1: device descriptor read/64, error -71
    usbcore: registered new interface driver usblp
    usb 1-1: new low speed USB device using ar71xx-ehci and address 4
    usb 1-1: device not accepting address 4, error -71
    usb 1-1: new low speed USB device using ar71xx-ehci and address 5
    cfg80211: Calling CRDA for country: UA
    cfg80211: Regulatory domain changed to country: UA
    cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
    cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
    usb 1-1: device not accepting address 5, error -71
    hub 1-0:1.0: unable to enumerate USB device on port 1

Without external USB HUB connected kernel log looks like this
Code:
...
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PCI: Setting latency timer of device 0000:00:00.0 to 64
ath: EEPROM regdomain: 0x0
ath: EEPROM indicates default country code should be used
ath: doing EEPROM country->regdmn map search
ath: country maps to regdmn code: 0x3a
ath: Country alpha2 being used: US
ath: Regpair used: 0x3a
ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
Registered led device: ath9k-phy0
ieee80211 phy0: Atheros AR9287 Rev:2 mem=0xb0000000, irq=48
cfg80211: Calling CRDA for country: US
PPP generic driver version 2.4.2
PPP MPPE Compression module registered
GRE over IPv4 demultiplexor driver
ip_tables: (C) 2000-2006 Netfilter Core Team
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ar71xx-ehci ar71xx-ehci: Atheros AR91xx built-in EHCI controller
ar71xx-ehci ar71xx-ehci: new USB bus registered, assigned bus number 1
ar71xx-ehci ar71xx-ehci: irq 3, io mem 0x1b000000
ar71xx-ehci ar71xx-ehci: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
nf_conntrack version 0.5.0 (462 buckets, 1848 max)
cfg80211: Regulatory domain changed to country: US
cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
cfg80211:     (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
nf_conntrack_rtsp v0.6.21 loading
nf_nat_rtsp v0.6.21 loading
Ebtables v2.0 registered
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
usbcore: registered new interface driver cdc_acm
cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver usblp
...

Need help Sad[/url]


Last edited by DrStein on Wed Mar 02, 2011 13:08; edited 4 times in total
Simon94
DD-WRT Novice


Joined: 24 Jul 2009
Posts: 32

PostPosted: Tue Mar 01, 2011 14:25    Post subject: Reply with quote
Please make some better pictures with a higher resolution.. Cant see, if its soldered well.

To figure out, if its soldered correctly, just measure the resistor beetween every Data line and ground.


From D+ to D-: 30kΩ
From D-/D+ to GND: 15kΩ.

What about the voltage? Are the 5Volts stable? If not, try to use an another power supply.
DrStein
DD-WRT Novice


Joined: 19 Feb 2011
Posts: 12

PostPosted: Wed Mar 02, 2011 12:15    Post subject: Reply with quote
Wires seem to be soldered correctly (I checked resistances). 5V supply is stable even with external HDD connected, but I can't check level of harmonics without oscillograph (they are most probably present because of impulse DC-DC converter used)
DrStein
DD-WRT Novice


Joined: 19 Feb 2011
Posts: 12

PostPosted: Wed Mar 02, 2011 15:03    Post subject: Reply with quote
Looking carefully at Simon's photos I found that I mixed up D+ and D- Exclamation
Fixing this stupid bug I finally get USB working on my router Very Happy

Special thanks to Simon94 and DANtes (from http://sat-forum.su/index.php)

P.S. In order to prevent other users from such mistake be careful: R601 must be attached to GREEN wire of USB-cable and R602 - to WHITE
DrStein
DD-WRT Novice


Joined: 19 Feb 2011
Posts: 12

PostPosted: Tue Mar 08, 2011 11:31    Post subject: Reply with quote
How can I install kernel modules if I have my router flashed with trunk kernel v2.6.32.27 (from Simon94) and latest trunk packages are already v2.6.37.1 incompatible with my kernel?
DrStein
DD-WRT Novice


Joined: 19 Feb 2011
Posts: 12

PostPosted: Thu Mar 10, 2011 17:02    Post subject: Reply with quote
FIXED!
Packages provided by Nilfred are exactly the same version as Simon's kernel
Goto page 1, 2, 3, 4  Next Display posts from previous:    Page 1 of 4
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Hardware DIY / Hardware Mods All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum