rasbperry pi has iwconfig, but I want the strength of the SSID that is not currently connected, so I will create it. :::cd ../../usr/local/bin :::sudo nano getsi
getsi
#!/bin/sh
sudo iwlist wlan0 scan | grep -e ESSID -e Quality
:::sudo chmod a+x getsi It should be done. ↓ Easier method (Since alias did not work on the system I want to make, I will leave the above as well)
[Display the signal strength of a specific SSID (mac)] By using the alias command, which was pointed out in the comment of [a], the above command registration work becomes unnecessary.alias getsi="sudo iwlist wlan0 scan | grep -e ESSID -e Quality"
Yes, this completes getsi registration (early)
Hit getsi to confirm.
test.py
import subprocess as spc
res=spc.check_output("getsi")
lis=res.split()
ss=lis.index('ESSID:"The SSID you want to find"')
ss=ss-2
ra=lis[ss].split("=")
RSSI=abs(int(ra[1]))
print RSSI
It is the same as mac, and the closer it is to 0, the better the signal strength.
Just run the command on python and format the output (forced)
If alias doesn't work,
unalias getsi
If you delete the command with and write it in the path as shown above, it should work.
Recommended Posts