Unreliable on/off action with bash script
Posted: Friday 23 January 2015 12:55
I created a basic script to control a wemo switch
Using a library , I can run the following on the command line and the switch works everytime
I order to trigger this from a dummy switch, i created a script called say wemo_on.sh
and made it executable - when I run this from a ssh shell - ./wemo_on.sh , it works as expected
However, when I added the same to a dummy switch under on action , it does not work reliably
Sometimes it works but more often than not, it doesn't
It's a rather odd issue and the only possibility I can think of is that the actual command takes a long time (5-6 seconds) to execute and the on action times out by then
HHow can I fix this?
Using a library , I can run the following on the command line and the switch works everytime
Code: Select all
$ wemo switch "Wemo Switch" on
Code: Select all
#!/bin/sh
wemo switch "Wemo Switch" on
However, when I added the same to a dummy switch under on action , it does not work reliably
Sometimes it works but more often than not, it doesn't
It's a rather odd issue and the only possibility I can think of is that the actual command takes a long time (5-6 seconds) to execute and the on action times out by then
HHow can I fix this?