i have been playing around reprogramming sonoff wifi switches to operate at my beck and call. it occurred to me that it would be a nice way to control
pumps, compressors exhaust fans etc from auggie without the need for any physical connection.
i can use the command line utility wget.exe
{wget "http://10.0.0.131/st?sw=4" } to send a command to the sonoff
can auggie script run an os shell ?
run dos bat file or cmd line (os shell) from auggie script
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
Re: run dos bat file or cmd line (os shell) from auggie script
tried Exec, Execute , got nothing except the print message
Code: Select all
global AirButton = function()
{
print("airblow toggle");
Exec("c:\ctwin\s5.bat");
yield();
return;
};
Re: run dos bat file or cmd line (os shell) from auggie script
found some examples:
system.Exec(path+file);
system.Exec("Notepad " + path + file);
try this:
system.Exec("c:\ctwin\s5.bat");
system.Exec(path+file);
system.Exec("Notepad " + path + file);
try this:
system.Exec("c:\ctwin\s5.bat");
Re: run dos bat file or cmd line (os shell) from auggie script
YaNvrNo:
Good thing you remembered that, I knew there was something we added but couldnt
quite remember what.. :)
Art
Good thing you remembered that, I knew there was something we added but couldnt
quite remember what.. :)
Art
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
Re: run dos bat file or cmd line (os shell) from auggie script
system.Exec("Notepad "
notepad works ok. but not my wget.exe , i will try locating it in the "PATH"
in the morning , its late here pumpkins everywhere
notepad works ok. but not my wget.exe , i will try locating it in the "PATH"
in the morning , its late here pumpkins everywhere
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
Re: run dos bat file or cmd line (os shell) from auggie script
thanks , works perfectly when executable is in the system PATH
I can now send this json udp packet to my sonoff switch and turn the exhaust duct fan on/off for the laser fume extractor
from the auggie console
Code: Select all
global AirButton = function()
{
print("airblow toggle");
system.Exec("sfk udpsend sonoff5:9889 {\"switch\":2}" );
yield();
return;
};
Who is online
Users browsing this forum: No registered users and 7 guests