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

Web Monitoring will cause Router halt.

Discussion in 'Tomato Firmware' started by jbcdidgosir, May 25, 2013.

  1. jbcdidgosir

    jbcdidgosir Serious Server Member

    My router is WRT54GS V3, changed RAM to 64M.

    Today I wrote some scripts to make 4 python programs(programmed by me) to run at the startup of router. But I found that when router is reboot, it will be in halt mode. That means: configured IP address(10.0.0.1) lost. IP returned to 192.168.1.1 . But I coudln't login the router by web. When I ping it, TTL is 100 instead of 64. I have no choice but pressing the reset button. Make the TTL becomes 64 and then login router and re-configure it again.

    After several tests, I concluded that:
    1. Keep the 4 python application run at the startup, but turn off the web monitoring -> OK
    In this case, if I start web monitoring manually -> Still OK
    2. Delete all the python application, only turn on the web monitor -> OK
    In this case, if I run these 4 python application manually -> Still OK
    3. Keep only 1 python application run at the startup, turn on the web monitor -> Some times OK, some times halt.

    Does it mean: there's some conflict if I enable the web monitor and run several python application at the startup? Is there any way to solve it?
     
  2. srouquette

    srouquette Network Guru Member

    maybe the python scripts require too much memory. Did you try to make your script in bash?
     
  3. jbcdidgosir

    jbcdidgosir Serious Server Member

    Scripts? Do you mean the script in tomato's "script" menu? Or the program of python? The former is based on Linux and the later is based on python.

    What is bash? My script in Tomato's menu is:
    In "Init":
    mkdir /tmp/goagent
    tar -zxvf /jffs/opt.tgz -C /tmp/goagent
    mount -o bind /tmp/goagent /opt
    /opt/bin/py /jffs/Fans.py & /opt/bin/py /jffs/Web.py & /opt/bin/py /jffs/modbus.py

    In "WAN Up":
    /opt/bin/py /jffs/dns.py

    notice:
    goagent.py is already noneffective, so not started in script.
    Fans.py is a socket client, which sends data once every 15s.
    Web.py is a socket server(act as Web server), which listens on port 80.
    modbus.py is a socket client, which send Modbus-TCP protocol to a PLC once every second.
    dns.py is a socket client to update my domain only when IP is changed. Because I have already set two DDNS in Tomato. The reset domains can only be updated by python program.
     
  4. srouquette

    srouquette Network Guru Member

    shell script, like .sh script.
    it requires no additional program (no python interpreter).
    for your dynamic dns, you could use https://freedns.afraid.org/ which provides update by URL (works with wget)
     
  5. jbcdidgosir

    jbcdidgosir Serious Server Member

    Can .sh script replace the python program? Python socket program is much big, maybe 2k-5k size. And the free size of nvram is only 6K left...


    As for update by URL. Is it an auto update? Or just a manual update? My python program can realize the auto update and that's just what I want.
     
  6. srouquette

    srouquette Network Guru Member

    you can always create a cron job to update every X hours...
     
  7. jbcdidgosir

    jbcdidgosir Serious Server Member

    But even I delete dns.py, my router still be in halt mode. Do you know how to solve it?
     

Share This Page