tpprynn wrote:Wow, really. So it's worked for you. (Does that mean you weren't bothered until working out this script?)
To be perfectly honest with you, I never really paid any attention to the WiFi LED on my laptop (probably because there's always an indicator on the panel that tells me if WiFi is enabled or not). Years ago when Windows XP was installed, the LED does turn on/off when I push the WiFi button. But that was because the corresponding laptop drivers were installed as well. When I switched to Linux, the LED was constantly ON. I didn't let it bother me because back then, I knew that there may be some things that are not going to work under the Linux platform (compliments of the hardware manufacturer for NOT supporting Linux by NOT providing proper Linux drivers for it).
Then, this thread came along. And it piqued my curiosity.
tpprynn wrote:This is a Toshiba laptop that uses the asus_laptop module...
Perhaps this is one of those things you have to consider why the script won't work for you? I mean even if the asus_laptop module is supposed to be compatible with a Toshiba hardware, there is always the possibility of things -- no matter how small they are (literally, like an LED sorry I couldn't resist) -- of not working as expected. The hack I wrote worked on my end because the hardware exactly matches the module installed on my system. Unfortunately, the same can't be said in your case.
It's time to debug (FUN!) or at least determine where it went wrong, and see if there's another way to do this. Back in my original post, we already know that Step (2) will work:
Code: Select all
echo "1" > /sys/devices/platform/asus_laptop/wlan # turn on the LED
echo "0" > /sys/devices/platform/asus_laptop/wlan # turn off the LED
So there's no issue with that. I suspect that step (1) is not doing what it's supposed to do on your end. Humor me for a moment and perform a simple experiment for me. In terminal, copy/paste the following:
Code: Select all
while [ true ] ; do echo -n "`cat /sys/class/net/wlan0/operstate` " ; sleep 1 ; done
You mentioned your WiFi interface is wlan0 instead of wlan1. What the above piece of code will do is simply display on screen the operational state of your WiFi. It should show either "up," "down" or "dormant" in one-second intervals (I recently discovered "dormant" while performing this on my laptop). While it's looping, disable/enable your WiFi via Network Manager, one of the Fn+<whatever> combo keys on the keyboard, and physical WiFi switch/button on the laptop (if there's any). The state change should reflect on the terminal window. To interrupt the loop, just hit Ctrl+C. Ideally, the output should be similar to the following:
Code: Select all
administrator@asus-a8jn ~ $ while [ true ] ; do echo -n "`cat /sys/class/net/wlan0/operstate` " ; sleep 1 ; done
up up up up up down down down down down down down down down down down down down down up up up up up up up down down down down down down down down down up up up up up up up down down down down down down down dormant up up up up up up up up up up up up ^C
administrator@asus-a8jn ~ $
I tried the three methods mentioned above to disable/enable my WiFi, hence the output. What does it say on your end?