Mustafa Taşkın
unread,Mar 19, 2015, 6:03:03 PM3/19/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to app-reactor...@googlegroups.com
Hello,
I'm not a coder, just trying things on Reactor.
I modified the sample: Turn WiFi at home script and added a second coordinate in it. I also tried turning mobile data on or off in according to WiFi status. But I get error messages about mobile data command. Where could be the problem?
// Turn wifi on when home and off when out
loc = location();
log("Current location lat: " ~ loc["lat"] ~ " lon: " ~ loc["lon"]);
while(true) {
// put your work location here
iAmWork = near(10, 20, 700);
// put your home location here
iAmHome = near(10, 30, 100);
if (iAmWork) {
log("At work");
enableWifi(true);
enableDate(false);
} else if (iAmHome) {
log("At home");
enableWifi(true);
enableDate(false);
} else {
log("Out");
enableWifi(false);
enableDate(true);
}
// wait 20 minutes till next check
sleep(1200000);
}
Thanks in advance.