Tomato ND USB Mod

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

  1. veejl

    veejl Addicted to LI Member

    According to the latest DD-WRT USB drivers, HFS and HFS+ support has been added.

    Any ideas on how to pull that into Tomato on my 520gu? That would make the ultimate router for me since I could then do networked bootable backups.
  2. teddy_bear

    teddy_bear Network Guru Member

  3. veejl

    veejl Addicted to LI Member

  4. ghostknife

    ghostknife Addicted to LI Member

    I think this has been covered and i searched but didn't find anything.

    Since I upgraded some to Win7 last week my log just keeps filling up with DHCP info, I have DHCP Client logging turned on but it has always been on and never did this before. At around the same time I upgraded to v1.28.8749ND_USB_vpn3.6 so I'm not sure where the problem was introduced. I'd like to keeep DHCP logging on so I can see who/what is requesting so I don't really want to turn it off, any ideas?

    EDIT: Now I think about it I didn't (can't) explain that very well, heres a very small sample of what log look like, it's something I have done or setting I changed I'm sure but I don't know what. isn't even Win7, it's a WinXP VM on Win7 machine

    Sep 16 21:54:57 WL500 dnsmasq-dhcp[14956]: DHCPACK(br0)
    Sep 16 21:54:57 WL500 dnsmasq-dhcp[14956]: DHCPREQUEST(br0)
    Sep 16 21:54:57 WL500 dnsmasq-dhcp[14956]: DHCPACK(br0)
    Sep 16 21:55:07 WL500 dnsmasq-dhcp[14956]: DHCPINFORM(br0)
    Sep 16 21:55:07 WL500 dnsmasq-dhcp[14956]: DHCPACK(br0)
    Sep 16 21:55:07 WL500 dnsmasq-dhcp[14956]: DHCPINFORM(br0)
    Sep 16 21:55:07 WL500 dnsmasq-dhcp[14956]: DHCPACK(br0)
    Sep 16 21:56:08 WL500 dnsmasq-dhcp[14956]: DHCPINFORM(br0)
    Sep 16 21:56:08 WL500 dnsmasq-dhcp[14956]: DHCPACK(br0)
    Sep 16 21:56:08 WL500 dnsmasq-dhcp[14956]: DHCPINFORM(br0)
    Sep 16 21:56:08 WL500 dnsmasq-dhcp[14956]: DHCPACK(br0)
    Sep 16 22:03:36 WL500 dnsmasq-dhcp[14956]: DHCPINFORM(br0)
    Sep 16 22:03:36 WL500 dnsmasq-dhcp[14956]: DHCPACK(br0)
    Sep 16 22:03:36 WL500 dnsmasq-dhcp[14956]: DHCPINFORM(br0)
    Sep 16 22:03:36 WL500 dnsmasq-dhcp[14956]: DHCPACK(br0)
    Sep 16 22:07:46 WL500 dnsmasq-dhcp[14956]: DHCPDISCOVER(br0)

  5. teddy_bear

    teddy_bear Network Guru Member

  6. ghostknife

    ghostknife Addicted to LI Member

    Thanks, explains why I couldn't find it in this thread, should have looked at the other one. Must have seen it there but I'm still on kernel 2.4 so didn't look.
  7. pkilway

    pkilway Networkin' Nut Member

    Can anyone help me configure my USB printer using this mod of Tomato?

    I can see this in the USB section of the Tomato firmware:
    Type Host Description Mounted?
    Storage 0 HP PSC 2355 No [Mount]
    Printer lp0 HP PSC 2350 series

    But I can't see this printer in Windows XP.
  8. hpdad

    hpdad Networkin' Nut Member

  9. ghostknife

    ghostknife Addicted to LI Member

    Look on the FIRST page

    "Follow these directions to set up your printer in Windows"
  10. ghostknife

    ghostknife Addicted to LI Member

    What configuration do you have for 520GU WAN port? DHCP/Disabled/PPPoE?
    I think in the US your DSL uses DHCP, in Australia we still use PPPoE so not sure on how it's supposed to be set up.

    My suggestion (since you had it working before) is to reset to default, unplug it from the modem and try again so that the modem can be ruled out as the cause, 2wire modem so anything could happen.
  11. netdevil

    netdevil Guest

    Hi hpdad, just noticed that the network address looks a little odd. Are you sure that you have the printer in a different network? Shouldn't it rather be, as that would be the network address of your router?
  12. hpdad

    hpdad Networkin' Nut Member


    Sorry, it's typo. It's


    I did reset many times. I don't remember what config. on Asus router. Will check it later tonight. At this point, I am very close to give up.

    It's strange because I didn't do any set up much before (Verizon DSL and Westell 6100g modem). After flashed it with tomato FW, set the port for printer on computer and it was all set.
  13. WRobertE

    WRobertE Addicted to LI Member

    A few posts ago you stated that your router had IP address, but you also say the IP address of the printer is

    Maybe I'm just misunderstanding the setup, but 2 devices on a network cannot have the same IP address, so how about changing the printer's IP address to
  14. hpdad

    hpdad Networkin' Nut Member

    I am not clear one thing about printer's IP, please explain to me.

    When I set up usb printer, I connected printer to usb on Asus router and configured:

    Protocol: RAW
    Port number: 9100

    My question is the port above is printer' IP? If not, how to look for it.
  15. WRobertE

    WRobertE Addicted to LI Member

    Sorry...I misunderstood.

    A few posts ago, ghostknife said to look at the first post in this thread from TeddyBear.

    Here's the link: First post in this thread

    In that first post, there's this section:

    And a link is provided with some specific instructions: Here's the link again

    Even though the instructions at the link say it's for Windows 2000, it should work similarly for XP.

    Have you tried these steps?
  16. hpdad

    hpdad Networkin' Nut Member

    Yes, I did. These are steps to configure the port for printer.
  17. WRobertE

    WRobertE Addicted to LI Member

    I ran into a problem similar to this several years ago when I was helping a friend setup a HP printer as a network printer. If I remember correctly, I ultimately had to un-install the HP printer drivers and software from the PC and then re-install them.

    I believe the driver installation process asks whether the printer will be connected via a network and when this option is selected additional network-related components are then installed on the PC to enable the PC to see the network printer.

    Obviously the router sees the printer based upon your earlier posts.

    So, I think I would try reinstalling the printer software on the XP computer and make sure to select the network printer option when asked. You may need to download the most current printer installation software for your printer rather than using the CD's that might have been shipped with the printer.

    A prior post shows the router recognizes this as: Printer lp0 HP PSC 2350 series

    The software / drivers page for this HP printer is here:
    HP PSC 2350 Drivers

    For XP there are 2 "Driver" options - a BASIC version and a FULL version.

    The BASIC version says:
    So, I suspect you'll need to download the FULL version and then do the re-install where you'll probably be able to select the network option.
  18. ghostknife

    ghostknife Addicted to LI Member

    I did but that was for a different person (pkilway-Network Newbie) & different problem on XP, here we are talking about Win7

    This setup is for a print server, which is running on the Asus router, hence it has the same IP address. If the printer itself had network functionality then yes it would be a different address, but then there would be no need for Tomato & this setup at all. If you had a new HP/Canon printer that has inbuilt Wifi or Ethernet it will have a different IP.

    This is correct as far as I can see, I have just installed Win7 recently and mine is working with these options but IP ( I just tested it with different network device types (Generic Network Card & Network Print server-1 USB port) and both work the same. Win7 detects Tomato as Generic Network Card so this shouldn't be your problem.

    Have you tried printing/setup with Tomato Router Dis-connected from that 2wire modem? Those things are a bit rubbish in my experience and sometimes go haywire, maybe it's having some effect.

    When you turn on the printer & try to print are you getting anything in the Tomato logs at all, i.e. is the print job leaving you PC and hitting the router?


    Sep 29 17:30:14 WL500 kernel: hub.c: new USB device 00:03.1-1.2, assigned address 4
    Sep 29 17:30:14 WL500 kernel: printer.c: usblp0: USB Bidirectional printer dev 4 if 1 alt 0 proto 2 vid 0x04A9 pid 0x171A
    Sep 29 17:30:15 WL500 user.warn kernel: Vendor: Canon Model: MP810Storage Rev: 0103
    Sep 29 17:30:15 WL500 user.warn kernel: Type: Direct-Access ANSI SCSI revision: 02
    Sep 29 17:30:15 WL500 user.warn kernel: Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
    Sep 29 17:36:06 WL500 kernel: printer.c: usblp0: off-line
    Sep 29 17:38:09 WL500 lpr.err p9100d[56]: write: Connection reset by peer
    Sep 29 17:38:09 WL500 lpr.notice p9100d[56]: Finished job: 303471 bytes received, 5960 bytes sent
    Sep 29 17:38:09 WL500 lpr.notice p9100d[56]: Connection from port 58181 accepted
    Sep 29 17:38:11 WL500 lpr.notice p9100d[56]: Finished job: 743141 bytes received, 3240 bytes sent
    Sep 29 17:38:12 WL500 lpr.notice p9100d[56]: Connection from port 58207 accepted
  19. hpdad

    hpdad Networkin' Nut Member

    My printer is Samsung ML-2510. I did re-install the printer software with the cd came with. Problem is still.

    Now if I print using usb cable, then the printing is fine. Of course, I have to select different port.

    When I set up Asus router, I disconnected it from 2wire modem/router.

    Which page to check in tomato log if print job hitting router? Will check it tonight.

  20. ghostknife

    ghostknife Addicted to LI Member

    Is that printer software for Win7 cause I just used the driver that was included in Win7, i didn't D/L or install anything. (on a Canon MP810)

    Edit: OK doesn't seem like there is an included driver for the 2510. Now that I realise it's a laser, are you trying to use the PS or PCL6 driver?
    I seem to recall there might be some issue with using PS but I could be imagining that, tried both?

    Also no need to install all the software, go here:
    Get the - Windows 7 (32bit, 64bit) - Version 3.01 - Print Driver - 9.6mb
    Extract that to a folder and then just browse there when installing printer, avoids any issue with all the included software *may* cause.

    Which page to check in tomato log if print job hitting router? Will check it tonight.

    In Status>Logs , When I print I get like I posted above, the last few lines.
  21. hpdad

    hpdad Networkin' Nut Member

    I have been using the driver for W7 same the one on your link.

    Yesterday, I was messing with again. Didn't remember what I did but the printer worked.

    Thanks for all the helps guys.

    You mentioned PS and PCL6, what are these drivers? Google them seem many people using them on HP printers. Are they necessary?
  22. ghostknife

    ghostknife Addicted to LI Member

  23. teddy_bear

    teddy_bear Network Guru Member

  24. rhester72

    rhester72 Network Guru Member

    Looks like OpenVPN broke again in build 51 - maybe the old missing dependency problem?

    Can't tell for sure because I can no longer reach my home network from work. =) Will report back with more details tonight.

  25. teddy_bear

    teddy_bear Network Guru Member

    Keep me posted. Does anyone else experience an issue with OpenVPN?

    I tested that server starts normally, and both openssl shared libs look ok:
    Jan  1 07:50:22 unknown kernel: tun: Universal TUN/TAP device driver, 1.6
    Jan  1 07:50:22 unknown kernel: tun: (C) 1999-2004 Max Krasnyansky <>
    Jan  1 07:50:23 unknown kernel: device tun21 entered promiscuous mode
    Jan  1 07:50:23 unknown daemon.notice openvpn[1465]: OpenVPN 2.1.1 mipsel-unknown-linux-gnu [SSL] [LZO2] [EPOLL] built on Oct  6 2010
    Jan  1 07:50:23 unknown daemon.warn openvpn[1465]: NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x.  Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.
    Jan  1 07:50:23 unknown daemon.warn openvpn[1465]: NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
    Jan  1 07:50:23 unknown daemon.notice openvpn[1465]: Diffie-Hellman initialized with 1024 bit key
    Jan  1 07:50:23 unknown daemon.notice openvpn[1465]: TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
    Jan  1 07:50:23 unknown daemon.notice openvpn[1465]: TUN/TAP device tun21 opened
    Jan  1 07:50:23 unknown daemon.notice openvpn[1465]: TUN/TAP TX queue length set to 100
    Jan  1 07:50:23 unknown daemon.notice openvpn[1465]: /sbin/ifconfig tun21 pointopoint mtu 1500
    Jan  1 07:50:23 unknown daemon.notice openvpn[1465]: /sbin/route add -net netmask gw
    Jan  1 07:50:23 unknown daemon.notice openvpn[1465]: Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
    Jan  1 07:50:23 unknown daemon.notice openvpn[1474]: Socket Buffers: R=[112640->131072] S=[112640->131072]
    Jan  1 07:50:23 unknown daemon.notice openvpn[1474]: UDPv4 link local (bound): [undef]:1194
    Jan  1 07:50:23 unknown daemon.notice openvpn[1474]: UDPv4 link remote: [undef]
    Jan  1 07:50:23 unknown daemon.notice openvpn[1474]: MULTI: multi_init called, r=256 v=256
    Jan  1 07:50:23 unknown daemon.notice openvpn[1474]: IFCONFIG POOL: base= size=62
    Jan  1 07:50:23 unknown daemon.notice openvpn[1474]: Initialization Sequence Completed
  26. dbt78

    dbt78 Networkin' Nut Member

  27. teddy_bear

    teddy_bear Network Guru Member

    Ok, clarifying the question :wink:... Does anyone experience new issues with OpenVPN in build 51 that didn't exist in previous builds 49 and 50?
  28. dbt78

    dbt78 Networkin' Nut Member

    Yes , since build 49, before, I did not test
    Other servers work with BF-CBC cipher (ex
  29. rhester72

    rhester72 Network Guru Member


    I usually compile my own builds, but I just downloaded the precompile this time because I started having trouble with the kernel build in the last week or so.

    Doesn't the K26 Extras build normally include VPN (i.e. r2e)? The precompile doesn't seem to, which would certainly explain why OpenVPN stopped working. :)

  30. teddy_bear

    teddy_bear Network Guru Member

    Pre-compiled "Extras" build doesn't include OpenVPN. "VPN" build does... If you flashed the "Extras", VPN definitely won't work because it's not there :wink:
  31. ~nephelim~

    ~nephelim~ LI Guru Member

    Wanup script not launched anymore


    I just updated NoUSB Std from build 50 to build 51 without erasing the NVRAM and found out that wanup script is not launched anymore

    Init and firewall script works fine here though. :confused:

    Did anybody experience the same issue?
  32. rhester72

    rhester72 Network Guru Member

    I'm kinda confused then. r2e != "Extras", and r2v != "VPN"?

    Is there some sort of cross-reference chart that shows what the precompiled builds map to in terms of compile flags? :)

  33. rhester72

    rhester72 Network Guru Member


    I can't confirm this yet because VPN is again down and I'm not sure why, but what you describe actually matches some behavior I saw last night and dismissed as my own imagination. I will test further this evening.

  34. teddy_bear

    teddy_bear Network Guru Member

    My WAN Script is getting executed properly. What's your WAN connection type?
    make help
  35. ~nephelim~

    ~nephelim~ LI Guru Member

    Thanks. Additional confirmation will lift my confusion.

    I also carried a full NVRAM erase on my router but I was not able to restore wanup script functionality.

    I don't really know what else to try.
  36. ~nephelim~

    ~nephelim~ LI Guru Member

    I have a PPPoE connection.

    I tested both "Connect on demand" and "Keep alive" modes.
    I made some attempts by rebooting or manually disconnecting and connecting.

    I have logger command entries in all scripts (init, firewall, wanup and shutdown) and wanup has not triggered any log entry on any attempt.

    I also attempted a reflash but wanup is not launched anymore.
  37. rhester72

    rhester72 Network Guru Member

    Har har har. *laughs*

    I'm talking about how those line up with the downloadable build names from your site. r2e from make help claims to be "Extras", and most definitely includes VPN support, but the "Extras" downloadable precompiled build on your site does _not_, hence my confusion. :)

  38. teddy_bear

    teddy_bear Network Guru Member

    Is "firewall" script still triggered on every WAN reconnect for you?
    m            M build (standard plus extra utilities and NTFS support)
    e            E build (standard plus VPN, extra utilities and NTFS support)
    That's the diff between "extras" (M build) and VPN (E build)... Don't ask where these letter indicators came from :).
  39. ~nephelim~

    ~nephelim~ LI Guru Member

    Yes. firewall script is triggered after every reconnect attempt.

    Usually wanup would be triggered few seconds thereafter(after two miniupnpd log entries), but not anymore.
    Using build 51 after firewall script there is a new " syslog: SNet version started" log entry

    Reverting back to tomato-ND-1.28.8750-Std.trx restored wanup script functionality.
    Using build 50 there is no " syslog: SNet version started" log entry
    Oct  7 17:37:22 router user.notice root: Firewall Script Executing
    Oct  7 17:37:27 router daemon.notice miniupnpd[767]: received signal 15, good-bye
    Oct  7 17:37:28 router daemon.notice miniupnpd[976]: HTTP listening on port 2063
    Oct  7 17:37:28 router user.notice root: WAN UP Script Executing

    Please let me know if there is any additional test I could carry or info I could provide.
  40. teddy_bear

    teddy_bear Network Guru Member

    Very strange. Please provide the output of the following commands:
    cat /tmp/ppp/link
    cat /var/run/$(cat /tmp/ppp/link).pid
    ps | grep pppoecd
    FYI - "SNet version started" message is coming from the updated MiniUPNPd.
  41. ~nephelim~

    ~nephelim~ LI Guru Member

    I reflashed build 51.

    The result of the above commands are:

    /tmp/ppp/link =

    cat /var/run/$(cat /tmp/ppp/link).pid =

    ps | grep pppoecd =

    669 root 716 S pppoecd vlan1 -u XXXXXXXXXXXXXXXXXXX -p XXXXXXX -r 1

    pid changes after every reconnect attempt:
    on each attempt pppoecd pid (ps output) is the same one provided by cat /var/run/$(cat /tmp/ppp/link).pid

    I hoped SNet could provide some clues.

    After a reconnect the log entries that follow firewall script are :

    Oct  7 18:03:15 router user.notice root: Firewall Script Executing
    Oct  7 18:03:18 router ntpc[1424]: Time Updated: Thu, 07 Oct 2010 18:03:18 +0200 [+1s]
    Oct  7 18:03:21 router daemon.notice miniupnpd[1316]: received signal 15, good-bye
    Oct  7 18:03:21 router syslog: SNet version started
    Oct  7 18:03:21 router daemon.notice miniupnpd[1528]: HTTP listening on port 2073
    thereafter no additional log entries follow
  42. teddy_bear

    teddy_bear Network Guru Member

    All looks fine. I can't see from the code how it possibly can fail executing the WANUp script... How do you check if it runs, other than by the log entry? Is it supposed to do something else, and doesn't do it?

    Also - please check if the "/var/lib/misc/wan.connecting" and "/var/notice/wan" files exist after connection is established.
  43. ~nephelim~

    ~nephelim~ LI Guru Member

    I used wanup script to download and setup dnsmasq blocklist which also decreased free memory and added other entries to the log.

    I added the log entries at the beginning for init firewall wanup and shutdown script but ATM the wanup log entry is not logged. I confirmed that the blocklist is not active. the other wanup/adblock logger entries are not logged as well. firewall, init and shutdown logger entries work as intended.

    /var/notice/wan exists before (disconnected) and after connection is established (0 bytes file)

    /var/lib/misc/wan.connecting does not
  44. teddy_bear

    teddy_bear Network Guru Member

    Ok, everything looks normal. "/var/notice/wan" is actually getting created right before running the wanup script. I see no reason for it not to run.

    Try to clean the WANUp script up to only leave the log entry in there, and see if it gets executed. Also, try to delete "/var/notice/wan", and then reconnect - to make sure it actually is getting created.

    If that doesn't lead us to anything, I may need to send you a test build with lots of debug output to see what's going on - if you'll be willing to flash it.
  45. ~nephelim~

    ~nephelim~ LI Guru Member

    To carry this test I used PPPoe "Connection on demand" mode.
    I disconnected PPPoE and removed /var/notice/wan ( rm /var/notice/wan )

    I clicked on a website link of a webpage which was not cached in my browser without connecting PPPoE beforehand (connection was triggered due to PPPoE on demand feature)

    /var/notice/wan was created (0 byte) but only after few seconds the new webpage was completely loaded in my browser ( ls -lhs /var/notice/wan )

    I will revert to build 50 to confirm if this happens in the same way and update this post ASAP
     0 -rw-rw-rw-    1 root     root           0 Oct  7 20:15 /var/notice/wan
    Wanup script containing only "logger WAN UP Script Executing" did never create a log entry

    Thanks. I have Buffalo WHR-G54S and I will install a debug version as you see fit.
  46. teddy_bear

    teddy_bear Network Guru Member

    So have you tried to remove everything else from the WANUp script besides the log entry?
  47. ~nephelim~

    ~nephelim~ LI Guru Member

    Yes, I did. Sorry for the confusion, I probably edited my previous post while you were posting.

    I reverted back to build 50 and carried the same test.

    There is no difference in regard to the timing of var/notice/wan creation
  48. teddy_bear

    teddy_bear Network Guru Member

    Everything in your tests indicates that the WANUp script should be getting called. Except that it is not :frown:...
    When you did nvram erase, you didn't reload your old config by any chance, did you?
  49. ~nephelim~

    ~nephelim~ LI Guru Member

    I carried that test with a barebone configuration using logger to test wanup execution.

    I imported a config backup afterwards though and carried the subsequent test with such config by leaving only a logger line in wanup script

    I will test build 51 with a nvram erase + barebone config again (only PPPoE login and wanup script).
    This time I'll use wanup to create some file in the tmp folder.

    edit: no file is created upon PPPoE connections. Pasting the same lines in tools\system successfully creates a file in /tmp folder

    rm -f /tmp/gen
    echo works > /tmp/gen
    cat /tmp/gen
  50. rhester72

    rhester72 Network Guru Member

    OK, I am quite thoroughly confused.

    My WAN Up script only failed to fire on the first boot after applying 51 - but that doesn't appear to be the same experience nephelim had. I've rebooted 3 times since and each time everything came up clean.


    Any chance this could be related to the race condition changes that ray123 made?

  51. teddy_bear

    teddy_bear Network Guru Member

    As well as I am...
    I can't reproduce it with either DHCP or PPTP WAN connections. To test it with PPPoE, I need to install the test pppoe server somewhere first (btw, wanted to check if you have one in your repo - but your site seems to be down now)...

    Is your connection PPPoE, the same as nephelim's?

    I doubt the problem is related to that race condition fix - but of course, since we don't know what's causing it, it can be anything...
  52. rhester72

    rhester72 Network Guru Member

    I am indeed PPPoE.

    No pppoe server on my repo, have any recommendations?

    Site _should_ be up, let me know if it (still) isn't.

  53. ~nephelim~

    ~nephelim~ LI Guru Member

    Thanks for looking into this guys.

    Nor that I'm confident in my limited understanding but perhaps might be deleted too fast.

    Are there few commands I could use to continually rename tmp/ so I can confirm its contents preventing its deletion ?

    using multiple ls commands to confirm creation is overly impractical :frown: edit (found a script example on the Internet to carry this test - see next post of mine)

    I reverted back to build 50 and noticed that /tmp folder contains and (thus not deleted) whereas these files are deleted in build 51

    using bulid 51 I confirmed that a is created and deleted during reconnection attempt (I used multiple ls commands to check /tmp folder file list)

    Using multiple ls commands I confirmed creation lasts few seconds (enough to appear in a ls -lsh attempt) whereas I never managed to get the dynamically created in a ls output.

    I manually created a 0 byte /tmp/ and confirmed it is deleted during a reconnection attempt.

    I tried to look at the code (though I barely manage to understand the syntax so my understanding could be wrong) and found the core function to be wan_done (release/src/router/rc/wan.c )

    If I understood correctly the 0 byte (I manually created), would be deleted after run_nvscript created a new :

    wan_done function trigger run_nvscript("script_wanup", NULL, 0); (contained in /release/src/router/rc/misc.c).

    run_nvscript dynamically creates, launches (execute_with_maxwait) and deletes (unlink) the file /tmp/

    So as far I understand run_nvscript("script_wanup", NULL, 0); is probably triggered and probably is correctly created as well since init shutdown and firewall scripts work correctly here.

    As far I understand run_nvscript("script_wanup", NULL, 0); was used in build 50 with the same arguments

    1345                         run_nvscript("script_shut", NULL, 10);
    1377                         run_nvscript("script_init", NULL, 2);
    983         run_nvscript("script_fire", NULL, 1);
    801                 run_nvscript("script_wanup", NULL, 0);
    I found impossible to understand execute_with_maxwait (/release/src/router/rc/misc.c) but perhaps its wtime = 0 argument could trigger this issue when the scripts are dynamically created and deleted (unlink) by run_nvscript.

    static void execute_with_maxwait(char *const argv[], int wtime)
     113         pid_t pid;
     115         if (_eval(argv, NULL, 0, &pid) != 0)
     116                 pid = -1;
     117         else {
     118                 while (wtime-- > 0) {
     119                         waitpid(pid, NULL, WNOHANG);    /* Reap the zombie if it has terminated. */
     120                         if (kill(pid, 0) != 0) break;
     121                         sleep(1);
     122                 }
     123                 _dprintf("%s killdon:   errno: %d    pid %d\n", argv[0], errno, pid);
     124         }
     125 }
     200 void run_nvscript(const char *nv, const char *arg1, int wtime)
     201 {
     202         FILE *f;
     203         char *script;
     204         char s[PATH_MAX + 1];
     205         char *argv[] = { s, (char *)arg1, NULL };
     206         int check_dirs = 1;
     208         if (nv[0] == '.') {
     209                 strcpy(s, nv);
     210         }
     211         else {
     212                 script = nvram_get(nv);
     214                 if ((script) && (*script != 0)) {
     215                         sprintf(s, "/tmp/", nv);
     216                         if ((f = fopen(s, "w")) != NULL) {
     217                                 fputs("#!/bin/sh\n", f);
     218                                 fputs(script, f);
     219                                 fputs("\n", f);
     220                                 fclose(f);
     221                                 chmod(s, 0700);
     222                                 chdir("/tmp");
     224                                 _dprintf("Running: '%s %s'\n", argv[0], argv[1]? argv[1]: "");
     225                                 [B]execute_with_maxwait[/B](argv, wtime);
     226                                 chdir("/");
     227                                 [B]unlink[/B](s);
     228                         }
     229                 }
     231                 sprintf(s, ".%s", nv);
     232                 if (strncmp("sch_c", nv, 5) == 0) {
     233                         check_dirs = 0;
     234                 }
     235                 else if (strncmp("sesx_", nv, 5) == 0) {
     236                         s[5] = 0;
     237                 }
     238                 else if (strncmp("script_", nv, 7) == 0) {
     239                         strcpy(&s[1], &nv[7]);
     240                 }
     241         }
     243         if (nvram_match("userfiles_disable", "1")) {
     244                 // backdoor to disable user scripts execution
     245                 check_dirs = 0;
     246         }
     248         if ((check_dirs) && strcmp(s, ".") != 0) {
     249                 _dprintf("checking for user scripts: '%s'\n", s);
     250                 run_userfile("/etc/config", s, arg1, wtime);
     251                 run_userfile("/jffs/etc/config", s, arg1, wtime);
     252                 run_userfile("/opt/etc/config", s, arg1, wtime);
     253                 run_userfile("/mmc/etc/config", s, arg1, wtime);
     254                 run_userfile("/tmp/config", s, arg1, wtime);
     255         }
     256 }
  54. ~nephelim~

    ~nephelim~ LI Guru Member

    I adapted an existing script to continually test for and rename it

    until [  $COUNTER -lt 1 ]; do
    if [ -f $TESTME ] ; then 
    mv -f $TESTME /tmp/test 
    let COUNTER-=1
    launching that script against build 51 just before starting a reconnection do not yeld any result:

    /tmp/ is deleted before the script can rename it

    if edited accordingly such script is able to successfully rename /tmp/
  55. teddy_bear

    teddy_bear Network Guru Member

    Wow, you did lots of troubleshooting and research!
    I thought of deleting the temporary script file as a possible culprit, but then dismissed that thought since unlink() should not actually delete the file while it's busy, and only mark it for deletion...

    However, all your testing points to the unlink() call which is new in build 51. Are you able to compile the firmware yourself? If yes, rebuild it with the unlink() line deleted from the run_nvscript() function.

    If not, try another workaround - create a shell script called whatever.wanup (extension "wanup" is important, name could be anything) in the /jffs/etc/config directory (create the directory if it doesn't exist yet), and put the content of your WAN-Up script in it. Make sure the script is created correctly - i.e. marked as executable, has #!/bin/sh in the first line and doesn't have DOS line breaks - and test that it runs from the command line. Now, that script should be executed on every WAN-Up, just as normal WAN-Up script would if not broken... If that works, it would be another confirmation that the unlink() is the problem and needs to be removed.
  56. ~nephelim~

    ~nephelim~ LI Guru Member

    Considering this issue was not reproducible on your and Rodney's router I tried my best to provide as much info as possible to possibly outline what was going on my end.

    The firewall script is able to launch the adblock script commands but it is triggered also during a disconnect (thus using firewall script Adblock was triggered twice on a reconnect)

    Probably my router is not fast enough to perform correctly the wanup script execution with the same 0 timing.

    I'm not confident I'll be able to manage a recompile though.

    There are few tutorials on the net but I never took such chance due to the risk of bricking the router out of my inexperience. :frown:

    Thanks for providing this workaround. I finally managed to correctly apply such instructions and I was able to have tomato launch /jffs/etc/config/test.wanup on each reconnection attempt.
  57. teddy_bear

    teddy_bear Network Guru Member

    Great - thanks for your help!
    I'll remove the unlink() for the next build to avoid these problems.
  58. ~nephelim~

    ~nephelim~ LI Guru Member

    Don't mention it.

    Thank you for bearing with me and following though on this issue. :agree:
  59. Jani-

    Jani- Addicted to LI Member


    How do I know what revision is my CPU? I mean which one I need for following routers:
    Buffalo WHR-G125:
    # cat /proc/cpuinfo
    system type             : Broadcom BCM5354 chip rev 1
    processor               : 0
    cpu model               : BCM3302 V2.9
    BogoMIPS                : 237.56
    wait instruction        : no
    microsecond timers      : yes
    tlb_entries             : 32
    extra interrupt vector  : no
    hardware watchpoint     : no
    VCED exceptions         : not available
    VCEI exceptions         : not available
    unaligned_instructions  : 1248785
    dcache hits             : 0
    dcache misses           : 0
    icache hits             : 0
    icache misses           : 0
    instructions            : 0
    And Asus RT-N10, which I currently can access, because it's not at my place.

    Maybe a FAQ entry how to know the revision? :)
  60. BuonaDomenica

    BuonaDomenica Networkin' Nut Member

    I have a Asus WL-520gu router currently with DD-WRT and would like to go to Tomato. I know how to flash as I read up on that. However, it is very confusing which version to download from the website.

    from the six different versions offered which one has the USB support for the Asus WL-520gu router.

    It is not very clear when I look at the different built types.

    thanks for clarification

  61. ghostknife

    ghostknife Addicted to LI Member

    Kernel 2.4 (stable):
    No CIFS

    Kernel 2.6 (experimental) for MIPSR1
  62. ghostknife

    ghostknife Addicted to LI Member

    Pretty sure the G125 is same the WHR-G54S (R1) , Asus an R2 but not sure if that one is supported.
  63. Jani-

    Jani- Addicted to LI Member

    Hmm, k. Isn't there anyway to verify this? Like with ND case, you check the wl0_corerev?

    There's a note in changelog that it's supported.
  64. Leeoniya

    Leeoniya LI Guru Member

    "Use internal DNS" = slow or breakage

    just flashed a wrt310n v1 coming from DD-WRT, did a full wipe of nvram. started using it and noticed immediately that response time for page requests was much slower than before. figured it was DNS. wifi devices also had a very difficult time resolving...maybe 10% were fast and only 30% worked at all.

    decided to screw with it and unchecked "Use internal DNS"...whoa la, fast as ever!

    did some research afterwards, looks like others running into same issue with Tomato:

    btw: the WAN on this router is connected out (DHCP) to another router which connects out to ISP.

    any ideas?
  65. dbt78

    dbt78 Networkin' Nut Member

    Yes , Cipher AES256 implemented in openssl seems problematic with external server.
    Sapristi ! (by jove !)

    I confirm that there is a bug in the old library Openssl of tomatoUsb

    I just finished a compilation of tomatousb with implémentation of openssl-1.0.0 (latest version) and OpenVPN-2.2 beta3.

    -> Now, I can get connected without problem on all VPN public servers and more precisely on "Arethusa" - - AES-256-CBC !:)

    It would be very interesting that Teddy_Bear implements these new libraries in its next version (of our favorite firmware :) ).
  66. teddy_bear

    teddy_bear Network Guru Member


    Any effect on the performance (the current implementation of AES in Tomato is done by fyellin in mips assembler, which supposedly is very effective and fast)? Also, how much does it change the firmware size?

    Do you have a patch for OpenSSL replacement which uses "configure" and turns on/off ciphers depending on the build type (vpn or not)? If so, please send it to me to consider for future releases.
  67. dbt78

    dbt78 Networkin' Nut Member

    yes I saw that the decryption was in asm code in the original distribution.
    I do not have too many elements of comparison for the speed .. but I am sending you a link to the binaries for evaluate speed and Size: (STD-VPN and EXT)

    I recompiled libcrypto, libssl, and .. openssl, .. but I think "openssl" is not necessary for the tomato distribution (what do you think so?).
    The cypher included by default, are the same options as the original makefile.

    Absolutely! It's the least I can do with all the effort you made to give us a great firmware!
    I'll send the patches tomorrow, because I do a little clean up the code.

    best regards.
  68. Megaweapon

    Megaweapon Addicted to LI Member

    Today I updated from tomato-1.27-NDUSB-8742-vpn3.4 to tomato-NDUSB-1.28.8752-vpn3.6 and at some point in between these two versions TFTP got disabled in the dnsmasq compile because dnsmasq wouldn't start with the same old error:

    dnsmasq[531]: unsupported option (check that dnsmasq was compiled with DHCP/TFTP/DBus support) at line 26 of /etc/dnsmasq.conf
    The only custom dnsmasq configs I have are:

  69. ~nephelim~

    ~nephelim~ LI Guru Member

    I come across a glitch in length validation of multi-line textareas (<textarea>) in admin-scripts.asp that will not take into account tomato.cgi VT_TEXT sanitization thus will fail for smaller multi-line strings:

    Due to differences in browser implementations some Windows browsers will store the multi line scripts as LF formatted strings (Firefox 3.6 Chrome 8) and others as CRLF formatted strings (IE8 Opera 10.70).

    When the save() function calculate the string length IE and Opera will include CR overhead in the calculations and send CRLF formatted stings to tomato.cgi

    tomato.cgi will feed the textarea input to the associated V_TEXT ( actually VT_TEXT ) which will use unix_string function to remove \r characters.

    All multiline textareas used in tomato fronted and checked in tomato.c through V_TEXT statements will probably be affected by the above mentioned glitch.

    On another note it is unclear to me whenever OSX will send in multi-line strings formatted in CR only line termination on some or all OSX browsers.

    If this were to happen V_TEXT would suppress mac line termination without adding LF
  70. Meffy

    Meffy LI Guru Member

    Printer offline?

    Beta 52?if i rmb properly

    Linksys wrt54g v2.2

    Using this over the official tomato seems to be causing my Samsung 2851ND printer to appear offline. It connects via Ethernet cable to router and is assigned an IP(can see it on my router). No error in logs or what soever, however it is appearing as offline on my pcs and thus i cant print anything unless i switch firmwares

    Any suggestion?
  71. tmpid

    tmpid Networkin' Nut Member

    The timeout settings in Conntrack/Netfilter do not seem to take effect on kernel 2.4 build 52. Can anyone confirm this and provide a workaround? Thanks.
  72. stotes

    stotes Addicted to LI Member

    It seems every 15 minutes or so, my ASUS RT-N16 will drop all connections from wireless and stop broadcasting for about 3 minutes then turn back on.

    This started happening 4 days ago after upgrading to Build 52.

    Any help would be great, I would prefer not to revert back as I find the Web Usage feature very useful!

    Keep up the great work TeddyBear, your the best!
  73. Toastman

    Toastman Super Moderator Staff Member Member

    tmpid, I used build 52 for some time on 5 different RT-N16's and did not see that timeout problem.
  74. ~nephelim~

    ~nephelim~ LI Guru Member

    I'm experiencing qos save/commit issues with build 53. :sad:

    I already erased nvram and I'm filling Toastman Qos rules by hand.

    The issue is apparently caused by port ranges like
    11999,2300-24000,6073,28800-29100,47624 for well known games rule.

    iptables-restore v1.3.8: invalid port/service `2300:24000' specified
    Error occurred at line: 9
    Try `iptables-restore -h' or 'iptables-restore --help' for more information.
    EDIT: single port ranges like 20-23 work fine. Port lists like 80,443 trigger errors

    Easy Toastman QoS setup script trigger the same issue.

    What's going on? :confused:

    EDIT2: The issue is apparently related to multiport module for iptables

    multiport v1.3.8 options: 
     --source-ports port[,port,port...] 
     --sports ... 
    				match source port(s) 
     --destination-ports port[,port,port...] 
     --dports ... 
    				match destination port(s) 
     --ports port[,port,port] 
    				match both source and destination port(s) 
     NOTE: this kernel does not support port ranges in multiport. 
    I don't really understand why multiport option point that the kernel does not support port ranges. :confused:

    if that was actually true mport based builds wouldn't have worked so far.

    Searching for more info I came across a similar issue and an old bugfix .

    EDIT3: It looks like the fix did not include port-ranges support.

    Any chance for a quick-fix .8553.1 build for K24?
  75. teddy_bear

    teddy_bear Network Guru Member

    Aha, thanks for that!
    I have not tested the multiport in K24 builds, assuming it will just work, as in 2.6... Will release a fix for this soon.
  76. ~nephelim~

    ~nephelim~ LI Guru Member

    You're welcome.

    Thanks for continual K24 development. I've been drooling on the commit logs over the past weeks awaiting a new build. :)
  77. ~nephelim~

    ~nephelim~ LI Guru Member

    I don't know for what reason this happens but update over https won't work with Opera.

    Tested with Opera 10.63 and 10.70 Build 9071, other version of such browser might be affected.
  78. teddy_bear

    teddy_bear Network Guru Member

    Just the update? Or you can't connect at all with Opera using https? What build - VPN or not?
  79. ~nephelim~

    ~nephelim~ LI Guru Member

    I noticed this happening with the latest two builds (NoUsb ND Std K24) but I didn't confirm if older builds worked fine.

    https upgrades with chrome works fine.

    Carrying the upgrade on http with Opera works fine.

    https webif with Opera works fine as well,just the upgrade doesn't: it does display the timer page but no actual update is carried (I had the timer reach 8 min once).

    I noticed that when actual upgrade begins my router (WHR-G54S) turn on the DIAG led but this doesn't happen over https attempts while using opera.
  80. teddy_bear

    teddy_bear Network Guru Member

    Well, I test it with IE, FF, Safari for Windows, and Google Chrome - but not the Opera ;). I guess I need to install the Opera as well. Will be a bitch to fix though as I'm by far not a web developer, and always suffer when dealing with browsers stuff :mad:...
  81. ~nephelim~

    ~nephelim~ LI Guru Member

    Supporting every browser is an overkill for sure.
    This glitch doesn't affect build 52. I double checked again with Opera 10.63 to be sure.
    EDIT: Tested again Build 53 with Chrome. Chrome is unable to carry upgrade over https unlike I previously mentioned (I was probably using http)
    It might be fine to add it to know issues list if confirmed just to prevent few people to stare at the timer page for a long time.

    EDIT2:Also restore configuration (from file backup) breaks over https.
  82. teddy_bear

    teddy_bear Network Guru Member

    ~nephelim~: try regenerating the SSL certificate if you have one stored in NVRAM.
    I just retested with Chrome, and both - restore config and upgrade worked via https (my cert was created by the new version).
  83. Toastman

    Toastman Super Moderator Staff Member Member

    Browsers are a dark art... but one of the nice things about opera is the way the entire Tomato window scales perfectly, including the pie charts. But somehow I always migrate back to the clutter-free Safari.
  84. ~nephelim~

    ~nephelim~ LI Guru Member

    I had the cert regenerated after resetting the nvram but I regenerated it again to make sure.

    Still doesn't work. I was using K24 but I just installed v1.28.9053 MIPSR1-beta K26 Std with the same result.

    Is there any chance you were on http? (chrome url completion can get in the way and fill the http url)

    When it doesn't work the timer page get displayed but the update is not carried.

    I'm using dev version of Chrome I don't think it should make a difference but just in case if you used the standard version I will try that as well :confused:
  85. teddy_bear

    teddy_bear Network Guru Member

    I was using https, but apparently I only tested VPN build with Chrome (which has different ssl implementation).
    After trying with Std I did see the problem - in Chrome at least, and with Firefox it worked inconsistently. Now fixed - will be in the next build (hopefully tomorrow, unless I or someone else finds another critical issue to fix :wink: ).
  86. ~nephelim~

    ~nephelim~ LI Guru Member

    Thanks :). Would it be feasible to increase cert key size to rsa:1024 as an added bonus? :hubba:
  87. teddy_bear

    teddy_bear Network Guru Member

    Well, the longer key requires more processing power. I actually tried this on WL520GU, and browsing through the Web GUI was noticeably slower with CPU usage going up to 0.30-0.40+ with no other activity. OTOH, on RT-N16 you can't see any difference :).

    So I'm keeping it at 512 at least for now. Security obsessed ;) users can easily generate the 1024- or 2048-bits keys by following the simple procedure.

    1. Run these commands:
    cp /usr/sbin/ /tmp/
    mount -o bind /tmp/ /usr/sbin/

    2. Edit /tmp/ file, and replace rsa:512 by rsa:1024.
    3. Go to Administration->Admin Access page in the GUI, check "Regenerate" box, and click "Save" - that will recreate the certificate using modified script.
  88. brookie

    brookie LI Guru Member


    I just upgraded/nvram erase from tomato-ND-1.28.8752-Std to tomato-ND-1.28.8753-Std. Three WRT54GS v.2, all WDS only, WPA2/AES, channel 4, not broadcast, ...and all is good but this:

    Quality on Device List page does not display anything. Just a blank column. It used to display the cool color thingy with quality info for each router that was connected.

    Just thought I would let 'yall know. Thanks for the good work.
  89. ~nephelim~

    ~nephelim~ LI Guru Member

    I didn't expect it to reach 40% cpu usage. :eek:

    Thanks, I will give it a try.

    But I have a low end router (WHR-G54S) so I'll probably have to keep the rsa:512 key :sad:
  90. ~nephelim~

    ~nephelim~ LI Guru Member

    I found out an updated toolchain on wl500g (hndtools-mipsel-uclibc-4.3.5-2.tar.bz2) and I noticed it was built on 2010.07.03

    So I was wondering if there was a central repository with a more recent version.

    I've been searching for hours and found no such thing.

    hndtools appear to be an abbreviation for Home Networking Division tools but nowhere on Broadcom website I found such prebuilt toolchains.

    Isn't there a official distribution website/public repository for hndtools? :confused:
  91. alins

    alins Network Guru Member

    Can somebody please tell me how to enter and use a hotplug script?

    Specifically I am trying to setup an HP 1018 laser printer as described here:

    How and where do I enter the hotplug script so it's executed every time on boot?

    Do I even need a hotplug script for this printer with the latest Tomato USB firmware?

    Thanks very much!

  92. quinezhu

    quinezhu Addicted to LI Member

    I've got the tomatousb vpn mod with kernel 2.4 flashed on my belkin 7231-4p and it works fine, including the function of print server with my hp 1522 laserjet. Many thx. :)
  93. ShakuniMama

    ShakuniMama Networkin' Nut Member

    I am trying to mount my printer using this tomato on a Asus 520gu router. Although it detects it but I am unable to mount it. I get the prompt "Failed to mount the device. Verify the device is plugged in and try again!" What am I doing wrong?
    please help.
  94. soundbite

    soundbite Networkin' Nut Member

    Asus WL-520GU

    I'm thinking about buying an Asus WL-520GU. I know that different routers have different amounts of memory. So...

    Would someone mind verifying whether, after installing TomatoUSB on this particular router (which only has 4MB), I'll be able to (1) set up the router as a wireless client to my main router (running DD-WRT), (2) set up a PPTP tunnel to my office, and (3) share my HP Deskjet 920C over the network?

    Thank you!
  95. trueman

    trueman Addicted to LI Member

    Did you happen what caused your wireless disconnects?

    The wireless on Build 54 WRT54GL keeps disconnecting every few mins. I have tried resetting all settings to default and it still happens.

    I reverted back to the original tomato firmware and did not see the issue. It might be the new driver causing an issue.

  96. AZTracker

    AZTracker Networkin' Nut Member

    Thank you!!!!

    I am one happy Tomato user, too! And even happier than you took the time to post up what you did to fix your problem. TomatoUSB wasn't seeing my printer - but that wasn't entirely obvious to me because this is my first rodeo and didn't know what to look for. After fighting it for an hour, I found your post and went and enabled USB 1.1, just as you recommended. Instantly everything started working. Thanks again!
  97. can2000

    can2000 Networkin' Nut Member

    Any step by step guide to install torrent client on the Tomato firware router?
  98. szfong

    szfong Network Guru Member

    Is TomatoUSB a DEAD Project Like Jon's Tomato 1.28?

    I was hoping to upgrade my WNR3500L the other day from TomatoUSB 9054, and saw that it has not been upgraded for a couple months and discussion on it has waned. Has it been discontinued or replaced by Victek and/or Toastman?

  99. Toastman

    Toastman Super Moderator Staff Member Member

  100. szfong

    szfong Network Guru Member

    That is truly sad news. Life is just so short, I hope he can soon forget what he lost and find happiness.
  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