1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tomato ND USB Mod

Discussion in 'Tomato Firmware' started by teddy_bear, Dec 17, 2008.

  1. ray123

    ray123 LI Guru Member

  2. ray123

    ray123 LI Guru Member

    You could probably make a script to do this, but.......
    On my 16MB 520-GU, the router usually crashes when I do fsck. I think that this router just doesn't have enough RAM. I'll do some more experimenting when I get my USB fixes integrated into the latest build.
  3. jnappert

    jnappert LI Guru Member

    Right. I could do "e2fsck /dev/discs/disc0/part1" in a script. But as this has to be done before mounting i do not know, where to place it...

    BTW: I use the "automount" feature.
  4. trevorw

    trevorw LI Guru Member

    Hi guys,

    teddy_bear, just want to report that build 39 works fine on my wl500Pv1. I've upgraded from 32 (uptime over 100 days) to 37 then to 39 and things are moving nicely along, no hiccups whatsoever. Thanks for all the work!

    I have a question regarding logging - I'd like to have the logs hosted on the usb. Currently I have a symlink (created at init time) based on Ray's suggestion from a while back:
    ln -s /mnt/USB/tomato/syslog /var/log/messages 
    The problem is that, by default, syslogd rotates the script every 50kb (afaict) so the link gets renamed and a new /var/log/messages file gets created. Do you have any suggestions on how I can fix this? I could pass -s 0 to syslogd at startup but I couldn't figure out how? Can this setting be added to the Tomato UI?

    P.S. I've looked around the router but I couldn't find any /etc/syslogd or any relevant parameter in the nvram.

  5. michalg

    michalg Addicted to LI Member

    #trevorw: Hi, I write a little script (in USB Support > Run after mounting) to doing this and works fine :)

    if [ -e /var/log/messages ]
     echo -e "\n --------------------- \n" >> /mnt/disc0_1/log/messages
     cat /var/log/messages >> /mnt/disc0_1/log/messages
     rm /var/log/messages
    mount -o bind /mnt/disc0_1/log /var/log
    Try this! :)
  6. trevorw

    trevorw LI Guru Member

    @michalg Thanks! Excellent idea to mount the whole log folder. I had to use different mounting points (/mnt/<LABEL> instead of /mnt/disc0_1) but other then that everything is identical.
    The reboot seems to be a tag slower though now .. maybe it's just me.
    What are the chances of losing any messages between the deletion of /var/log/messages and mounting the new folder?

    Cheers and thanks again for the script!
  7. trevorw

    trevorw LI Guru Member

    By the way, I've tried moving everything into a script on the USB so I can adjust the script w/o going through the interface and writing to router nvram but I can't succeed.
    I've moved the script above into a separate file, added a #!/bin/ash as the first line but I get a cryptic:
    root@router:/tmp/mnt# ls -al /mnt/USB/tomato/use-usb-log.sh
    -rwxrwxrwx    1 root     root          477 Nov 27 15:46 /mnt/USB/tomato/use-usb-log.sh
    root@router:/tmp/mnt# /mnt/USB/tomato/use-usb-log.sh
    -sh: /mnt/USB/tomato/use-usb-log.sh: not found
    Any ideas why this happen?
  8. michalg

    michalg Addicted to LI Member

    I tested this script and no messages are losing :)
  9. trevorw

    trevorw LI Guru Member

    Things seem to be okay on my side as well - I was just wondering whether there are any possible race conditions while the script is being executed.

    In other news, any suggestions how I can move the script into a file ?
  10. mwsealey

    mwsealey Addicted to LI Member

    I'm using WDS because it works; but I'd rather use WET. I'm using v39 on all routers. I just can't get them to talk to each other in WET mode.

    I have 3 WRT54G-TMs and I can probably ditch one of them from my network :)

    I also have a WRT54GS v6 which I believe has DD-WRT on it still, this isn't going to be much good for 2.6, but at least I can go and try WET on that to see if it's working here or there.

    I need to go find my JTAG and serial connector, they're in a box somewhere.. didn't need them after they flash perfectly every time from the web UIs..
  11. soul

    soul Guest

    is there a software that cycles through the external hard drive? I have a 1TB seagate HD and when it falls asleep sometimes when it's reaccess it freezes the USB portion of the router completely, i have to restart the router to access it.

    is there a software i can install on my computer that will just refresh that network drive?
  12. Rasky

    Rasky Addicted to LI Member

    teddy_bear, I'm trying the new WINS support. If I check the "wins server" setting in the "USB and NAS" page, and I remove the manual WINS configuration in the "Basic Network" page (defaults to, it looks like the dhcp is not getting configured as expected. In fact, dnsmasq.conf shows:


    So, even if smbd is acting as WINS server, dnsmasq is not advertising it.
  13. teddy_bear

    teddy_bear Network Guru Member

    Why do you think it's not?
    According to dnsmasq manpage, the special address is taken to mean "the address of the machine running dnsmasq" when used in dhcp-option. In my testing, Windows clients reported WINS server IP address correctly.
  14. trevorw

    trevorw LI Guru Member


    Try adding a cron job which does a basic, cheap IO operation (like touch/cat/rm/cp). I had the same problem windows where I used autohotkey to create a file and delete it every 10 minutes or so to prevent the external drive from sleeping.
    You need to do some experimenting with what's the cheapest operation that keeps the hdd awake - on my xp, touch or modifying the file attributes didn't do the trick.

    Hope this helps.
  15. trevorw

    trevorw LI Guru Member

    Just saw Tomato 1.26 was released. Looking forward to the USB mode for it ;)
  16. ray123

    ray123 LI Guru Member

    Depending on where you have the script, the timing can get tricky. USB drives can take a long time to completely mount--especially if it's ext3.

    [edit] Ahhhhhh. the "not found" message is probably because it can't find the shell you've specified in the first line. It's stupid that way--it tells you it can't find something, but the something isn't what it reports.

    What I do is to create scripts/files somewhere in /tmp, and then save it with "nvram setfile2nvram filename". These will get automatically restored early in the startup process.

    Another thing that might work (if TeddyBear incorporated my patch of a couple of months ago): Put the script in the top-level directory on a USB drive, with the suffix ".autorun". These will get executed when (and only when) the drive auto-mounts. I use this method to start a watchdog program and a torrent client.

    The syslogd in Tomato doesn't have a config file and the filename is hardcoded. You can change the turnover size by killing syslogd and restarting it with a different "-s" parameter. I don't recall if Tomato ever restarts syslogd--if so then your parameters will of course be reset.

    Or--and this is what I do--set up a syslog catcher on your desktop ( like http://www.sysrose.com/ ) and enable remote logging via the GUI. 'course this won't work unless your desktop computer is up.

    All in all, mounting with -obind of /var/log is probably the best way to go.
  17. Rasky

    Rasky Addicted to LI Member

    Right, sorry for the noise. And thanks for adding this feature!
  18. were55

    were55 Addicted to LI Member

    Error with USB HDD

    Hi TB, I'm having some problems with my HDD. Three days ago I bought a HDD enclosue, it's a Vantec with power management feature, it works great but seems like after went to "power down" sometimes it`s not "waked up". In "USB Support" page is mounted (I have two partitions, first it's FAT32 and second it's EXT3) but when I try to access it under windows (XP or 7, is the same), I received a network error. If I try to login (using ptty and SSH) the router prompt for login (some strange things happen with enclosure, it waked-up) and then for password, I can not access to the shell, if I try to reconnect in windows, I received an error again. All this is fixed after a router reboot. These are some of the errors that I saw in log:

    Nov 28 21:56:17 ZERA-DISC authpriv.info dropbear[6390]: Child connection from
    Nov 28 21
    :56:38 ZERA-DISC user.alert kernelUnable to handle kernel paging request at virtual address 7f7f7d58epc == 8000e5c0ra == 80004b40
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernelOops in fault.c::do_page_faultline 206:
    Nov 28 21:56:38 ZERA-DISC user.warn kernel: $00000000 1000dc01 801933c0 00000010 7f7f7d58 00000010 ffffffff 00000000
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernel: $ffffffff ffffffff 00030001 00030001 ffffffff 8058a000 1000dc01 801a0000
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernel: $1600000000 7f7f7d48 7f7f7d60 00434060 8058bf30 0000000b fffffff2 80a3a154
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernel: $2400000001 2ab3d1c0                   8058a000 8058be70 8058a3d0 80004b40
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernelHi 00000000
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernelLo 00000001
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernelepc   8000e5c0    Tainted
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernelStatus1000dc03
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernelCause 00000008
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernelPrId  00029029
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernelProcess dropbear (pid6390stackpage=8058a000)
    Nov 28 21:56:38 ZERA-DISC user.warn kernelStack:    00000001 8000b508 00000007 8058bf30 0000000b 00030001 00000000
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernel:  7f7f7ffc 00000000 00000000 fffffffe 801a0000 00000000 00000000 fffffffe
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernel:  801a0000 1000dc00 00449a38 00000000 ffffffff 004496d0 c017d624 fffffffe
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernel:  801a0000 1000dc00 00449a38 00000000 80180000 80018400 80018400 00000bfe
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernel:  00449a38 80ff83a0 807e4460 0000004a 0000004a 80037d90 7f7f7d58 00000001
    Nov 28 21
    :56:38 ZERA-DISC user.warn kernel:  0000004a ...
    Nov 28 21:56:38 ZERA-DISC user.warn kernelCall Trace:   [<8000b508>] [<c017d624>] [<80018400>] [<80018400>] [<80037d90>]
    Nov 28 21:56:38 ZERA-DISC user.warn kernel:  [<8000555c>] [<8005c3bc>]
    Nov 28 21:56:38 ZERA-DISC user.warn kernelCode244233c0  94430044  94450030 <8c82000000003021  8c820004  00003021  3c02b800  00031823 
    I will try with previous versions and post results.

  19. teddy_bear

    teddy_bear Network Guru Member

    The ability to wake the HDD up from sleep mode doesn't exist in kernel 2.4 at all. It was added to this mod a while ago - there is a backport of this feature from 2.6 - but it's very limited in terms of what HDDs it works with. For example, works great with my new 1TB WD, but doesn't work with older Maxtor.

    You can try built-in scsi-start utility (there's a link to some description from the 1st post) - but it also only works with a few models.

    If you want to use this HDD/enclosure with the router, the other way is to keep it always awake (there was some discussion about this a few posts above).
  20. trevorw

    trevorw LI Guru Member

    Thanks for the reply ray123!
    I'm trying to move the script out of the router since I made various minor adjustments to it and to avoid writing to the nvram, I figured I'll place it on the USB stick.

    I've started experimenting with some scripts. First some env info:
    root@router:/# ls -al /bin/*sh
    lrwxrwxrwx    1 root     root            7 Nov 19 20:45 /bin/ash -> busybox
    lrwxrwxrwx    1 root     root            7 Nov 19 20:45 /bin/sh -> busybox
    root@router:/# mount
    rootfs on / type rootfs (rw)
    /dev/root on / type squashfs (ro)
    none on /dev type devfs (rw)
    proc on /proc type proc (rw)
    tmpfs on /tmp type tmpfs (rw)
    usbdevfs on /proc/bus/usb type usbdevfs (rw)
    /dev/discs/disc0/part1 on /tmp/mnt/USB type vfat (rw,noatime,nodev)
    As you can see both ash and sh are under bin (though they are symlinks to busybox afaict) and the USB fs is fat. I've added a basic script which does an echo:
    echo "Foo"
    Once I add the #!/bin/ash or #!/bin/sh as the first line to the script, I get the "not found" message. Otherwise the script works so I started migrating the other script (that works fine when it's being executed by tomato) to the new one.
    I modified "echo" to concatenate to a file:
    echo "Foo" >> /mnt/USB/tomato/test
    (which works fine when executed directly in the Tomato shell) but the script gives:
    root@router:/# echo "Foo" >> /mnt/USB/tomato/test
    root@router:/# /mnt/USB/tomato/basic.sh
    : Invalid argumentato/basic.sh: line 1: can't create /mnt/USB/tomato/test
    From what I can tell, there's clearly a difference between how the scripts are being ran and the actual shell that I'm (and potentially Tomato) is using for executing commands but I have no idea why is that or how I can change this behaviour.
  21. teddy_bear

    teddy_bear Network Guru Member


    1. First line of the script should be:

    2. There should be no DOS caret returns characters in the script file. If you edit it with Notepad or some other DOS/Windows editors, the may (will) save the file with DOS caret returns. You can use vi or WinSCP editor.

    3. Your script file must be executable:
    chmod +x <your_script_file_name>
  22. trevorw

    trevorw LI Guru Member

    Thanks teddy_bear! The windows end-of-lines were the problem indeed (an extra CR was added before the LF).

    In other news, I've looked through the logs and they are full of the following messages:
    Nov 28 11:06:19 router daemon.notice miniupnpd[181]: upnp_event_send: send(): Connection refused
    Any ideas why this happen? Are there any logging options that can be set on the UPnp server to make it more verbose (and can these be included in the UI as well)? I assume some computer/program on the lan might be to blame but I couldn't find anything relevant so far and google didn't return anything useful.

  23. ray123

    ray123 LI Guru Member

    It's not just the disk---it's also the USB chipset in the external enclosure. For example, the Genesis chipset does not support the "sleep" command. Bummer for me, because that's what is in my APower enclosure. (OTOH, it came with a 160GB WD drive all for only $47.)

    Years ago I destroyed, independently, two expensive SCSI drives by configuring them to go to sleep. After a few months sticktion would prevent them from spinning back up unless I manually shook them to break the platter loose. Ever since then I've been leary.
  24. were55

    were55 Addicted to LI Member

    Hi TB, I was looking around and seems like my enclosure doesn`t support scsi-start utilities :frown:, here is the info:

    root@ZERA-DISC:/tmp/home/root# cat /proc/scsi/usb-storage-0/0
    Host scsi0: usb-storage
    Vendor: JMicron
    Product: USB to ATA/ATAPI Bridge
    Serial Number: 521FFFFFFFFF
    Protocol: Transparent SCSI
    Transport: Bulk
    GUID: 152d23390000521fffffffff
    Attached: Yes
    Port: 1.1
    Bus: 00:03.1-1.1

    Product=USB to ATA/ATAPI Bridge

    Vendor=152d ProdID=2339

    Also I was looking for a way to keep it awake but I can not find it, can you give me some clues ?

    thanks as always for you help.

  25. Aquafire

    Aquafire LI Guru Member

    NFS server on Linksys with Tomato

    Hello All,

    It maybe a stupid question. However I was wondering the follownig scenarios :

    1. Is it possible to run a NFS server inside Tomato 1.37 on a Linksys WRTSL54GS (USB storage port). Just needed that to access some shares on my attached USB harddisks via my linux based machines and media box (Egreat EGM34a). Was thinking of that since I was able to do it on a WD MyBook World Edition 1TB NAS by installing the correct optware package from NSLU2 repository (ipkg command). Is there any chance that we can run or add similar functionality to tomato and can configure the shares.

    2. I have mapped a Windows Share on my PC as a CIFS share on my router running tomato . It is mounted in the /root/cifs1 directory on Linksys router. However it is only visible from inside the router to the native filesystem. Is it anyway I can share the CIFS folder like regular SAMBA shares, which have to be configured in the Network Shares menu, so they can be accessed by any other PC when browsing the shared folder on the router. It is apparent that the network shares are only possible for the devices attached directly to the router's USB port.

    One small thing is that since many previous versions I have noted and even notified on the forum, that the Green LED (SES Button) on my Linksys WRTSL54GS is not lit anymore. Maybe it would be the same with other users using other brands/models of routers. It was working fine with quite earlier versions. I tried to ask it earlier without any working fix. If you can teddy then we would appreciate a fix.

    Thanks for a patient reading and helping in advance.
  26. teddy_bear

    teddy_bear Network Guru Member


    The clue you're looking for is on the previous page:


    1. Why do you need NFS? Can't you access Samba shares from your linux machines and media box? And - if you were able to find and install the Optware packages for your WD NAS, I suppose you should be able to install the same Optware on the router to get the functionality needed.

    2. Samba network shares are not limited by the devices attached to the USB port. You can share any directory, including cifs1, cifs2 etc... You just need to specify such shares manually via web GUI as "auto-share" feature only works for USB drives.
  27. teddy_bear

    teddy_bear Network Guru Member

    Update - build 40
    • Merged with official Tomato 1.27 update.
    • Added ID for Asus WL-500W (untested).
    • Cosmetics and minor fixes.
    Known issues with this build:
    • Some of the USB printers may not be recognized properly.
    • WET mode might be broken for some routers/configurations.

    Links to the firmware binaries and the git repository with sources are in the 1st post. The complete source code of this build can also be downloaded as a git snapshot in tar format.
  28. Aquafire

    Aquafire LI Guru Member

    Thanks Teddy,

    Well I was trying to install NFS server since I did not know how to add custom shares to the SAMBA configuration other than the attached USB storage devices. So infact I was opting for question no 1 of mine which you answered in question numbers 2.

    So just for the dumb myself can you please mention what syntax and command do I need to write for custom samba configuration in order to share any other internal folders else than Auto-Mount USB shares. I would appreciate if you can please write an example for sharing the internal CIFS1 share which is already mapped to a local Windows Share on my PC.

    I believe Windows user authentication for the shared folder for the following share mapping should not be an issue :
    Samba Share ---> CIFS1 ---> Windows Share mapping
    because the User Name and Password / Windows PC share name are already entered in the CIFS share configuration via the Web-GUI. Please correct if anything needs to be straightened over here.

  29. teddy_bear

    teddy_bear Network Guru Member

    Hmm... Looks like you're trying to compilcate simple things ;)... No custom configurations is needed. Just enter your shares in the GUI under "Network Shares List"...

    And yes, you're right about the Windows authentication - it won't be an issue once you have CIFS share successfully mounted.

    However, it may not be a very good idea to re-share your Windows shares via CIFS->Samba, as in this case I believe the file transfers - instead of going directly between the computer sharing files and the client - will go through your router.
  30. horhe

    horhe Addicted to LI Member

    Loaded version 1.27 (tomato-NDUSB-8740-Ext) on my WL-520gU, so far so good... :)
  31. Aquafire

    Aquafire LI Guru Member

    Well not exactly trying to muck up anything.

    My problem is my MediaTank (Egreat) only likes to see SAMBA and NFS shares and it is fine for all my collection which is hosted on my WD Mybook NAS device. Since the NAS device offers the content via SAMBA shares which can be seen and operated by both the PC and the MediaTank.

    However if I want to share a folder on my Windows PC (which contains media files) and try to browse to this folder via MediaTank then it is invisible , since it cannot see usual Windows shares. For that I either have to install SAMBA service or I have to install NFS server on my Windows PC. Unfortunately there is no easy and standard way of doing it and they require quite some bit of configuration and there aren't any free reliable software for windows to install these services the easy way.

    So i thought of the alternative of mapping a CIFS share to my Windows PC from the router. And then share this mapped CIFS share from the router as a SAMBA share, which would be seen by the MediaTank and hence it can play files from my PC too. At least in theory. That was the objective.

    However to tell you, i have already tried sharing the mapped CIFS share by entering it name and path in the Network Shares list in the Tomato Web GUI. However it is not accessible, it can be seen as a shared folder on the PC when I browse to the router by entering it Network name "\\myrouter", however when i click this folder I cannot access and see the contents. The usual windows message box telling me that it is not possible.

    Any idea what could be wrong over here.

  32. teddy_bear

    teddy_bear Network Guru Member

    No idea. Works absolutely fine here - just tested it again. Mounted Windows XP share as CIFS on /cifs1, created Samba share to allow RW access to /cifs1, and was able to access it from other Windows clients with no problems.

    The only issue is a very high CPU usage on the router when transferring large files.
  33. freddyspam

    freddyspam Addicted to LI Member

    I'm having issues with the latest build. Just a reminder, I have my router set up in wireless bridge mode. After updating, the asus 520gu connects with my main router, but I am locked out of the GUI both through wireless and lan. The lan never assigns an ip. I tried disconnecting the usb drive and rebooting, but there was no change in behavior.

    The part that worries me is that it may have corrupted my ext2 partition. I have a script that saves the system log to that partition every so often but especially after it boots up. I tried recovering that log for you, but I cannot get any machine to recognize the partition. With ext2 ifs, windows 7 and windows xp tell me to format the drive. Using a mac, I cannot get the partition to show at all.

    I'm not sure if the drive issue and the gui/internet problem are related. I haven't tried reloading v39 yet. This was all last night. This morning, I woke up with the flu. So I can't do much more for right now as far as testing goes.

    If you can think of anything for me to try, you can go ahead and send them, and I'll get to them when I feel better. Thanks again for all your time.
  34. teddy_bear

    teddy_bear Network Guru Member

    Wireless could be an issue as I'm trying to find the right balance between wl settings for different configurations (there were some complains about wet mode not working properly a few pages back), so I made a minor change there... However, there was absolutely no changes in this mod that could affect LAN connectivity (in fact, there are very few changes since the last build in the mod itself) - unless the problem is in the Tomato update itself.

    Maybe you only need to reboot, or restore default settings and reconfigure? That should at least bring you the LAN access back. As for the WET mode - what security settings are you using?
  35. freddyspam

    freddyspam Addicted to LI Member

    I tried rebooting but not restoring the default settings. The security is setup as WPA AES. In my main router, I can see the wireless bridge as connected. This after I rebooted both routers. I'm guess that it's getting stuck somewhere in the boot up sequence. I'll try both the default settings and re-flashing and report back.
  36. greenythebeast

    greenythebeast LI Guru Member

    Had a question regarding my Xbox 360. I have a DMZ set up to (my Xbox's IP) as well as having NAT-PMP setup so the port is forwarded to the Xbox. Yet even with these settings as such I sometimes get a Moderate NAT type on a Live connection test. What am I doing wrong?
  37. trevorw

    trevorw LI Guru Member

    Been running build 40 for 15h and everything seems to be running just fine (utorrent, skype and the usual browsing). Thanks a lot!
  38. toolbox

    toolbox Addicted to LI Member

    Teddy_bear, any plan to build one with VPN?
  39. horhe

    horhe Addicted to LI Member


    Seems to me that your X-Box may not be picking up the same IP every time. You might want to go to Tomato's Basic/Static DHCP, and punch in your X-Box's MAC address in there.

    But on the other hand, without using DMZ, NAT/PMP should work as long as to make sure that you also check uPnP.

    Hope this helps! ;-)
  40. greenythebeast

    greenythebeast LI Guru Member

    I already have it setup under Static DHCP, so that can't be the problem. :(
  41. Aquafire

    Aquafire LI Guru Member

    Thanks Teddy,

    Figured out the mistake. I was sharing via samba by writing "/root/cifs1" instead of just "/cifs1".

    Working now.
  42. acollado

    acollado Addicted to LI Member

    Is there any way to enable SFTP for WAN side file transfers?
  43. ghostknife

    ghostknife Addicted to LI Member

    Hey I just got one of these Egreat M31B the other day and had a nightmare to [sort of] get it working so far. It has really annoyed me that the manual is sooo useless and doesn't help at all with this. I had to figure out that it wanted the windows share in this syntax:


    You need to go into the setup and add a network share such that under source you will see it as a separate item. After that i was able browse and access the XP share I had with all the files. I also tried using windows media player as a server and even that doesn't work 90% of the time, it appears in the list but you select it, wait 3 mins of it to search and then annoyingly find no files, then occasionally it works, wtf?
    Also I think that it can't cope with browsing the network if your workgroup isn't called 'workgroup' which is just stupid. I haven't changed mine to test but I suspect this is the case because I get error that "domain master browser for workgroup could not be [accessed/found]"
  44. gingernut

    gingernut LI Guru Member

    Teddy Bear,

    I thought that the Asus WL-500W already had support in your builds?
  45. teddy_bear

    teddy_bear Network Guru Member

    Update - build 41

    Hot-fix for a couple issues introduced in build 40.
    • Resolved: some of the USB printers may not be recognized properly.
    • Resolved: wireless bridge (WET) mode might be broken for some routers/configurations.
    Both of these bugs were introduced in the build 40 for the first time, so if you had similar issues prior to that, this build probably won't fix them.

    Links to the firmware binaries and the git repository with sources are in the 1st post. The complete source code of this build can also be downloaded as a git snapshot in tar format.

    USB+VPN combined build is also available - based on the SgtPepperKSU' last released vpn3.4 mod and Extras version of the USB mod with full NTFS support. USB+VPN build is untested - use at your own risk.
  46. teddy_bear

    teddy_bear Network Guru Member

    Yes (with no N-mode support). The latest builds should only display the router model properly, and hopefully the button on the back should work now. But it's untested - so I need some feedback whether or not it's working.
    Sure, there's a way... Install Optware openssh-sftp-server package.
  47. viralmind

    viralmind Addicted to LI Member

    Build tomato-NDUSB-8741-Ext.trx works fine on wl500w

  48. teddy_bear

    teddy_bear Network Guru Member

    Can you let me know if the router model is displayed correctly now, and if the button on the back works or not?
  49. viralmind

    viralmind Addicted to LI Member

    yes display properly /wl500w / and what type button do you think? reset? easy setup?
  50. teddy_bear

    teddy_bear Network Guru Member

    Actually, both buttons... But mostly "Easy setup" (SES button) - it should perform functions you specify on the "Administration->Buttons/LED" page. Also, while you keep this button pressed, the router should blink the power LED every second. I'd like to know if this works now.
  51. viralmind

    viralmind Addicted to LI Member

    well, i never used this feature but i tried to 4-6 sec option and the reboot works fine.
    i did not test other function.
  52. teddy_bear

    teddy_bear Network Guru Member

    Looks like it's working then :). Not very important, but convenient feature.
    Thanks for testing!
  53. viralmind

    viralmind Addicted to LI Member

    You're welcome! ;-) and sry my english:)
  54. teddy_bear

    teddy_bear Network Guru Member

    Merged USB+VPN build 8741

    Added merged USB+VPN build 8741 vpn3.4 to the download locations. Now based on Tomato 1.27, and with full read/write NTFS support.

    As with all previous USB+VPN builds, this build is not tested - use at your own risk.
  55. toolbox

    toolbox Addicted to LI Member

    Teddy_bear, thank you for the build.
    Loaded it to my Asus WL-520gU and notice it doesn't keep track of data transferred. When I click on bandwidth -> daily, it shows 0 bytes upload/download. Don't know if this has something to do with I am storing the usage data outside of the router or not. This version "seems" to run slower than 1.25 as well.
    I am back to 1.25 but may give it another try later on.
  56. george993

    george993 Addicted to LI Member

    Thank you so much.... Everything seems to be working so far. Thanks again.

  57. Mastec

    Mastec Network Guru Member

    Couple errors popped up and have no clue. If I run Tomato 1.27 with no mods these errors do not appear.

    user.err kernel: CIFS VFS: could not find file instance for new file 80167d20


    daemon.err miniupnpd[146]: upnp_event_recv: recv(): Connection reset by peer​
  58. teddy_bear

    teddy_bear Network Guru Member

    This could be related to some changes in official Tomato 1.26-1.27 (particularly - "Allow rstats to log if WAN port is used for LAN") - check out this post.
  59. teddy_bear

    teddy_bear Network Guru Member

    Are there any real problems other than the log messages? If not, I wouldn't worry about them.

    The reason is that both - CIFS and miniupnpd - have some changes compare to vanilla Tomato. CIFS was upgraded to ver 1.49 backported from kernel 2.6 (may output more log warnings), and miniupnpd is compiled with GENA UPnP events enabled (if your client rejects the events, miniupnpd writes these messages).
  60. trevorw

    trevorw LI Guru Member

  61. Mastec

    Mastec Network Guru Member

    Everything works perfect. I was just curious if they were something i needed to worry about. Thanks Teddy Bear
  62. toolbox

    toolbox Addicted to LI Member

    Thanks. It was my own fault. Once I enter the proper location for the CIFS client, BW starts to show up. I guess the CIFS client variables were not kept during the 1.27 upgrade.
  63. leesiulung

    leesiulung LI Guru Member

    I setup Samba and FTP on my Asus WL520gu, but the performance leaves a lot to be desired. It tops out around 200KB/s with Samba share and 500KB/s with FTP on both read/write.

    I know my hard drive is capable of much faster, so is this all I can expect out of this thing?

    I have been hearing reports of around 1-2 MB/s, but that's not what I'm getting. Maybe it is a settings issue? I use Tomato Mod v.1.27.
  64. DOug80638

    DOug80638 Addicted to LI Member

    Wl-520gu with v1.27.8741


    I have a 520 with a laser printer attached to the USB port.
    I've installed Tomato Firmware v1.27.8741 ND USB Lite on the 520, and I've run into the following problem.

    The wireless portion drops all connections and restarts when a large print is sent to the printer from a wireless connection. The good news is that the wireless restarts and the wireless clients reconnect quickly. The bad news is that the print spooler resends the print after the reconnect, and the problem repeats.

    This is my first tomato firmware installation, and I'm wondering if I should install an older, perhaps more stable version. Advice and recommendations appreciated.

  65. skittle

    skittle Guest

    Any chance to see a version with SD/MMC support?
  66. ghostknife

    ghostknife Addicted to LI Member

    Max I ever got on the 520gu is about 1.6MB/s and only if you are using ext2, ext3 is next best and then FAT32 is last. So it depends on what file system you have and the reports I've seen here seem to vary wildly. i now use a 500gpv2 and I've never had it go this well, this is on page 77 of this thread.
  67. ghostknife

    ghostknife Addicted to LI Member

  68. leesiulung

    leesiulung LI Guru Member

    I'm not sure, but it seems to happen to me as well. After a print job, the internet doesn't seem to work anymore for about a minute. I'm using the Tomato v1.27 ND EXT.

    I wonder if dd-wrt has the same issue....
  69. leesiulung

    leesiulung LI Guru Member

    Wow! That graph in the link, is that for a 520gu or your newer 500gpv2?

    I'm using NTFS, but that seems to be the slowest. I wonder what mode that graph was tested under, but anything above 2MB/s is great and he got north of 3MB/s on FAT32! :eek:

    It's interesting to note, he got higher reads than writes.
  70. teddy_bear

    teddy_bear Network Guru Member

    Sounds like the router just runs out of resources and reboots for some reason...
    Don't know why - I have successfully printed 30-50 pages documents via wirelees on my wl-520gu and Brother HL5240 printer, and never experienced anything like that.

    Try turning "Bidirectional copying" off - it might help.
  71. DOug80638

    DOug80638 Addicted to LI Member

    Only the wireless restarts

    The router remained running. Hardwired network connections stayed up.
    Only the wireless connections were affected.

    The same file printed from a wired connection prints fine without impact to the router.

    I turned off "Bidirectional copying" and USB 2.0 support and that seems to have helped. The document now prints from the wireless connection without a network drop.

  72. shibby20

    shibby20 Network Guru Member

    teddy_bear can you make tomato for netgear wnr3500l?
  73. HK-47

    HK-47 Guest

    I'm having a weird problem with scanning on an HP F4280. It scans anywhere from 20-80% of the page, and then it just stops, and it wont work again until I reboot the router. The log shows this:

    Dec  5 22:03:26 coil daemon.debug saned[569]: saned (AF-indep+IPv6) from sane-backends 1.0.21cvs starting up
    Dec  5 22:03:26 coil daemon.debug saned[569]: check_host: access by remote host:
    Dec  5 22:03:27 coil daemon.debug saned[569]: init: access granted to saned-user@
    Dec  5 22:04:36 coil daemon.err saned[569]: io/hpmud/dot4.c 480: unable to read Dot4ReverseData header: Resource temporarily unavailable hp:/usb/Deskjet_F4200_series?serial=CN8AO4C0GF05BR
    Dec  5 22:04:38 coil daemon.err saned[569]: io/hpmud/dot4.c 659: invalid Dot4CloseChannelReply: cmd=fa, result=1f
    Dec  5 22:04:38 coil daemon.err saned[569]: io/hpmud/dot4.c 368: invalid DOT4ExitReply: cmd=82, result=0
    Dec  5 22:05:44 coil daemon.err saned[569]: io/hpmud/dot4.c 140: unexpected command: cmd=81, result=0
    Dec  5 22:05:45 coil daemon.err saned[569]: io/hpmud/dot4.c 136: unexpected DOT4Error: cmd=7f, psocket=0, ssocket=0, error=1
    Dec  5 22:05:45 coil daemon.err saned[569]: io/hpmud/musb.c 1885: invalid Dot4Credit from peripheral
    Dec  5 22:05:45 coil daemon.err saned[569]: io/hpmud/dot4.c 136: unexpected DOT4Error: cmd=7f, psocket=0, ssocket=0, error=1
    Dec  5 22:05:45 coil daemon.err saned[569]: io/hpmud/musb.c 1885: invalid Dot4Credit from peripheral
    Dec  5 22:06:30 coil daemon.err saned[569]: io/hpmud/dot4.c 172: unable to read Dot4ReverseCmd header: Resource temporarily unavailable
    Dec  5 22:06:30 coil daemon.err saned[569]: io/hpmud/musb.c 1885: invalid Dot4Credit from peripheral
    Dec  5 22:07:15 coil daemon.err saned[569]: io/hpmud/dot4.c 172: unable to read Dot4ReverseCmd header: Resource temporarily unavailable
    Dec  5 22:07:15 coil daemon.err saned[569]: io/hpmud/musb.c 1885: invalid Dot4Credit from peripheral
    Anyone else having similar problems?
  74. Pinqvin

    Pinqvin Addicted to LI Member

    Looks like my issue got fixed after my ISP upgraded the firmware on my Cisco EPC3000 cable modem. Although the official 1.27 firmware seemed to be unable to renew the lease, the newest firmware from this thread gets the lease renew every time. Weird, but hey, at least it works :)
  75. nguyen

    nguyen Addicted to LI Member

    This is a big request but I love to run Tomato on WNR3500L (or Asus RT-N16). There is already a Tomato firmware for WNR3500L but it is not fully functional at http://www.myopenrouter.com/.
  76. shibby20

    shibby20 Network Guru Member

    its true. standart functional we have now, well i think, its not a lot of work for teddy_bear to make fully functional tomato of netgear :)
  77. teddy_bear

    teddy_bear Network Guru Member

    Heh... And why do you think the version at myopenrouter.com is still not fully functional? If you think it's not a lot of work, I'd suggest you try it yourself one day...
  78. shibby20

    shibby20 Network Guru Member

    teddy_bear sorry, i didnt want irritate you. I cant compile tomato etc... but you have this knowledge in one small finger :) i only would like to ask: can you make tomato for netgear?

    btw why do i think the version at myopenrouter.com is still not fully functional? hmm it isnt a person who want to make fully work tomato for this router... same as openwrt. DDWRT is still correcting by the eko. Tomato and openwrt unfortunately doesnt :(
  79. deboyz1014

    deboyz1014 Addicted to LI Member

    Yesterday night I decided to upgrade from v37 to v41 on my WL-520 and it upgraded smoothly. I then checked on my NAS (attached to router via one of the port, not USB) but I can't access it. I tried all other computers on the network and still can't access the NAS, it was getting late so I just downgrade it back to v37 and boom, can access NAS again. I'm at work right now so I can't do anymore test until I get home but does anyone know what I should be looking for?
  80. ray123

    ray123 LI Guru Member

    Kernel fixes for the USB mounting crash bug

    Fixes for the USB mounting crash bug.

    Just before we left for our 6 week cruise, TeddyBear made a comment
    that was the last clue I needed to find the kernel bug. Turns out
    that the bug had nothing to do with mounting several disks at once, as
    happens when the router boots up.

    The bug was in multiple overlapped I/O to several different USB drives
    concurrently. This is easy to force to happen. Just do "dd bs=4k
    count=16k of=/dev/null if=/dev/discs/disc#/disc &" a couple of times
    with # of 0 & 1, so it's reading several at the same time. Your
    router will lock up in a few seconds.

    I also fixed a few "functional anomalies" in the kernel code.

    I wondered why when I unplugged my hard drive that it would spend the
    next 100 seconds trying to spin it up. Odd, considering that my drive
    was never spun down. Not to mention that the drive that was, DUH!!,
    unplugged. Kinda hard to talk over a disconnected cable.

    On a plug, it pounded on the drive without giving it time to finish
    initializing. Many flash sticks have slow firmware and take a few
    tenths of s second to come up. Therefore the partition table read
    would fail, so our hotplug agent had to go through gyrations to
    attempt to get it to re-read the partition table at just the right

    On an unplug, the kernel didn't let the hotplug agent unmount the
    drive, so it couldn't clean up the data structures. This left a lot
    of crap around--including entries in /proc/partitions--which the
    hotplug agent would again have to try to clean up.

    With these fixes, the timings between the kernel and the hotplug agent
    have all been fixed. The "wait for device to settle" is now all done
    in the kernel, where it should have been all along. And it's
    accuraet--not merely a long constant worst-case delay. It doesn't wait any
    longer than it needs to. Fast device = small delay. Slow device =
    long delay.

    The only thing I been able to test is the spin-up for a drive that is spun
    down--because I don't have a drive that responds to the SPINDOWN

    I've also fixed the Tomato hotplug agent, and removed all the crappy
    contortions it had to do, and the locking for a mount. On bootup the
    discs will no longer get mounted sequentaially. They'll now get
    mounted in parallel.

    Patch file is at http://www.mediafire.com/rayvt123/rvt-v40-usbfix.patchset.tgz
  81. ray123

    ray123 LI Guru Member

    Dang! I just discovered that the USB hub I've been using is only V1.1. Old old old, and slow slow slow. I have a drawer full of USB flash sticks of various ages, some V1.1 and some V2.0

    The read speed difference is astonishing.
    V1.1 hub: 960 kb/s
    V2.0 hub: 6.7mb/s

    Seven times faster. :biggrin:

    But.........there's a bug in the kernel code that supports a V1.1 device connected to a V2.0 hub. One more thing to fix. :mad:
  82. greenythebeast

    greenythebeast LI Guru Member

    Is this something that teddy_bear will incorporate into his mod or do we need to do it ourselves?
  83. ray123

    ray123 LI Guru Member

    Hopefully, he'll pick it up. It's up to him.
  84. Rasky

    Rasky Addicted to LI Member

    Yesterday I was playing with a self-powered USB disk. I didn't know that the router didn't provide enough power to make it work, so I tried several times to plug it and unplug it. After a while, the router ended up in a broken state, I couldn't even mount my USB pendrive with optware anymore. I had to reboot the router (btw, the reboot function in the GUI didn't work... I gave a reboot on the command line; not sure again if it's because of the broken state or not).

    @ray123, could this be related to the mount/unmount bugs you fixed?
  85. deboyz1014

    deboyz1014 Addicted to LI Member

    Little update on my situation. I updated to v38, 39, 40, 41 (all standard) and reset the router every time and couldn't connect to my NAS. As soon as I re-flash it back to 37 (without the need to reboot or reset router) I was able to access my NAS again. Was there any major changes from 37 would caused this?
  86. ghostknife

    ghostknife Addicted to LI Member

    Ok jealous now!
    What router, firmware and what USB settings are you running, printing enabled/disabled etc.? I never got anything like that ever and I'm not even using a hub.
  87. oversky

    oversky LI Guru Member

    I am a bit lost.
    Can anyone confirm that tomato-1.27-NDUSB-8741-vpn3.4.rar works on Buffalo WHR-G54S? and tell me how to clear nvram after upgrade from tomato 1.10.
  88. teddy_bear

    teddy_bear Network Guru Member

    Yes, there were many significant changes... You need to provide more details. What NAS you're using? Is your NAS wired or wireless? Does it show up in the list of connected clients in Tomato GUI? Is there anything interesting in the Tomato syslog? What exactly do you mean by "can't access your NAS"?

    For troubleshooting you can try the following.
    If your NAS is wireless, try to play with different wireless security settings on both ends - Tomato and NAS.
    Also - whether your NAS is wired or wireless - try unchecking "Master Browser" and "WINS Server" check-boxes on Samba configuration page in the Tomato GUI.
  89. teddy_bear

    teddy_bear Network Guru Member

    Thanks again for all fixes and improvements you did for this mod! I definitely will include this patch into the next build.
  90. ray123

    ray123 LI Guru Member


    The worst thing you can do is to plug & unplug a USB sdrive rapidly. The drivers are just not designed for a device to disappear when it's trying to set them up.

    The official term for what happened to your router is "crammed in sideways".

    Yes, when it's jammed like this, neither the GUI nor a command like reboot will work. The OS does an orderly shutdown, and it waits for the dead driver to shut down. It'll wait forever, because that puppy just ain't able to shut down.

    There's another command to tell it "screw that, just stick a 2x4 in the spokes and come down NOW". Alas, just now I forget what that command is.

    This is the reason why my wife once asked me, "Why are you always getting up and pulling the power cord out of that box with the blinking lights?"

    [edit] The command is: echo b >/proc/sysrq-trigger
    or echo i >/proc/sysrq-trigger
    A.K.A. "Biff!! Boot to the head!"

    b = reboot
    i = kill
  91. ray123

    ray123 LI Guru Member

    My configuration:
    * Asus WL-520GU, no printer, samba & cifs active.
    * Cheap ($4) USB V2 4-port hub bought from OfficeDepot. Cleverly designed so
    that adjacent ports are so close that you cannot use both. So it's a
    4-port hub that you can't use more then 3 ports.
    * #1 Ancient free-after-rebate CF camera card reader (V1.1), with a 32MB
    CF card.
    * #2 Old old 64MB Usb flashdrive USB2.
    * #3 New A*Power USB V2 harddrive enclosure with a WDC 160 MB drive 3.5"
    * #4 New Sandisk Cruser 4GB USB2 thumbdrive.
    * #5 2 year old Memorex 2GB USB2 thumbdrive.

    Speeds tested by using the optware dd, reading 32MB:
    dd bs=2k count=16k of=/dev/null if=/dev/discs/disc#/disc
    NOT transferring a file over the network---reading it on the router.

    #1 856 kB/s
    #2 5.0 MB/s
    #3 7.6 MB/s
    #4 7.6 MB/s
    #5 7.5 MB/s
  92. ray123

    ray123 LI Guru Member

    Hold up. I just found the V1.1 device on a V2 hub bug. :) Testing it now, but also need to track down an occasional kernel oops on unplug. :mad:
  93. nyonya

    nyonya Addicted to LI Member

    I'm using a WL520GU, have a USB 2.0 500GB hard drive plugged in, all working wonderfully. I'm not sure, however, what benefit CIFS or JFFS are to me - should these be set up, and what would they enable me to do? If anyone could point me to a guide / information page that explains it in plain language, I'd really appreciate it.

    Thanks TB for an amazing mod!
  94. ray123

    ray123 LI Guru Member

    CIFS lets your router connect to a Windows shared directory. So you can do stuff like save the bandwidth log files, etc.

    JFFS gets mounted early in the bootup process. It's mounted long before any USB drives are.
  95. ray123

    ray123 LI Guru Member

    Here's the patch. I can't believe this happens---there must be another bug somewhere. What happened cannot possibly happen. He said.:flabbergasted:

    The kernel oops is an unhandled page fault. It only seems to happen once in a while, and only when I unplug a device after I've been pounding the system with the "dd" commands.
    There appears to be another functional anomaly. When I unplug & replug devices, the new one will sometimes get the number of an old one---which should not happen. Things still seem to work, but it's not supposed to do that.

    I'll look into these soon, but it won't be for a week or so. Neither seems to be a show-stopper.

    Attached Files:

  96. teddy_bear

    teddy_bear Network Guru Member

    Ray, you need to start working with the last build 41 sources ;)... Your patch seems to be against v40, and I believe this was the only build where this bug existed (my bad - it was a lazy attempt to apply some recent - and untested - Linksys WARs :frown:).
  97. ray123

    ray123 LI Guru Member

    Actually, that bug was introduced in v20. After getting nowhere :wall: for quite a while, I finally thought to try older versions to see if any of them worked. I had even tried running the Tomato USB subsystem code on my PC testing system--and it worked fine.

    V19 and before worked, V20 and after didn't. So I just started poking around to see which of the changes did it. I got lucky, because there is NO WAY that that change should break anything. But it did. Googling around, that same fix was put into DD-WRT in Feb, with the one work explanation "workaround". Not very helpful.

    Yeah, I saw v41, but I'd been working in v40 and didn't want to disrupt my chain of thought needlessly. Your v41 changelog didn't look like it had any changes in the code that I was working on. Working in kernel code is the most difficult kind of code to work in, so I was reluctant to upgrade in midstream. If my patch doesn't apply cleanly to v41, let me know and I'll grab it and straighten it up.

    And the disk drive in my wife's computer up and died, so I had to fix that, too. Apparently, computer gurus are supposed to be able to resurrect data from a disk drive that neither Windows nor Linux can mount.
    And I'm replacing the 3 320MB RAID-5 discs in my Linux box with new 750GB ones that Newegg had for dirt cheap. If it's not one thing, it's a dozen others. Sigh.................. Why, yes, I _would_ like some cheese to go with the wine.

    Luckily, this guru did manage to cozen Linux to read the data. All it took was some special software tools and a few 12 hour sessions of reading and re-reading bad blocks.
  98. ernstblaauw

    ernstblaauw Addicted to LI Member

    Hi, I would also like to enable sftp support (bzr works far better with sftp than ftp). If I understand correctly, I can add sftp support by installing the Optware openssh-sftp-server package and the Tomato ND USB mod will support sftp.

    However, I have no clue how to install that package. Can someone help me installing openssh-sftp-server onto my Tomato ND USB mod?
  99. ray123

    ray123 LI Guru Member

    Teaddy Bear,
    On further reflection, I'm unhappy with the magnitude of my recent set of change, and now wish to withdraw it. I think that it would be better to break it down into 2 subsets.

    The first subset would be the minimal set of changes to fix the the V1 device on a V2 hub bug, and the overlapped I/O bug withthe corresponding changes in the Tomato hotplug agent.

    Once that's in and released (and tested!) then the next subset would be all the other kernel fixes and cleanup.

    I'll get you the first subset patchfile later on today or tomorrow, for the V41 build.
  100. i1135t

    i1135t Network Guru Member

    Teddy, any chance of you patching the port mirroring (--tee) option into your build? The patch is located here. Thanks.

Share This Page