The Following User Says Thank You to Mentalist Traceur For This Useful Post: | ||
![]() |
2011-01-04
, 16:38
|
Posts: 482 |
Thanked: 550 times |
Joined on Oct 2010
|
#202
|
The Following User Says Thank You to skykooler For This Useful Post: | ||
![]() |
2011-01-04
, 17:28
|
Posts: 2,225 |
Thanked: 3,822 times |
Joined on Jun 2010
@ Florida
|
#203
|
![]() |
2011-01-04
, 18:06
|
Posts: 482 |
Thanked: 550 times |
Joined on Oct 2010
|
#204
|
The Following User Says Thank You to skykooler For This Useful Post: | ||
![]() |
2011-01-04
, 20:06
|
Posts: 456 |
Thanked: 1,580 times |
Joined on Dec 2009
|
#205
|
Yep. Meanwhile, I still can't find a good file to use for figuring out if the wifi module is loaded or not... I suppose I can check /proc/modules, and use a search function/call/whatever it's called, but whatever. I need to know if that's computationally more efficient than python calling a shell command every second, or searching 'proc/modules'... I guess it's ultimately the same or similar...
The Following User Says Thank You to Wonko For This Useful Post: | ||
![]() |
2011-01-04
, 21:36
|
Posts: 1,522 |
Thanked: 392 times |
Joined on Jul 2010
@ São Paulo, Brazil
|
#206
|
![]() |
2011-01-04
, 21:53
|
|
Posts: 133 |
Thanked: 140 times |
Joined on Feb 2010
@ Bristol, UK
|
#207
|
![]() |
2011-01-05
, 01:25
|
Posts: 35 |
Thanked: 9 times |
Joined on Feb 2010
@ Perth, WA, Australia
|
#208
|
![]() |
2011-01-05
, 03:49
|
Posts: 2,225 |
Thanked: 3,822 times |
Joined on Jun 2010
@ Florida
|
#209
|
The Following User Says Thank You to Mentalist Traceur For This Useful Post: | ||
![]() |
2011-01-05
, 10:21
|
Posts: 1,042 |
Thanked: 430 times |
Joined on May 2010
|
#210
|
The Following User Says Thank You to Radicalz38 For This Useful Post: | ||
I like your idea of using pywifi (though mainly because I like finding out about packages because I can learn more python, and I like learning everything), but I wanted to avoid calling/importing anything other than the absolutely necessary stuff, since this is running in the system pretty much non-stop, except maybe when hidden.
I just file("/proc/net/wireless", 'r'). Third line, value index 3 (fourth value), is the signal, in dBm. "Higher" (remember it's negative integers) values are 'clearer' signals. So 90-something noise is good (value index 4), 90-something signal is bad. There's also a "link" (value index 2). Funny enough, Signal (it's called "level" in that file) is an integer, while "link" and "noise" seem to be floating point. I can figure out the same info from iwconfig command, but I don't want python running a shell command unless I have to... Which I might, because that's the only place I can see a difference in monitor/managed mode.
Oh, while I remember: When you have WiFi module unloaded, as per the WiFi switcher or Advanced Interface Switcher, /proc/net/wireless does NOT have the third line. So what I do is measure the len(file("/proc/net/wireless", 'r')), and if it's two, do the gray X, if it's 3, check the signal. I haven't yet implemented a filter for if it's loaded but-not-connected, but I suspect all I need is to either check to see if link, level, and noise are all zeroes, and use that as a check for wifi on-but-unconnected, OR wait until I figure out where to most efficiently fetch the data traffic rate. Then I can use that, I suspect.
TiagoTiago: I think if you put the /n characted in the command line of the settings option, it will conflict with the actual python interpreter of the command. Where-as this is set within that clock style to separate each line (which themselves might require new-lines in their code to print one output line).
Last edited by Mentalist Traceur; 2011-01-04 at 08:59. Reason: Remember something for skykooler