Tomato 0.8 and kaid

Discussion in 'Tomato Firmware' started by Int15, Oct 31, 2006.

  1. Int15

    Int15 Network Guru Member


    I have the following script in the "Init Script" section:

    sleep 5
    wget -P /tmp
    wget -P /tmp
    cd /tmp
    chmod +x kaistation_kaid
    kaistation_kaid -c /tmp/kaid.conf

    When the router finished rebooting, I can telnet and see the kaistation_kaid and kaid.conf files, and kaistation_kaid has execute permission.
    However, it seems that that the last line of the script never executes.
    If I execute the lines manually in telnet, everything works fine.

    Any ideas?

  2. turbo53

    turbo53 Network Guru Member

    Try changing the last line in your script to this:

    ./kaistation_kaid -c /tmp/kaid.conf

    In other words, add the "./" to the beginning of the line.
  3. turbo53

    turbo53 Network Guru Member

    I forgot that you should also add "-d" to the parameters in order to start kaid as a daemon.
  4. Int15

    Int15 Network Guru Member

    Thanks, I'll try that!

  5. Int15

    Int15 Network Guru Member

    I'm sorry to say that I'm getting the same results (with and without "-d").
    Thanks for the help, I'll continue fiddling with the script.

  6. turbo53

    turbo53 Network Guru Member

    What about the "./"?

    I'm very far from a Linux expert, but I've found that in order to run a program from a script I either need to explicitly specify the directory or use "./" to refer to the current directory.
  7. Int15

    Int15 Network Guru Member

    Yup, I added the "./" as well (I'm really far from being a Linux expert, so thanks for the explanation of the "./").

    I'm trying to read on the JFFS2 partition to store the binary instead of downloading it everytime, but I want to find out what I'm doing wrong first, before adding to the complexity.

    Thanks again,
  8. maxzerker

    maxzerker LI Guru Member

    init script bug, this is well known issue
    I don't know why jon didn't fix this for 3-4 released
  9. Int15

    Int15 Network Guru Member


    Well, this is getting confusing then. These guys seems to think it's working fine.

    (from that thread:
  10. turbo53

    turbo53 Network Guru Member

    Can you be more precise? My init script works fine.
  11. maxzerker

    maxzerker LI Guru Member

    This won't happen with all kind of script,

    Try this "ip addr add dev vlan1 brd +"

    You won't able to startup a script like this, even it's work fine when enter manually.

    Above script work just fine on Tomato 0.3.
    As i know Jon add a little delay before init script runs,
    So some command won't work with that (i guess)

    Dear thread owner, if it doesn't work then put it somewhere else
    Ex. Firewall script, or WAN UP

    PS.I put that script in WAN UP instead. :p
  12. turbo53

    turbo53 Network Guru Member

    OK. This sounds like it may be a timing bug processing network related commands. But this doesn't sound like it's Int15's issue. I could be wrong though.
  13. Int15

    Int15 Network Guru Member

    Actually, I just noticed that the script does execute. If I issue the ps command right after launching the script, I ger the pervious output. However, when I re-issue ps a few seconds later, the kaid lines are gone.

    Is this firmware branching out further from HyperWRT than Thibor15c was? I'm no expert, but it looks like the kaid binary is not compatible with Tomato. But I can also be totally wrong.

  14. havemusic

    havemusic Network Guru Member

  15. mrdude

    mrdude Network Guru Member

    I am really thankfull you posted this m8, I have been trying to get kaid working for ages untill I came across this post - I have tried dd-wrt and thibor firmware - then I saw this post and installed the tomato firmware with this script - now my xbox is working great and giving me lots of free internet games - thanks very much.
  16. Int15

    Int15 Network Guru Member

    Thanks for the help, everything is running ok now.
    For some reason, I had a corrupt binary on the ftp (on top of using the Init script).

  17. SteelRAT

    SteelRAT Network Guru Member

    Can somebody tell me what should I do next after I put this sript in Wan Up Script section. Because the scritp seems to work but I don´t know how to configure kaistation.
  18. havemusic

    havemusic Network Guru Member

    You configure it on your xbox. XBMC program file settings. Put user name /password and local ip address of your router.
  19. SteelRAT

    SteelRAT Network Guru Member

    Thanks, I`ll try this
  20. crash_x

    crash_x LI Guru Member

    Hi all,

    It seems this thread might be a little outdated....

    Anyway, I am looking to get Kaid running on tomato. I have the latest version (1.08) and I have attempted to use the script posted on this thread, but to no avail. I also followed the wget links and found them to link straight to a blog.... so.... I don't think they work any more.. Any ideas? Thanks for your time!

  21. uberwurst

    uberwurst LI Guru Member

    I second this, I was going to try this but it seems those links are outdated?

    Thibor has a startup script for his firmware, how easily (or can it at all) can this be configured to work with Tomato?

    Anyone have updated info on this?
  22. fiurico

    fiurico Network Guru Member

    Ladies and gentlemen, I think you are looking for last I worked.

    cd /tmp
    sleep 5
    echo "#!/bin/sh" > startkaid
    echo "if [ ! -s kaid ]; then" >> startkaid
    echo "wget \"\"" >> startkaid
    echo "wget \"\"" >> startkaid
    echo "sleep 5;chmod +x kaid;fi" >> startkaid
    echo "./kaid" >> startkaid
    chmod +x startkaid
    echo "*/2 * * * * root /tmp/startkaid" > cron.d/check_kaid
    touch crontab
  23. crash_x

    crash_x LI Guru Member

    Looks good, but here's the next question: Does it work over a wireless connection? I've gotten kaid to work over wireless with DD-WRT by using vlan, but DD is unstable, hence my interest in switching to tomato. Any ideas? Thanks!
  24. fiurico

    fiurico Network Guru Member

    I don't see why it wouldnt...

    I don't game over wireless though as I prefer wired for all things that should have a dedicated hard line. Gaming is one of them :) FPS + Spikes = DEAD!
  25. fiurico

    fiurico Network Guru Member

    is it just me or the site is now dead?
  26. GeeTek

    GeeTek Guest

    Yes, it is dead. :sadbye:

    Shut the damned computer games off and find some girls to play with for a change.
  27. fiurico

    fiurico Network Guru Member


    Your posts are usually much more informative. I'm very surprised at your response. Married with children ring bells to you? I prefer women. They are much better than "girls." As for Kai's use if you must know, its for the children in case you haven't figured that one out yet.

    @ xlink users

    Anyone else have a more productive solution? I installed DD-WRT v24 RC4 the other day in a WDS setup for the first time. It includes the kai daemon and is at a remote location so I cannot test it at this time with xlink although from what I read, it works. I have used Thibor firmware and really like tomato so I would prefer to script it in Tomato's startup. Hopefully we can figure out how to do it. If not, I saw somewhere yesterday that you can put the files that the router needs on your Xbox, and simply have the startup Tomato scripts point to the Xbox FTP to get the preconfigured files needed to get on xlink.
  28. uberwurst

    uberwurst LI Guru Member

    Yeah GeeTek should know better, that's playing with fire, certain to start a flamewar . . . .

    Thanks for your efforts, keep us updated on this thread if you make any progress. There needs to be a better way than crossing your fingers that some random host will still be up-and-running hosting the files.
  29. fiurico

    fiurico Network Guru Member

    I will update if I see anything else. I hope others do to as this topic seems to get buried on boards. This is the topic I was talking about. I have NOT tested it so I do not know if it works. If someone tests it, please update...

    Hope links are allowed. If not, my apologies in advance mods.
  30. rlangtind

    rlangtind LI Guru Member

    Im trying to get kaid to work on tomato (1.16), but get the following error (when running manually):

    # ./kaid -c /tmp/kaid.conf
    KAID: Kai Engine for KaiStation is initialising...
    WARNING: Unable to open engine persist data file (/tmp/kaiEnginePersist.txt)
    KAID: Kai Engine for KaiStation is starting...
    THREAD: Engine thread started...
    User defined signal 1

    The kaiEnginePersist.txt file is there, so not sure why it complains:

    -rw-r--r-- 1 root root 1674 Mar 11 09:26 kaiSystemConfig.txt
    -rwxr-xr-x 1 root root 1340796 Mar 11 09:25 kaid
    -rw-r--r-- 1 root root 3876 Mar 11 09:25 kaid.conf

    A ps command reveals it is not running:

    # ps
    PID Uid VmSize Stat Command
    1 root 504 S init noinitrd
    2 root SW [keventd]
    3 root SWN [ksoftirqd_CPU0]
    4 root SW [kswapd]
    5 root SW [bdflush]
    6 root SW [kupdated]
    7 root SW [mtdblockd]
    39 root 300 S buttons
    79 root 332 S syslogd -m 60 -L -s 50
    82 root 312 S klogd
    105 root 440 S nas /etc/nas.conf /var/run/ lan
    114 root 292 S telnetd -p 23
    118 root 316 S rstats
    121 root 368 S crond
    137 nobody 456 S dnsmasq
    144 root 304 S httpd
    178 root 440 S -sh
    254 root 344 R ps

    Any ideas?
  31. kamatschka

    kamatschka Network Guru Member

    I am also into "enabling" kaid xlink on tomato 1.28 beta and it seems that the destination of the config file ( ) does no longer exist. does anyone know where I can get these necessary files in orer to get kaid xlink working on tomato 1.28 ?!

    THank you in advance
  32. havemusic

    havemusic Network Guru Member

  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