Skip to content

Instantly share code, notes, and snippets.

View frankgould's full-sized avatar

Frank Gould frankgould

  • Orlando, Florida
View GitHub Profile
@frankgould
frankgould / battery_server.py
Created January 3, 2019 17:02
Rover Battery Capacity Communications Server code
#!/usr/bin/env python3
"""Server for multithreaded (asynchronous) chat application."""
from socket import AF_INET, socket, SOCK_STREAM, SOL_SOCKET, SO_REUSEADDR
from threading import Thread
import logging
from datetime import datetime
log_file = '/home/rover_logs/comm_server-log-' + datetime.now().strftime("%m-%d-%y") + '.txt'
logging.basicConfig(filename=log_file,level=logging.DEBUG)
logging.info('==================== Rover Battery Capacity Communications Server Logging Started ' + datetime.now().strftime("%m-%d-%y %H:%M:%S"))
@frankgould
frankgould / wifi-test.py
Last active December 17, 2018 22:35
using to determine wifi strength and display icon representation
import subprocess
temp = subprocess.Popen(args=['iwconfig wlan0 | grep -i quality'], stdout=subprocess.PIPE, shell=True)
wlan0_val, err = temp.communicate()
wlan0_strength = str(wlan0_val)
wlan0_strength = 'bb Link Quality=5/50 Signal level=-51 dBm \n'
cmp=wlan0_strength[25:33]
i=1
while cmp[i]!='/':
i += 1
cmp_num = cmp[:i]