Reputation: 236
The problem I'm trying to tackle is extracting the RSSI levels of all the wifi networks discoverable by my laptop. My requirements are to be able to view RSSI of all wifi networks, and to be able to poll new data every second or so, since I'm trying to track the wifi RSSI for a computer moving around in a space.
So far I've heard of and tested two solutions, initiating the following commands with subprocess
and parsing their output:
cat /proc/net/wireless
, which outputs information for the current network only, and there doesn't seem to be a way to output information for all networks with this file obviously. It updates with a good-enough interval for me, but again, not all networks.iwlist scan
, which outputs information for the current network only, unless used with sudo
, but since I want this automated in a program that will run the iwlist sccan
command from within, sudo is a problem. Also, it seems to update the RSSI levels very slowly compared to the previous option, which is a no-go, since I need the RSSI levels updated by the second.I would love to hear about any other solution to get this data. I'll note that I'm building the program in python, so any library would be good, or just a cli tool that I will invoke from within the python program.
Currently working with an Ubuntu 16.04 setup.
Thanks!
Upvotes: 1
Views: 2597
Reputation: 413
On the command line you can use following command :
iwconfig
and look for "Link Quality"
and "Signal level"
values.
Or Use this command which updates the output of iwconfig every second:
watch -n1 iwconfig
Upvotes: 1