Tomato ND USB Mod

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

  1. sumdumphat

    sumdumphat LI Guru Member

    FIVN Asterisk Management script stops working after Build 23

    Hi teddy bear thank you so much for releasing this firmware. followed you instruction a few pages back I was able to install * on a wl-520gu.

    I just notice that after upgrading to build 24 the Asterisk Management script stops working, i also confirm it behaves the same on build 23.

    I can still open the webpage by typing http: // wl520gu_address/user/cgi-bin/

    but click on any of the tabs returns nothing. i fall back to build 22 and the * script works again.

    thanks again for your hard work.
  2. teddy_bear

    teddy_bear Network Guru Member

    There are 2 kinds of developers. Some like writing guides in their spare time, and they sometimes end up as technical book writers, otherwise they usually blog a lot... The other kind waste time by modding Tomato, skinning iGo, playing with toys and sh$t like that - they are less practical and they hate writing guides ;), and I'm the 2nd kind... Of course, there are people in the middle who have time and desire to do everything - but they are normally either very young, or retired.
    The point is, if you want to do something, you have to learn yourself - Ray123 already replied to you in this thread giving you some tips on where to start from... I guess this is as much as you can expect. When you'll have some specific questions later - like "why am I getting such-and-such error when trying to do this and this under that environment", someone who knows the answer will gladly help you if you ask. As for general information, the internel is full of it already - you just need to search and invest a lot of time (especially if you're not a developer).

    Yes, the FIVN script is using awk which was excluded from Std/Lite/NoCIFS versions starting from v23 to provide more JFFS space...
    To be able to use that script, you need to install "Extra"-version which still includes, and will always include awk. Although "Ext" doesn't leave any JFFS space on 4MB routers like wl-520gu, I guess it should not matter to you since you obviously have permanently attached additional storage to run * from...
  3. sumdumphat

    sumdumphat LI Guru Member

    thanks again.

    "Extra version" works like a charm.
  4. Marioluigi64

    Marioluigi64 Addicted to LI Member

    Hi everyone!

    I just bought a WL-520GU and installed tomato on it and I love it! A couple of days ago, I came across this USB mod firmware. I flashed the router with build 24, and it works well too, except for one thing: LAN transfer speeds seem to have been cut in half.

    I don't really know why this happened, as I set everything up exactly the same on both firmwares (and I left all the new features on the USB firmware at their defaults). I also made sure to clear the NVRAM after each flash. When I flashed back to the stock Tomato firmware, the LAN speed picked right back up. I can get around 20Mbps with the stock firmware, whereas I can only get about 10Mbps with the USB firmware. I looked through the last few pages of this thread to see if I could find a similar problem, and I did find another person who was having almost the exact same issue as me, so I guess there's two of us with that problem now. :tongue:

    Here are our wireless clients: I have a Dell laptop with a TrueMobile 1400 (a Broadcom-based card), and my sister has a Dell laptop with a TrueMobile 1390 (which I believe is also Broadcom based) and a G4 PowerMac with an Airport Extreme card (which again is Broadcom-based). They are all being affected the same way. If anyone could help me, that would be great!
  5. teddy_bear

    teddy_bear Network Guru Member

    Interesting... Yes, you're the 2nd person to inquire about the WLAN speed drop. Have you tried what I recommended to TheSteve on the previous page (upgrade/downgrade client drivers, reduce Tx power to below 30)? If you did, and it didn't make any difference, you can also play with Advanced Wireless settings or with "wl" command - maybe there's something there that can help (I have no idea what it could be though).

    Since the original Tomato has better WLAN speed, I suppose it's a newer WL driver that is responsible. TheSteve mentioned that DD-WRT is also slow, and DD-WRT uses the newer driver too. The slow wireless subject comes up once in a while on DD-WRT forums, and people are actually directed to use Tomato if WLAN speed is important ;). What's strange is that it seems to affect only some clients - for example I'm getting about 2-2.2 MB/s rate which is as much as you can get on 54g network.

    I definitely don't want to go back to the original driver, since for may the newer driver improved the stability of wireless connection. However, I made another build - v24a-OND ("older" or "original" "new" driver) - tomato-1.23-ND-USB-v24a-OND-Ext.rar. It contains the original Tomato WL driver, and is available for download from the links in the 1st post. If you experience wireless speed drop with USB mod, and if you try that build - please report the results here. Although less probable, it's still possible that the speed issue is caused by some other changes in USB mod, and not by the WL driver itself...
  6. Marioluigi64

    Marioluigi64 Addicted to LI Member

    Thanks a lot for making the OND build. I will try it out in just a little bit and come back with the results. I think you are right, since this build uses the original Tomato wireless driver, that will fix the problem.

    To answer your questions, no, I have not done anything with the drivers. All of the computers are running the latest drivers. My laptop is the only one running a non-os provided driver. It is running the last driver made for the TM1400 by Dell in late 2006. My sister’s laptop is running the Windows 7 Beta, and it had its own generic Broadcom driver for the card, so I thought it would be best just to leave it alone. My sister’s Mac (running Leopard) just installed a driver automatically for the Airport Extreme card, so I assume it’s the latest one. I’d rather not mess with the Windows 7 and OS X drivers, and they’re probably the only ones available anyway, and I really don’t want to try to downgrade the XP drivers on my laptop, as it’s a huge pain to do so, and I don’t think the drivers are the problem anyway.

    As for the TX power, I didn’t try changing it and won’t get to as I’m running the stock firmware now and don’t want to flash back to the USB fw just to try that. I will try it when I flash to the OND fw. I don’t believe that is the problem either though, as I did both of the laptop speedtests (with both the original and USB firmwares) about 6 feet away from the router with direct line of sight. I’m a little afraid to fiddle with the advanced wireless settings, as networking is not my strongest suit, and anything I do will probably just make it worse. :redface:

    About dd-wrt, I very briefly flashed to one of the builds (I couldn’t tell you which one, I think it was v24 117-something) a couple of days ago. I guess that’s one of the builds with the updated driver. I tested my Xbox 360’s wireless connection, and it was absolutely terrible, just like my old Linksys router when I ran dd-wrt on it. I didn’t even bother running any LAN tests. I just flashed right back to Tomato and the 360’s connection went straight back to normal.

    Again, thanks a lot for going to the trouble of creating a whole new build just for two people. You’ve already been more help to me than I ever got from the dd-wrt forums (not on the linksysinfo boards, but the official boards on back when I was running dd-wrt on an old Linksys (it was a v6 GS model that couldn’t run Tomato). That’s the whole reason I bought the Asus router in the first place. I just got fed up with the whole thing (both the problems I was having, and the lack of help I was getting), so I switched to Asus and Tomato, and I love it! :biggrin:
  7. TheSteve

    TheSteve Addicted to LI Member

    I tried both versions. In the end the speed difference may be more related to transmit power levels then anything. Am I correct in my belief that the original unmodified tomato doesn't adjust power level correctly with a WL-520GU? I can get a higher transfer rate with a much lower power(10mw) then I can with the default of 42mw.
    I did try changing power levels with the original tomato and never noticed any difference. Running either of the newer modified/usb versions I can get much higher throughput at low power levels.

    I'm going to stick with the newest patched usb version with the newer Broadcom driver and low power.

    Thank you for your hard work teddy bear.

    btw, my wireless hardware is a Broadcom based 802.11g card.
  8. Marioluigi64

    Marioluigi64 Addicted to LI Member

    Reading your post convinced me to flash back to the USB firmware (with the newer driver). I set everything up just as I had it before, along with turning the Tx power down to 10, and you're right. It seems to have worked. I just did a 16Mbps transfer from my desktop to my laptop, which is 2 rooms away from the router. I don't really understand it, but it works, and that's the important thing! :biggrin:

    Teddy Bear, I am curious though, is the Asus really that susceptible to noise interference? 10Mw is very low, even lower than the default on Linksys router's stock firmware (which I've heard is what I thought was a measly 27Mw). Or could it be that there is some sort of oddity between Broadcom cards and this router?

    BTW, I have not gotten around to trying the OND build yet, and since I seem to have gotten the standard USB build to work (thanks TheSteve! I would have never thought to turn the power down that much) and TheSteve has already tried the OND build and said there is no difference, I won't bother installing it unless you really want me to.

    Thanks again for everything!!!
  9. ghostknife

    ghostknife Addicted to LI Member

    recently changed my WL-520GU to tomato which is great (thanks) but I can't figure out why the real-time b/w monitor doesn't display traffic for PC, WLAN is fine. It worked on DD-WRT with same network config, except there I had used 'Assign WAN to LAN' which I can't do now. I have the WAN port disabled because my main device is a Voip ADSL modem and I use the ASUS for extra ports and wireless.

    The behavior is not as I expect (maybe somebody can correct me),traffic through LAN1 (plugged into ADSL modem) to wireless client displays as I expect it to but traffic through LAN1 to LAN 2,3,4 to PC doesn't show up. I can be downloading at 1.5 MB/s but apparently there is no traffic, don't know what is going on here.

    1) Do I have to set something specific I'm not aware of?
    2) Does the b/w monitor work as expected when WAN is disabled?

    EDIT: never mind I found after more searching that LAN-LAN traffic is not monitored since it's the same vlan, doh.

    3) Is there a way to assign WAN port to LAN as in DD-WRT that way it *may* work as before since then the ports have different MAC?

    Was running v22 now on v24std, in Router mode, DHCP server on.
  10. Marioluigi64

    Marioluigi64 Addicted to LI Member

    teddy bear, I have a question about the print server aspect of the WL-520GU. I have an HP Deskjet 990cxi that is currently connected to (and shared from) my desktop through a USB cable. I was wanting to hook it up to the router and share it that way, but I did a little research and discovered that the printer loses the extra communication features, like the ink level monitor, with a computer if it is not directly connected to it through either a USB or parallel cable.

    I would like to keep that functionality, but my desktop doesn't have a parallel port, so what I was thinking about doing was this: buying a parallel-to-USB adapter (something like this, and hooking the printer up to the router that way, while keeping the USB half of the printer hooked up to my desktop (my printer is one of the models that can print to both USB and parallel at the same time, so interface conflicts wouldn't be a problem). Would this work? I noticed in the Newegg reviews that there is a driver that has to be installed for the cable. Would that be a problem? :confused:
  11. teddy_bear

    teddy_bear Network Guru Member

    No, it's not possible now to assign WAN to LAN as in dd-wrt - not via GUI anyway. Maybe you can do what you need by setting some nvram variables (lan_ifnames, wan_ifname, etc) - that's what dd-wrt is doing. But this can interfere with other code in Tomato, so you may get some unexpected results (or no result at all). If you have time and desire to play with it, a good starting point would be to add the interface name that you have in wan_ifname variable to your lan_ifnames value, unset wan_ifname, commit nvram changes, reboot, and see what happens ;). But as always - at your own risk...

    The kernel printer driver actually supports USB printers and printer cables, so there's a chance that it will work. However, I have not tried it, and don't know anyone else who did, so unfortunately can't help you... But if you get the cable, please let us know if it worked for you...
    The other approach would be to use this USB-to-Parallel cable to hook your printer to the computer, while using usb directly to connect it to the router... Maybe that will work better.
  12. acollado

    acollado LI Guru Member

    Could a control be added to the GUI to save syslog files to a custom path like the bandwidth logs have? That way they can be easily stored on USB drives.
  13. ray123

    ray123 LI Guru Member

    Make a softlink for it. Like:
    ln -s /cifs1/filename /var/log/messages
    ln -s /mnt/MYUSBDRIVE/syslog /var/log/messages

    Just put the command in a startup script.
  14. Aquafire

    Aquafire LI Guru Member

    Restart Linksys PPPoE connection triggered by download rate

    Hi Teddy and all,

    I have flashed Linksys WRTSL54GS with Tomato 1.23 ND USB + FTP/Samba Mod by teddy_bear.

    I usually run into a period of bad internet days when the DSL modem starts suffering from total download choke to gradually degrading speed. By doing a hard or cold reset of the DSL modem it clears the problem. Usually my download rates are around 200 ~ 250 KBs.

    I use PPPoE connection type on the router which it connected to the Aztech DSL modem in bridge mode.

    I just wanted to ask that can it be a way in tomato firmware, that based on the incoming download bandwidth rate, I can make the router to reset the PPPoE connection or itself. Something like that if the download rate on the network interface WAN(ppp0) is xxx Kb/s or falls behind a given minimum threshold then the router reboots itself.

    Maybe by doing any Optware packages at NSLU2. I have already installed and successfully running a DLNA server Ushare on the Linksys.

    Thanks for any guidance if possible.

  15. Marioluigi64

    Marioluigi64 Addicted to LI Member

    I went ahead and got a USB-Parallel cable, and tried it out. Apparently, it only halfway works. When I plugged the USB cable into the router, the printer came up as "UNKNOWN DEVICE". I was able to connect to the printer from one of my computers, but when I tried to print a test page, it printed the first line of text, then got stuck and the computer said there was an error. I tried to print one more time, and it just gave me an error, so I figured it wasn't going to work.

    I did what you suggested and plugged the cable into my desktop, and it seems to work ok. I was able to see the ink level indicator, but the pictures of the ink cartridges are missing. I don't really know if that's normal or not (I'm completely out of color ink and it says I'm out of black too, but I can still print in black & white, and it said I was out of black ink even before I switched cables). I don't remember it being like that before, but the readings themselves are as they were before (both saying 0%), so I guess it's working correctly.

    Anyway, I plugged the actual USB cable into the router, and my other computers can now print to it just fine.

    Thanks for everything!!! :biggrin:
  16. tstrike2000

    tstrike2000 Network Guru Member

    I've been using v23 with my NAS drive formatted to ext3, which seems to sync well from my Windows machines. I was just curious about the v24 version that's out there. In the description it mentions limited but safe writing support for NTFS. What exactly does that mean? Can destination files not be overwritten or only written to once, something along those lines?
  17. teddy_bear

    teddy_bear Network Guru Member

    Here's what deveopers of newer NTFS driver say about it in the documentation:
    Compare it to write support description from the original linux 2.4 NTFS driver (up to the latest official kernel
  18. davipiero

    davipiero Addicted to LI Member

    Hi, Is there any possibility to plug an 3G USB modem into tomato device?
  19. tstrike2000

    tstrike2000 Network Guru Member


    This may sound like a silly question, but do you recommend erasing the nvram to reset the router after upgrading your firmware? I only ask because when I used the regular Tomato in the past it wasn't necessary to erase the nvram, but I wasn't sure with the ND, USB additions, if it mattered or not. Thanks.
  20. jnappert

    jnappert LI Guru Member

    @teddy bear: Tried to compile tomato from git and used the Tomato ND 4.158.4 branch (as i only wanted vanilla tomato with 4.158 drivers for my WDS-Routers):;h=17870a2dd2ea47f35f88a122773cdedd8b55be97;sf=tgz

    It compiled fine but i noticed that often after reboots wireless doesnt come up (WLAN LED is ON!) and i can not establish WDS Links.

    I think i took the wrong snap from git. Could you point me the right way?

    Your USB-Mod is rock solid on my gateway (ASUS WL 500GP v1).
  21. teddy_bear

    teddy_bear Network Guru Member

    There should be no need for erasing nvram if you're upgrading to my mod from the official Tomato, or from any previous build of my mod. However, if upgrading from any other firmware, or from other Tomato mod, it's recommended to erase nvram and manually reconfigure the router.
    In any case, erasing nvram is still the first step in troubleshooting if you're experiencing problems.

    Not now... The required driver modules are not compiled in. There's a work in progress on (Oleg's Asus firmware forum) to make 3g usb modems usable but it's not completed yet, and it requires some changes to be used in Tomato as it's for newer 2.4.37 kernel... AFAIK dd-wrt recently tried to incorporate that work but I'm not sure how successful it was - there's a comment in dd-wrt svn that "3g wont work on broadcom yet".
    Anyway, I don't have any 3g modems, and won't be able to test this stuff even if I get it ported into Tomato kernel, so I'm not going to do it just yet...

    Not sure how you got that snaphot link - try to use this one instead. I hope it should work, although I've never tried to compile it without everything else...
  22. pandora

    pandora Addicted to LI Member

    Hi Teddy Bear,

    I'm running your V24 (from April 5, 2009) firmware. Overall it has been great.

    Tonight I noticed a potential problem. I have a 320GB USB notebook drive attached to my Linksys WRTSL54GS router running your firmware. Access to the drive as a network drive has been great on all my PC's. I have no complaint about ability to access. The drive is in FAT 32 format.

    Tonight I did a restarted my router using the restart button. I have bandwidth monitoring enabled, and it is stored on my 320 GB USB drive. The address is /tmp/mnt/Tomato/rstats/ the drive label is "Tomato", the folder for the saved bandwidth files is "rstats".

    Backups are saved there as well.

    On restart early this morning (about 1:30 AM) on April 26, 2009 my router went down and back without incident. It had been up for about 10 days prior to my restart.

    When it came back up, it lost several days of bandwidth data, instead of going back to the restart, it went back to April 22, 2009. Which means I lost several days of data. I am keeping months of data on my router and was surprised to see a fairly large data loss.

    I was able to recover most of it, as my router saves the bandwidth file every hour. The backup file had data and most of it was recovered.

    I'm not certain why the primary file didn't have several days of data, and why the restart didn't save the data and close the bandwidth file on shutdown.

    Is this something you can look into?
  23. teddy_bear

    teddy_bear Network Guru Member

    I too keep my rstats file on the USB drive, and I experienced the same issue once as well - I believe it was on the 1st reboot after configuring rstats to use an USB drive.

    When this happened, I went through the code but could not find any obvious flaws that can cause this. On shutdowns and reboots usb drives are unmounted, and drivers are unloaded only after rstats gets a chance to store bw file (of course, if "Save On Shutdown" is checked). I did find and fixed the problem with bw file not being saved during firmware upgrade if it's stored on an external drive, but nothing for regular reboots. Since then I rebooted many times and could not reproduce the issue anymore - it looks like the file is getting saved correctly every time. However I don't think I ever rebooted using the button on the router - only via the web UI or telnet session - but I don't believe it makes a difference.

    Let me know if it keeps happening for you, and then I'll look one more time.
  24. trevorw

    trevorw LI Guru Member

    Hi guys,

    the same thing just happened to me some days ago. There was a power outage and router rebooted but on wakeup I lost about 1-2 days of logs. I thought it was my testing of the USB that messed up the config so I double checked everything, saving the configuration again and checking the logs (+ backup) file access times.
    In the first day, everything went okay but starting from the 2nd or 3rd day, the backup files have very strange creation/modification times:
    tomato_rstats_XXX.gz (27/04/09 - good)
    tomato_rstats_XXX_1.bak (22/04/09 - why?)
    tomato_rstats_XXX_2.bak (27/04/09 - 20h difference from the .gz, the file is modified between 00 and 01 am)
    tomato_rstats_XXX_3.bak (25/03/09 - again, why?)
    The rstats are supposed to be saved hourly and the .gz file seems to be in order but I don't understand why the backup files have these strange modified times - aren't they suppose to be copies of the last known rstats?
    Should I just delete them and start all over?
  25. pandora

    pandora Addicted to LI Member

    trevorw ... THANKS!

    I just looked at the dates on my bandwidth backup files and they were messed up. I deleted them, and waited for my hourly backup. Now both files have the correct modified time.

    After checking both files, which appear to be correct. I rebooted from my routers web page, and after restart the backup was the same, but the .gz file shows it was modified on reboot (according to Windows explorer accessing the router USB drive as a network drive).

    Somehow I suspect the router touches / updates the .gz file on reboot.
  26. jnappert

    jnappert LI Guru Member

    Not sure how you got that snaphot link - try to use this one instead. I hope it should work, although I've never tried to compile it without everything else...[/QUOTE]

    @teddy bear: Thank you. SUCESS!
  27. pandora

    pandora Addicted to LI Member

    Just an update. After I deleted all rstats backup files, waited an hour, and then rebooted my router. There were 2 files in my bandwidth (rstats) folder. After another hour has gone by, there are still only 2 files, the current file which ends in .gz, and only one (not 2) backup files. The backup file name changed to 2.bak

    Should there be a primary file, and 2 backup files after several hours with hourly saves? Instead the the backup file change names from 1.bak to 2.bak, but there no longer is a 1.bak.

    I suspect something is wrong with how these files are created, saved and aged.
  28. risq

    risq Addicted to LI Member


    im thinkin about switching from my 54gl to the asus 520gu. Right now im using the Tomato SgtPepper OpenVPN mod. Is there some build with VPN support for the 520gu available?

  29. ray123

    ray123 LI Guru Member

    Improved JFFS driver for Tomato

    This new version (1.3) of the jffs filesystem reserves only 1 block of
    flash memory for overhead -- typically 64 KB. The original version
    reserves 4 blocks -- typically 256 KB.

    In the extreme situation where there is only one block of flash, ver
    1.3 can operate with NO reserved space, albeit with the danger of
    corruption if the power fails while a write is taking place. Due to
    this danger, this "zero reserve" mode is only enabled when there is
    exactly 1 block of flash AND the filesystem is mounted with the
    otherwise unused MS_MANDLOCK option (or "-o mand" on the mount command

    The original jffs code had a handful of bugs, and a couple of design
    flaws. The bad results from design flaws could be obscured by
    increasing the amount of reserved space, so that's why the original
    code reserved a large amount of flash for overhead. This didn't fix
    or avoid the flaws, just made them less likely to occur. The bugs and
    flaws were much more likely to be triggered when the flash is very
    small or when the free space is a very low percentage of the flash size.

    The original version could not easily be tested, since it could
    operate only on real flash memory, and therefore testing was slow
    (each block erase takes about one second) and used up the lifetime of
    the flash memory. This version has the ability to use RAM instead of
    actual flash for testing, so these problems can be side-stepped. It
    as been tested by creating, deleting, and re-writing several millions
    of files of random sizes, using many different sizes of flash
    filesystems (from 1 block to 10 blocks).
  30. ray123

    ray123 LI Guru Member

    Installation of new jffs code.

    1. cd to the base of the Tomato source tree: $HOME/tomato/release/src/
    2. untar this file.
    3. make clean and rebuild Linux & Tomato.

    The tarball will lay down the new jffs code and the "filegen" testing program. It's a compete replacement, not a patch.
    Filegen is for testing. Otherwise you can ignore it. It's there for jffs developers.

    TeddyBear, the Linux jffs code is the only thing in this tarball. In addition, the linux .config should be changed to: "# CONFIG_JFFS_PROC_FS is not set". That option is only useful to the developer (me) and takes up too much space in a normal system.

    The only thing that you might want to change in Tomato itself is to enable the "zero reserve" option in the GUI jffs page. Since this is vulnerable to a corrupted fs on power-fail, it must be affirmatively enabled. I figured that the user should be warned of the danger and required to accept it, rather than having it default to on. Also, it only comes into play when there is only 1 EB (64 kb) of jffs in the flash.
  31. ray123

    ray123 LI Guru Member

    Tomato Webcam????

    I see that a lot of people have downloaded the tomato-webcam software. But I haven't seen any posts about it.

    Are people dl'ing it and then giving it up as useless without even bothering to say anything?
    Has anybody managed to get anything useful out of it?
  32. mactogo

    mactogo Addicted to LI Member

    Not sure if you're aware of this but there is someone named CaScAdE over at the ddwrt forum who's compiled a USB Webcam version for ddwrt (over at the Contributions Upload section -have to register with the forum to see the download), I tried an earlier version of his firmware and it worked quite well. Don't know if it might be of use to you.
    Downloaded your tomato-software by the way but haven't attempted to try it out yet as I'm not linux kernel savvy. But I do appreciate your effort in the matter and would hope to see a usb webcam tomato version similar to the one in ddwrt.
    All the best of luck to you and the rest supporting the tomato firmware.
  33. newsfaq

    newsfaq Addicted to LI Member

    Ray, thank you for taking time to build the webcam version. I downloaded it but didn't have a chance to try it out -- my logitech webcam got busted one day later :-( . Anyway, I wonder if you consider adding support for USB easycap device( in the next version? It's inexpensive and you can add some really nice CCD cameras without the limitation of 6' USB cable . Someone started the linux driver( on sourceforge already but not fully done yet . You might want to take a look if you have time ...
  34. ray123

    ray123 LI Guru Member

    Problem is, his driver is for the 2.6 kernel. These routers use the 2.4 kernel. Unhappily, the USB sub-system underwent a "forklift upgrade" in going from 2.4 to 2.6. I'm sure it's much better, but we can't take advantage of it.

    I made a tentative attempt to build a 2,6 kernel for Tomato. Got pages & pages of error messages. I spent a couple of dsys, then gave up. It's obviously a bigger job than I imagined--or have time for.

    One disappointing thing is that most new webcams are UVC (they have to be in order to be "Vista compliant")-----and Linux didn't get UVC support until 2.6.18. Perhaps I'll get bored sometime in the future and start dinking around with UVC for 2.4----but don't hold your breath.
  35. ceztko

    ceztko Network Guru Member

    Is there hope the ND USB mod will be merged in official Tomato firmware, soon or later?
  36. jeremycobert

    jeremycobert Network Guru Member

    is there any problems with too much data and performance ?

    hey guys , i was thinking about setting up a usb drive for storage where i can send and retrieve symantec ghost backups/restores along with everyday storage of files. currently i just plug in the drive to the machine i am using and run a backup/restore as needed.

    i am wondering if switching the usb drive to my ASUS for a central location would bog down the router when running a full backup. i would stagger the times when a machine runs it's backup.
  37. Anserk

    Anserk Addicted to LI Member

    Just installed Tomato USB on my Asus WL520GU. I was using DD-WRT before, and I didn't use most of its features. I like the fact this Tomato mod has USB support built-in. Here is my short notes I did for myself comparing two firmwares:


    1. Can show actual connections
    2. Tons of features

    1. Can't control NTP update frequency
    2. Reboots are needed for changes
    3. No USB in final v24
    4. Misleading interface - sometimes refers to options which are not there



    1. Allows to manually drop idle connections, shows how many connections in what state
    3. Great and fast interface
    4. USB out-of-the-box (modded version)
    5. Several options for Asus button
    6. Direct link to save bandwidth statistics
    7. Can save bandwidth statistics to USB flash drive
    8. Easy to use scheduler
    9. Allows to set NTP update frequency
    10. Shows actual time of DHCP leases

    1. Doesn't hide password
    2. Static DHCP - requires hostname

    Actually, I don't use USB right now but planning to keep bandwidth stats on it. One thing that affects both DD-WRT and Tomato is the clock problem. I've looked through forums and found this where teddy_bear says a fix was found (reducing CPU frequency to 200) but it breaks USB functionality. This clock problem originates from OpenWRT to both DD-WRT and Tomato as they share some code.
    I haven't tried any pre-SP2 DD-WRT versions, has the situation with the clock changed?
    Also, does anyone know if the problem exists in official Tomato release, without USB support?

    At least now I can have NTP sync every hour. DD-WRT doesn't allow to change sync settings. Other than that, I like Tomato a lot.
  38. Anserk

    Anserk Addicted to LI Member

    It would be pretty slow over Wi-FI but might work good on wired connection. See this article
  39. kosiko

    kosiko Addicted to LI Member

    You made the tomato more juicy!!

    Hi Teddy bear,

    I just noticed your MOD 1 week before and I bought the ASUS WL-500GPV2 quickly. I have loaded the Apr05 version on the router, everything is great!!

    I have been tested the SAMBA for file sharing and printing, but I got questions like to get the confirm from you and other gurus here.

    1. I format a 60GB 4500RPM old hard drive with EXT2, performed the big file (6GB) read/write test, I got the result was about 4000KB/S WRITING but only 2950KB/S READING, over 100M LAN on XP. Question A, is the read/write performance reasonable? what's the best results you can get? And also, any way to get better read/write performance? Questioin B, why reading is even slower than writing? I tried many times and on different storage, same result.

    2. I made my CANON MF4150 work this afternoon for printing, of course I would like to make the scan function work in the future too. I found that my printer will not go to standby mode. Question C, do you have any solution on this situation?

    3. I found the media server below sounds great, I like to install it on the router. However, they only provide the source. Question D, how can I compile on the router? I didn't see the "make" program on the firmware. I am not good at linux, please give me hint please.

    Again, thank you very much for your contribution and I really love this mod!!
  40. ray123

    ray123 LI Guru Member

    A: I just tested with a 2.5" 20GB drive, FAT, USB1.1. with a 10MB file. Directly on the router itself (telneted in, using dd command) I get about 600 KB/s.

    B: It's because you are measuring wrong. You didn't do a sync after the write, so a large part of the data you wrote is still in the disc cache and hasn't yet been actually written to the disk. I get 14-15 seconds for the read, and 14-15 seconds for the write INCLUDING THE SYNC. Without the sync, I get about 10 seconds for the write. But it's another 4-5 seconds before the final blocks make it to the disk.

    Measuring disk I/O on Linux is tricky; Linux is doing all sorts of optimizations under the sheets.
  41. kosiko

    kosiko Addicted to LI Member

    Hi Ray,

    Thanks for your reply. I have some thoughts to your information.

    A. I doubt your test environment as you are using FAT+USB1.1, the data is not comparable.
    B. At the 1st date I test the SAMBA, I was VERY DISAPPOINTED. I used various device, like SD, SDHC, USB STICK, 2.5"HDD with enclosure or with converter cable, all FAT32. I got only 1.5MB~1.8MB read/write performace AND it's NOT stable at all, especially I copy a file larger than 100MB. I read teddy's post above the samba copy issue and format it as EXT2/3, it became very stable, and I found EXT2 is a little faster than EXT3 so I choose EXT2 as I need better SMB performance (like to read HD movie files from the router). During my FAT32 test, I monitor the router on SSH with 'top' command to see the RAM/CPU status. I did aware that when I after I submit paste command, the windows explorer didn't show COPY process window and I need to wait many seconds to see the explorer start the real copy (or I should say the copy status pop-up window show up). But seems I didn't aware I need to wait to long for the final blocks write to the disk. In my EXT2 test, the copy status window pop up immediately on my PC and the top from SSH show the SMBD used around 50% CPU immediately too, no sync issue I believe.

    I also like to share some experience I had, to help people avoid the same thing:
    1. Before run fdisk to make partition, must be unmount your storage device. I didn't do that (forgot), and the router THOUGHT I have 2 partitons and totally has about 4GB space. Actually that's a 2GB MicroSD, lol, I didn't aware and did many SMB tests, not stable even in EXT2 file system. After I saw the wrong total space info from the WEB GUI, I redo the fdisk and format the MicroSD, ext2 is very stable since that.

    2. Becareful when you use USB extend cable. I have 2 cables and I used them before for my printer. In my case, I use it as one of my SD card reader is wide and the power cord/usb ports are too close at my WL-500GP V2, I need to use USB extend cable to connect my SD card reader. One cable is not working at all (maybe defected?), another is working with the SD card reader. However, I just aware that If I hook the 2.5" HDD enclosure to this USB Extend cable, the hard drive can't run properly as it sounds like have no enough power to DRIVE it. After I hook the enclosure directly to the router, the problem gone. So, seems the USB extend cable could be cause some issue.

    3. when you do the SMB test, make sure your storage itself is good&stable. I had an old 40G 2.5"HDD can't even format for mkfs.ext2. I was able to perform a full format under XP, this drive definitely has problem after I check it carefully but I even can't see any error log from the XP event log viewer, holy. I got another USB stick, It didn't saying USB2.0 or 1.1 and I thought it was 2.0. but after I found it's the only one not stable on the SMB test, I double check and confirmed it's USB 1.1 (run writing test on XP to deterine the copy performance), but I didn't enable USB 1.1 support on my router, I guess that's why it's not stable.

    Above just some stupid things I did in the pass couple days, I believe you guys won't do be silly like me, LOL

    I will welcome any input from folks here, I am so hungry to know everything about this MOD. Will spend more time to read this long thread during the weekend and hopefully I will bring up more question to you guys :)

  42. kosiko

    kosiko Addicted to LI Member

    I forgot to mention, the SMB read/write performance will be downgrade a lot if perform the testing over WIFI. My laptop have G and connect to WRT54GL. it's about 1.5MB/S for read/write, but from PC with LAN, as I wrote, 4000KB/S writing & near 3000KB/S reading.
  43. teddy_bear

    teddy_bear Network Guru Member

    Great! Now even "Extras" build has 64K of available JFFS space (2 EBs total)!..

    I decided not to add "zero reserve" option for now since it won't work anyway - all builds have at least 2 or more EBs available for JFFS. I'll enable it later, if the firmware size increases so it becomes useful.
    Well, the main reason why there're still no 2.6-based firmwares for Broadcom routers is that the Broadcom doesn't provide sources of the wireless driver, and the binaries only existed for kernel 2.4. OpenWRT uses another open source driver in their 2.6 line, but it's still on the early stage of development and has a lot of problems. But there's a good news - there is already a new Broadcom driver for kernel 2.6 (see this dmesg output from the prototype Asus RT-N16 unit), and hopefully we'll see the next generation of routers with 2.6-based firmwares some time next year.
  44. teddy_bear

    teddy_bear Network Guru Member

    Make/gcc is not included, so you can't compile applications on a router. You need to cross-compile them on your Linux box using Tomato toolchain.
    But you don't need to compile ushare yourself. Just install Optware - ushare is available as pre-compiled Optware package.

    WL520GU clock is fixed in this mod (not in official Tomato 1.23 though). Don't know why you think it breaks USB support - it's included in this mod from day one (and mentioned in the 1st post), and doesn't cause any issues. The clock rate is fixed in dd-wrt also - in fact, I'm using their fix.
  45. teddy_bear

    teddy_bear Network Guru Member

    Update - build 25.

    • New version 1.3 of the JFFS filesystem from ray123 which provides more JFFS space. Now even "Extras" build has 64KB of JFFS space available on 4MB flash. "Lite" and "No-CIFS" builds also gained extra 64KB.
    • Updated MiniUPnPd to the latest version 1.3 (20090417).
    • Added wireless auto channel selection.
    • Changed to use passive mode for wireless scan. On my Asus it consistently picks up more APs (including non-broadcasting ones) compare to Tomato default active mode. Hopefuly it will work better (or at least the same) for everyone else.
    • USB kernel driver fixes.
    • Updated mkdosfs in "Extras" build.
    • Cosmetics.
    Links to the firmware binaries and the git repository with sources are in the 1st post. The complete sources of this build can also be downloaded as a git snapshot in tar format.
  46. kosiko

    kosiko Addicted to LI Member

    I will try this new build for sure. Can I know what issue fixed in the "USB Kernel driver fixes"?

    And also, thanks for the tip above about the OPTware. Do you have any comment on the SMB read/write performance? And how to improve the performance. I would try to have SAMBA 3/4 on the router later, maybe newer version can run faster, I wish the router has enough ram to run newer samba:biggrin:

  47. teddy_bear

    teddy_bear Network Guru Member

    You can refer to Git reposiztory for more details ;). These are minor updates backported from kernel 2.6 that supposedly can reduce or eliminate errors when using some usb devices.
    I don't think you'll get any performance improvements with newer Samba - I believe these are hardware limitations on these routers, not the software.
  48. kosiko

    kosiko Addicted to LI Member

    hmm, interesting. I remember I saw someone reported the SAMBA 3/4 will have a little improvement, but not much though. And I also saw some posts mentioned the bottle neck on the SMB performance is the CPU. However, when I monitor the CPU, it's only about 50% on the SMBD and 6% on the USB-Storage process, not like the CPU is the bottle neck(shouldn't the CPU become 100% when CPU is the bottleneck?)

    Anyway, this current performance is ok to me except HD movie, regular DVD RIP, MUSIC etc are good here:thumbup:. I will report here if I find any thing good.

    I forgot the ask, do you have any idea how to let the router bring the printer to sleep mode/standby mode to save power? Thanks again!

  49. teddy_bear

    teddy_bear Network Guru Member

    No idea why it doesn't work with your printer... I'm using Brother HL-5240 and Epson CX8400 AIO, and have no issues with them - both go to standby mode just fine.
  50. kosiko

    kosiko Addicted to LI Member

    Good to know. I got a very similar test result, seems I should have a better HDD to boost the SMB performance, lol, will try with another HDD and update later.
  51. trevorw

    trevorw LI Guru Member

    Hi guys,

    I've been running Tomato for more then 2 years and now I see that my logs contain only the last 24 months. Would it be possible to change that so the logs can keep growing and growing? I know it sounds like a mundane thing but I'd like to keep a record of the data coming and going through my router.

  52. Anserk

    Anserk Addicted to LI Member

    No, it doesn't break USB support (I read it on one of the older forums) for me, but I do have time issues. Upon flashing, within 24 hours the clock drifted for almost 4 hours back (I set NTP option to sync only upon start-up).

    I'm glad to hear though that the issue is fixed. I looked on the 1st page - it mentions about at least one reboot for resolving clock issues. I think I never rebooted my router after flashing it with Tomato - it's stable and takes configuration changes without reboot.:thumbup:

    I just rebooted it and will see if the time issue goes away.
  53. Anserk

    Anserk Addicted to LI Member

    Is there any way to put logs on a flash drive, instead of router's RAM?
  54. teddy_bear

    teddy_bear Network Guru Member

  55. Anserk

    Anserk Addicted to LI Member

    Thanks, now I will find even more use for USB functionality.

    By the way, one hour after I did a reboot my router time is second-to-second with my PC. Sorry about bothering you, I should have been reading better about additional reboot :knock: Everything works like a charm now :eek:nfire:
  56. trevorw

    trevorw LI Guru Member

    Anybody managed to get the VPN working with teddy_bear's mod? I know there are some tomato mods that address this but I really don't want to give up this one (which works just great) - thanks again teddy_bear!
    Are there any (kernel) settings that need to be adjusted or is it enough just installing from optware ? - any suggestions or leads are appreciated. Of course, having a web interface for it would be ideal...

    I'm using v24 and with an uptime of 10 days and one laptop connected 24/7 on wifi, I get somewhere between +8 and +10 seconds time difference on each 24h NTP update.
    In my case, I have some data and some router data mounted on a USB stick (fat).

    @teddy_bear or @ray123
    How does extending the logs to more then 24 months sound to you guys as a feature request? Ideally it would depend on the amount of space left (especially with storage to USB) but I guess 2x/5x the number of months would work just fine especially since the file per se is small (mine is 2k unzipped) so it wouldn't take any precious memory. Thanks!
  57. trevorw

    trevorw LI Guru Member

    I'm definitely no linux expert but in a primitive way, you could setup a cron task to reset the modem every 2-3 days. Isn't just getting a new connection/ip enough? Can you update the firmware on your adsl modem?

    By the way, now that you've mentioned it, I think I have similar symptoms (also on a PPoE connection with a bridged ADSL modem, from Huawei in my case).
  58. kosiko

    kosiko Addicted to LI Member

    I tried again today, the printer can go to standby mode. Something wrong yesterday.

  59. kosiko

    kosiko Addicted to LI Member

    Hi guys,

    I am looking for a Hard drive docking station to connect to my WL-500GP V2. I am considering the 2 models below:

    1. docking with card reader and USB hub:

    2. docking with eSATA:

    The price is so close, in terms of usage, I really prefer the 1st one, but I remember I saw the post before (should be posted by teddy bear) mentioned that the TOMATO USB MOD doesn't support multiple LUN device well. I think the 1st one is the multiple LUN device (correct me if I am wrong).

    But I also knew Teddy himself use a USB HUB to hook his USB devices (sounds like multiple LUN situation too), I am kinda confused here. Any idea? Thoughts?

  60. ray123

    ray123 LI Guru Member

    Tomato now supports multi-lun devices just fine. It has ever since my USB patches got pulled in. BTW, USB hub is a completely different thing than multi-lun devices. From the description & picutes of the 1st one, I can't tell if it is multilun or just a USB hub. Shouldn't matter, I suspect it'll work just fine. At $25, it's hard to go wrong, esp with no restocking fee and 21 day money back.
  61. kosiko

    kosiko Addicted to LI Member

    Hey Ray,

    Thanks for the super fast response. I spent 2 days to read this long thread and now I am still at page48, reading so slow :frown:

    Monoprice is good site and I used to buy cables and small stuffs from them (I am from Canada, need to pay more shipping though). I compared the docking from (free shipping), they got same product but different color/brand name too, but the one from seems better. I will definitely order the 1st one as you confirmed it the current mod should work with this docking (I had some old 2.5" & 3.5" OLD HDD so docking is better the enclosure for me, and should be better for heating).

    Ray, one question to you, in your todo list, I see the VPN item. Do you or Teddy has a time line or plan for have the VPN version release? I know I can install OPENVPN from OPTware but if you & Teddy can have a build that include StPepper's VPN gui into this USB mod that will be great. I never try OPEN VPN and I didn't see the screen shot of the VPN GUI version but seems it's pretty good for manage vpn scenario as it provide GUI and has some customizes then standard OPEN VPN. For other features like torrent, scanner etc, are easier to deal with by peoples themselves I believe, no need to build into the firmware.


  62. teddy_bear

    teddy_bear Network Guru Member

    I'll try to make a merge in Git with St.Pepper mod - resolving all conflicts should be relatively easy, I've already done it before. I just wanted to wait a few days after the last v25 release to see if anyone reports any serious bugs...
  63. kosiko

    kosiko Addicted to LI Member


    That will be great!!! How would you like to assemble the VPN gui mod into your USB Mod?

    1. Existing EXTRA build+vpn mod, keep the name EXTRA build
    2. Existing EXTRA build+VPN GUI mod, give a new seperate VPN build (this way 4MB flash user can still use extra build)
    3. Existing STAND build+vpn mod, name it VPN build
    4. Other method.

    I want SAMBA+FTP+DISKTOOL+VPN, #2 above could be a better way I guess.:thumbup:

    Thank you
  64. kosiko

    kosiko Addicted to LI Member

    SAMBA hang

    Hi TB/Ray,

    I got my 2.5" HDD /w enclosure connect to WL-500GP V2 with V24 USB MOD. The hdd was formated on the Tomato as ext2.

    Today I am uploading some files from this HDD by FTP to a remote FTP server, the upload speed (read speed on samba) is about 50KB/s only, not much pressure to SAMBA; In the same time, I am downloading some files (various size, the biggest one is 550MB only) to the share on this HDD from my XP laptop, the downlaod speed (write speed to SAMBA) is about 150KB/S only. Everything went pretty well at the beginning but I found the share folder hang on my XP laptop 1 hour later.

    I found errors in the /var/log/message and, in the top command, there are many SMBD process, usually I can see only 2 SMBD there. Please note that my FTP software and download software are single thread only.

    Please help. To me seems my read/write is NOT heavy at all, not sure why this happened:confused:. If you need more information, please let me know and tell me where I can get the log file etc.

    EDIT: I rebooted the router from SSH but the router can't bring up properly. I removed the HDD and then unplug the power of the router, the router can be up and then I hook the HDD back, mount manually successful (I didn't enable automount before). Now I continue the FTP upload (read from router, ftp to remote ftp server), it has the same problem, and from the FTP software log, I can see read error. Those multiple SMBD could be due to the FTP client can't read the file and then skipped the current one and request read the next file, then the SAMBA generated a new SMBD for the new read request as the previous on can't return files properly (in used or hang status).

    Attached Files:

  65. tstrike2000

    tstrike2000 Network Guru Member

    I updated to v25-std on my WL-500gP v2. I noticed some changes in v25 were:

    Added wireless auto channel selection.

    Changed to use passive mode for wireless scan (generally should pick up
    more APs).

    I did have a slight problem where the wireless dropped on my laptop, losing connection for a couple of minutes and then reconnected. Not sure if it was just coincidence, fluke, or what but just wanted to mention it. Not saying it's a bug. I just hadn't had that problem in a long time so I wasn't sure if again it was just a random weirdness or possibly a result of changes in this build.
  66. teddy_bear

    teddy_bear Network Guru Member

    Have not seen this error before. Try to add "veto oplock files" parameter to the "Samba Custom Configuration" (google it to find the proper format - I think you an specify the list of extensions in this parameter to disable oplocks for these extensions).
    EDIT: Take a look at this link: - in addition to "veto oplock files" parameter format it has some other interesting info - i.e. additional custom parameters you can try to speed up Samba a little.

    Unless you ran the wireless survey, or set the channel to "auto", the changes you mentioned couldn't not have any effect. Keep an eye on it, and let us know if you continue to have wirelss issues, or if it really was a glitch.
  67. kosiko

    kosiko Addicted to LI Member

    Thanks for the information TB, I will try and let you know the result.

    I found another little issue, when my SAMBA hag and XP can not connect back any more, I reboot the router from SSH, but the router didn't bring up (I tried twice). I touch nothing but unplug the power cord and plug it back, the router is back up as usual, I am not sure what's wrong. I will try the reboot from WEB GUI next time to see if SAMBA hang again. Let me know if you have any idea on this issue.

    edit: the info below copied from the link you provided is interesting, seems that's a known issue at samba, included 2.0.10 at this mod.

    "This area of Samba (oplocks) only really stabilised at around level 2.0.5 (and again at 2.2.2!), if something does not work and you have an older version, consider upgrading. "


    Now found! I found even I stopped my FTP and download program, and also clean up all share session by net use /d, which mean no READ/WRITE activite on XP side, I will still able to see the logs below generated at the /var/log/message, and about every 30 seconds add a new entry to this file:

    root@WL500:/tmp/var/log# cat messages |grep request_oplock_break
    Dec 31 22:20:29 WL500 daemon.err smbd[536]: [1969/12/31 22:20:29, 0] smbd/oplock.c:request_oplock_break(1204)
    Dec 31 22:20:29 WL500 daemon.err smbd[536]: request_oplock_break: no response received to oplock break request to pid 460 on port 1026 for dev = 801, inode = 212604
    Dec 31 22:21:01 WL500 daemon.err smbd[536]: [1969/12/31 22:21:01, 0] smbd/oplock.c:request_oplock_break(1204)
    Dec 31 22:21:01 WL500 daemon.err smbd[536]: request_oplock_break: no response received to oplock break request to pid 460 on port 1026 for dev = 801, inode = 212604
    Dec 31 22:21:33 WL500 daemon.err smbd[536]: [1969/12/31 22:21:33, 0] smbd/oplock.c:request_oplock_break(1204)
    Dec 31 22:21:33 WL500 daemon.err smbd[536]: request_oplock_break: no response received to oplock break request to pid 460 on port 1026 for dev = 801, inode = 212604
    Dec 31 22:22:05 WL500 daemon.err smbd[536]: [1969/12/31 22:22:05, 0] smbd/oplock.c:request_oplock_break(1204)
    Dec 31 22:22:05 WL500 daemon.err smbd[536]: request_oplock_break: no response received to oplock break request to pid 460 on port 1026 for dev = 801, inode = 212604

    After I I did a save on the webgui, the samba re-start, no more error msg generated so far. Seems one the problem triggered, I have to recycle the samba or sooner or later sambe will hang as more and more smbd will be generated. Seems PID 460 lock the inode which PID 536 needed. If the problem happen again, I will try another parameter "oplocks = no"


  68. ray123

    ray123 LI Guru Member

    If a process is truly hung, then the reboot command generally won't work. It seems to hang waiting for the hung process to respond-----which of course won't happen. I've encountered this many times during my development/testing of jffs & usb-disks. At that point, you indeed must cycle the power.
  69. kosiko

    kosiko Addicted to LI Member

    Nice to know. Thanks
  70. i1135t

    i1135t Network Guru Member

    Cool, just what I need... USB support and VPN capabilities. Now if only it had some of the add-ons from Victek's mod, it would be a superb firmware, not that it isn't already. Anyways, hope to test it out soon. Thanks!
  71. teddy_bear

    teddy_bear Network Guru Member

    Ok guys,

    The merge of v25 USB mod Standard with the latest version of VPN mod by SgtPepperKSU vpn3.2 is available from the same download location (links are in the 1st post) as other binaries - go to "Experimental" folder, and download "tomato-1.23-ND-USB-v25-Std-vpn3.2.rar".

    Hopefully it will still fit into 4MB flash although I have not tried it myself - I'm not using VPN stuff and would not know what and how to test anyway. If you want VPN pretty badly, and are brave enough to try installing and testing it :) - go ahead, and post the results here, so others will know.
  72. InsaneNutter

    InsaneNutter Addicted to LI Member

    Thanks, you added the one thing Tomato was missing.. usb support! :hearts:

    I’ve just flashed this on my Asus WL-520GU, copied the settings across from my WRT54g and everything appears to be working perfectly, amazing work! :thumbup:

    I have a question about the FTP Server, is it possible to assign an ftp username a root folder that only that user can see?

    From what I can work out its possible to have three different root folders, one for Anonymous, one for any user with read / write access and one for any private users.
  73. i1135t

    i1135t Network Guru Member

    Thanks, so far so good. No major/minor issues at the moment, so thanks again!


    Well, looks like I spoke too soon. The wireless driver may be no good. I cannot get a stable connection at all for any of my wireless connections. It will connect for a second, then disconnect and loop that over and over. I even tried setting a static IP and still no go. I also tried resetting all the advanced wireless settings to default, but still no help. Nothing in the logs as well. Right now, I just disabled the radio.

    Can you change the wireless driver? I have the WL-500GP v1 router, if you need that info.
  74. teddy_bear

    teddy_bear Network Guru Member

    Whatever the problem is, I doubt it's the wl driver by itself. Many people are successfully using this mod on WL-500GP, and I don't see a lot of complains here if any. Of course, something might have got broken when merging 2 mods (hopefully that's not the case - but could be)...

    Try to reset the nvram settings to default (not just the advanced wireless, but do the complete reset), and reconfigure manually - that's the 1st step in troubleshooting... If that won't help, you can try the regular USB v25 mod (without VPN) to see if you'll experience the same issues - this way we can either confirm or eliminate the merge as a cause. You can also try to upgrade/downgrade your wireless client drivers - but of course if the behavior is the same across several different wireless clients that may be pointless.

    By the way, I already see a lot of downloads of the combined USB+VPN mod. Any more feedback from anyone else?
  75. i1135t

    i1135t Network Guru Member

    OK, I did a NVRAM clear and reconfigured from scratch and appears to have fixed the problem. Dunno what caused it...? I will keep my fingers crossed. :)
  76. ray123

    ray123 LI Guru Member

    Time accuracy

    For some unknown reason I took a look at the clock accuracy on my Tomato (ASUS WL-520GU) router. It's uglier than anybody thought! A previous comment had said that the clock runs slow, but is stable, so a simple tweak with ntpc would have it keeping pretty good accuracy.


    I built & installed chronyd (an independent implementation of ntpd) on Tomato and watched the statistics.
    When everything is idle, the clock is slow by about 105 ppm. Quite stable, so it's easy to adjust the parameters to cancel out the slowness.

    But, then I started up utorrent on my PC (time to download some ebooks for my upcoming trip out of town). Bandwidth was 1012 kbits/s RX and 474 kbits/s TX. Subsequently I looked at the chrony statistics. The clock now ran about 490 ppm slow.

    This is almost a 5-to-1 change in the accuracy. There is no way to do a one-time tweak to cancel out the clock slowness.

    100ppm = 9 seconds per day or 60 seconds per week
    500ppm = 43 seconds per day or 302 seconds per week

    So........what is to be done? Does it even matter if the clock in a router drifts anywhere from 9 to 43 seconds in a day? Maybe more---maybe my box is slower or faster than other boxes. Chronyd does a very good job---but it is very large. The Ntpc that is currently in Tomato is quite small, but it is rather stupid--but maybe it's Good Enough. Openntp is only slightly larger than ntpc---but I haven't (yet) been able to get it working reliably.

    Ntpc could be slightly enhanced to dynamically adjust the clock freq, like chrony (and ntp) does. It wouldn't be as good as chrony, but it would be 10 times better than the current ntpc.

    The ntp spec calls for the ntp client to query the time server as much as every 20 minutes or every 68 minutes. If ntpc ran every hour, that's about the same load as a real ntp client would place on a server. And (at 500 ppm) the time wouldn't drift more than 2 seconds in that hour. Probably no more than 1/10 second with the simple enhancement I have in mind.

    Any thoughts?

    Anybody care?

    Would anybody care to run my build of chronyd on their router, and report back on their statistics? If so, I'll upload it.
  77. teddy_bear

    teddy_bear Network Guru Member

    Well, the problem with original Tomato before the fix was that the time was drifting 10 mins per hour! That was pretty bad - it was affecting my Asterisk registrations and messed up the logs, unless I run ntp client every 5 mins.

    Now I run ntpc every 12 hrs, and the time corrections needed during these syncs are never larger than 6-7 secs. For me that's completely acceptable - I don't care about these few seconds ;).
  78. InsaneNutter

    InsaneNutter Addicted to LI Member

    Ah i see, perfect!

    Thanks a lot.
  79. jeremycobert

    jeremycobert Network Guru Member

    is there anyway to monitor my ISP's connection uptime with this firmware ? currently on my ubuntu server i run this command to ping my isp's gateway. i was wondering if there is a way to run this from the router and have it log the when my isp goes down.

    "while true; do ping -c 1 > /dev/null; if [ $? -ne 0 ]; then echo -n "Connection down at "; date; fi; sleep 5; done"
  80. ray123

    ray123 LI Guru Member

    Easy. Several ways to do this.
    Easiest is:
    Create your script, say it's "/etc/pingisp". Test it.
    Save it to the nvram: "nvram setfile2nvram /etc/pingisp"
    In the Tomato GUI, edit the startup script, add the line: "/etc/pingisp &"

    Reboot & verify that it's running.
  81. i1135t

    i1135t Network Guru Member

    OK, well I found a bug for the VPN build. It looks like the "respond to DNS" check box does not work. It doesn't tunnel my DNS traffic through the VPN. I had to add:
    to my dnsmasq to get it to work. Could it be fixed?

    -- EDIT --

    Funny thing was that on my Linux box, it worked regardless, probably because my script adds the DNS server, but on my Windows XP Pro box, it adds the DNS, but it doesn't tunnel the request.
  82. fyellin

    fyellin LI Guru Member

    What is the code "nvram setfile2nvram /etc/pingisp"? My tomato doesn't have that sub-command (thought it would be awfully useful!)
  83. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    Have you tried it with the TomatoVPN firmware? It could be that the dnsmasq part of the changes didn't get merged in this USB build (specifically, this).
  84. SgtPepperKSU

    SgtPepperKSU Network Guru Member

  85. i1135t

    i1135t Network Guru Member

    Well, I assume that question is directed towards Teddy. I, myself, have not tried flashing your latest VPNonly build, but I have tested the lastest one that Thor built, which includes your latest VPN changes, and the DNS tunnel issue worked fine....
  86. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    The question was directed at you, in case you had some unique configuration that causes it to fail in all VPN builds. However, that it works when you tried Thor's build indicates that it is probably just a merge problem here.
    The statement after the question was a hint to teddy_bear on where the merge was likely messed up based on the symptoms.
  87. teddy_bear

    teddy_bear Network Guru Member

    Hmm... I looked at the merge in Git, and it appears to correctly include this particular part...

    Try to uncheck and recheck "Respond to DNS" box to see if it makes any difference. What is the value of your "vpn_server_dns" nvram variable?

    I pushed a new merge branch into the repo: tomato-ND-USB-VPN.
    When you get a chance, could you please take a look to see if there's anything there that's messed up? To me it seems that the merge worked correctly unless I'm missing something.
  88. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    It does indeed look like it merged okay. Did you compile from a clean source tree, or did you compile some of it, make some OpenVPN related changes, then compile the rest? Much of the functionality is stripped out entirely if TCONFIG_OPENVPN isn't defined, so it could have gotten stripped out of services.c if that was compiled before TCONFIG_OPENVPN was defined. Of course, if you compiled it all at once, this doesn't apply.

    By the way, I made separate vpngui and tomatovpn branches so that other builds that wanted the VPN GUI, but not the other changes I've made (version numbering changes, etc), can merge vpngui and openvpn (that and I structured it so that I could add and remove different VPN backends, like PPTP IPSec or Openvpn, and leave the GUI alone). So if you did that, it might make the merging simpler.
  89. teddy_bear

    teddy_bear Network Guru Member

    Sure, it was a clean build from a merged source tree, after "git clean -f -d", with TCONFIG_OPENVPN defined. Strange...

    Thanks for the tip! I'll keep it in mind the next time I'm merging these 2 mods.
  90. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    I may have just found something: here. You have TCONFIG_OPENVPN as "not set" here. Might be causing a problem.
  91. teddy_bear

    teddy_bear Network Guru Member

    TCONFIG_OPENVPN is set by the release/src/Makefile when called with "e" (VPN build) parameter:
    @sed -i "/TCONFIG_LZO/d" router/config_$@
    @sed -i "/TCONFIG_OPENVPN/d" router/config_$@
    @echo "TCONFIG_LZO=y" >>router/config_$@
    @echo "TCONFIG_OPENVPN=y" >>router/config_$@
    Otherwise none of the VPN stuff could get in I suppose... And yes, I do the hard reset of the branch before the build, just didn't mention it:
    git reset --hard; git clean -f -d; make V1=8625 V2="vpn3.2" e
    Do you think -x param for "clean" really matters in this case?
  92. i1135t

    i1135t Network Guru Member

    I tried that when I was at work and it didn't make a difference when I was testing the DNS tunnel. I didn't reboot the router though, as I assume it was not necessary. I just disconnected from the VPN after saving the changes and waited for the VPN server to restart before I reconnected.

    Right now, I have it checked and nvram shows:
    I then unchecked and saved and then it shows:
    So, it appears that the GUI portion is setting the variable correctly...? When I am at work tomorrow, I will fully test again, this time rebooting the router after each change and report back.

    Oh, I forgot to mention that there were times when I could not ping my router's IP, but I could ping the other computers on the same subnet. Not sure what was going on there. Will give more details tomorrow. Just wanted to let you know.
  93. teddy_bear

    teddy_bear Network Guru Member

    Could you also post output of the "nvram show | grep vpn_server" command (mask your personal info if any)?
    If you don't make any changes to dnsmasq custom configuration, does the dnsmasq.conf contain any "interface=[...]" lines except the one for LAN interface on the 2nd line? Trying to find out if the code writing dnsmasq.conf is not getting executed, or if not all the nvram variables are getting set correctly for some reason...
  94. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    There are two different sets of variables called TCONFIG_*. There's the ones the build process use, and the ones the c source files use. I found when I tried to manually set some of the config files to include TCONFIG_OPENVPN, that the two would get out of sync. The build process would make the vpn files, but the #define in tomato_config.h wouldn't have the macro defined (it must do something tricky with only updating "new" defines). This type of problem would pop up. That's why I decided to not try to configure in OpenVPN ahead of time. After a couple of tries, I decided to just make the tomatovpn branch just enable everything (there weren't any components I didn't want anyway, vpngui branch asks at build-time) and let it treat TCONFIG_OPENVPN as a "new" option. You might check the contents of tomato_config.h after the compile to see if TCONFIG_OPENVPN is defined. I'm guessing it won't be.

    As for the cleaning command, it's not relevant and probably doesn't make a difference. As such, I removed it from my post before you responded, but I guess you'd already clicked reply. :blush:
  95. i1135t

    i1135t Network Guru Member

    Here is my output of that command after I removed the setting in my dnsmasq.
    vpn_server1_ca= ***REMOVED***
    vpn_server1_crt=  ***REMOVED***
    vpn_server1_custom=push "redirect-gateway def1" push "dhcp-option DNS"
    push "dhcp-option DOMAIN homey.local"
    vpn_server1_dh=  ***REMOVED***
    vpn_server1_key=  ***REMOVED***
    vpn_server1_static=  ***REMOVED***
    Here is my /etc/dnsmasq.conf output:
    It looks like it is showing... probably not a good sign... :(
  96. teddy_bear

    teddy_bear Network Guru Member

    The technique with modifying TCONFIG_ variables by the makefile (that ray123 came up with) has been tested, and is now used across the board in USB mod to compile 4 different configurations (or 5, including the VPN merge) since build 20. I doubt it suddenly stopped working after the merge...

    Well, looks like your dnsmasq config file is indeed genereated the way it's supposed to according to nvram settings and VPN mod code:
    SgtPepperKSU can probably confirm if that's expected, or if there's anything wrong here - but looks fine to me...
  97. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    Good enough for me! The symptoms just matched the type of thing I've seen before with that stuff, so I thought I'd mention it.
    Indeed, it looks like everything is configured correctly. Not sure why it's not working. Maybe a new thread should be started to debug this.
  98. ghostknife

    ghostknife Addicted to LI Member

    Hi all,

    Been using tomato for a few weeks and all is good so now got USB drive and set up Samba, thats all good but I am really stumped trying to get FTP to work from outside my network. Inside is fine.
    I spent the last 4 hours now searching forum and google and came to nothing, only people running standard tomato and using filezilla or other FTP server on PC have the same error.

    From WAN I connect and authenticate but never get list (MS-FTP, IE and Fire-FTP all same) just errorin log: 425 Failed to establish connection

    220 (vsFTPd 2.1.0)
    230 Login successful.
    257 "/"
    TYPE A
    200 Switching to ASCII mode.
    227 Entering Passive Mode (121,xx,xxx,xx,36,100).
    LIST -al

    Setup is WL-520 with WAN disabled and LAN going to ADSL modem/voip/router, ports 20-21 are forwarded to WL-520 (static IP),
    From reading only FTP related posts I could find I'm pretty sure my problem is that I need to forward some other ports for the data channel (using PASV on clients) but don't know which ones FTP-mod uses or how to change/config them so if you can tell me that'd be great.

    If I DMZ the WL-520 and/or allow anonymous I have had it working but this is not a solution since not using WAN port and then entire network open =bad

    EDIT: Ok weird but using ftp://user:pass@server in FF3/IE I can access but still FireFTP will not work so I don't know what the difference is. Maybe something on server I was RDP to test from is setup wrong but don't know what, FTP is FTP right?
    Also I have in vsftpd custom: pasv_min_port=30000 pasv_max_port=30010
    and fwd those ports, is this correct?
  99. i1135t

    i1135t Network Guru Member

    OK, not sure what the heck is going on, but it looks like it is working now. I removed the line config in the dnsmasq, reboot and tested it from my Windows box and now it work. WTF?

    Thanks for the effort guys, if the problem reemerges, I will try doing a NVRAM clear and reconfigure from scratch and post any problems. Thanks.
  100. teddy_bear

    teddy_bear Network Guru Member

    There's nothing wrong or bad in putting WL520GU into DMZ of your ADSL router/modem if this is the only device attached to the LAN side of the modem. You don't need a double NAT - if you're doing NATing/firewalling in Tomato on 520gu, there's no need for additional NATing on ADSL router.

    If you prefer to use NAT/firewall on the ADSL router and turn it off in Tomato, that's ok too - but you will have to come up with all sorts of tricks to make some things working properly behind NAT - including ftp. In that case you should follow the same guidelines as you found for using ftp on the PC behind NAT.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice