*newbie alert*
I followed a guide for setting up a virtual presence sensor. The scripts, called "CheckIfHome" look for a specific MAC address connected to a router and reports to a smarthouse controller. The scripts it self is working well when I execute it manually trough Putty. The script is in the folder /jffs/scripts.
Link to the thread where I found the script.
(https://community.smartthings.com/t/release-asuswrt-wifi-presence/37802).
However, I need help to make a script that runs "CheckIfHome" automatically every 10 seconds (or more often). From the thread mentioned above; the author of the script "CheckIfHome" made a script called "init-start". This script will execute "CheckIfHome" every 15 seconds. Unfortunately this is not working well for me. Not idea why.
The init-start script looks like this:
#!/bin/sh
cru a CheckIfHome "* * * * * /jffs/scripts/CheckIfHome"
cru a CheckIfHome15 "* * * * * sleep 15; /jffs/scripts/CheckIfHome"
cru a CheckIfHome30 "* * * * * sleep 30; /jffs/scripts/CheckIfHome"
cru a CheckIfHome45 "* * * * * sleep 45; /jffs/scripts/CheckIfHome"
After rebooting the router and I run the command cru l;
admin@RT-AC68U-FCC0:/tmp/home/root# cru l
* * * * * /jffs/scripts/CheckIfHome #CheckIfHome#
* * * * * sleep 15; /jffs/scripts/CheckIfHome #CheckIfHome15#
* * * * * sleep 30; /jffs/scripts/CheckIfHome #CheckIfHome30#
* * * * * sleep 45; /jffs/scripts/CheckIfHome #CheckIfHome45#
sarwar@RT-AC68U-FCC0:/tmp/home/root#
The sleep command works for my router.
The issue is that instead of "CheckIfHome" is executed every 15 seconds, it's executed every 40-50 seconds. No matter how I modify the "init-start"
Most likely I'm doing some basically wrong. Any help would be highly appreciated.
I followed a guide for setting up a virtual presence sensor. The scripts, called "CheckIfHome" look for a specific MAC address connected to a router and reports to a smarthouse controller. The scripts it self is working well when I execute it manually trough Putty. The script is in the folder /jffs/scripts.
Link to the thread where I found the script.
(https://community.smartthings.com/t/release-asuswrt-wifi-presence/37802).
However, I need help to make a script that runs "CheckIfHome" automatically every 10 seconds (or more often). From the thread mentioned above; the author of the script "CheckIfHome" made a script called "init-start". This script will execute "CheckIfHome" every 15 seconds. Unfortunately this is not working well for me. Not idea why.
The init-start script looks like this:
#!/bin/sh
cru a CheckIfHome "* * * * * /jffs/scripts/CheckIfHome"
cru a CheckIfHome15 "* * * * * sleep 15; /jffs/scripts/CheckIfHome"
cru a CheckIfHome30 "* * * * * sleep 30; /jffs/scripts/CheckIfHome"
cru a CheckIfHome45 "* * * * * sleep 45; /jffs/scripts/CheckIfHome"
After rebooting the router and I run the command cru l;
admin@RT-AC68U-FCC0:/tmp/home/root# cru l
* * * * * /jffs/scripts/CheckIfHome #CheckIfHome#
* * * * * sleep 15; /jffs/scripts/CheckIfHome #CheckIfHome15#
* * * * * sleep 30; /jffs/scripts/CheckIfHome #CheckIfHome30#
* * * * * sleep 45; /jffs/scripts/CheckIfHome #CheckIfHome45#
sarwar@RT-AC68U-FCC0:/tmp/home/root#
The sleep command works for my router.
The issue is that instead of "CheckIfHome" is executed every 15 seconds, it's executed every 40-50 seconds. No matter how I modify the "init-start"
Most likely I'm doing some basically wrong. Any help would be highly appreciated.