Add files via upload

This commit is contained in:
Dominic Monette
2020-07-13 06:42:48 -04:00
committed by GitHub
parent db35ee9cff
commit 0ded9cf98b
92 changed files with 13631 additions and 0 deletions

30
test-rssi.py Normal file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env python
import re
import time
import sys
import os
import subprocess
signal = 0
avg = 0
freq = 5
for i in range(freq):
time.sleep(1)
line = subprocess.check_output(["echo $(/sbin/iwconfig wlan0 | grep Signal)"], shell=True)
sys.stdout.flush()
try:
found = re.search('Signal level=(.+?) dBm', line).group(1)
signal += int(found)
except AttributeError:
# Value not found...
print("Value not found. Stopping test.")
exit()
print found
sys.stdout.flush()
avg = (signal/freq)
print("Average:")
print(avg)
sys.stdout.flush()