def executeGPS(): gps = subprocess.Popen(['ps -ef | grep gpsd'], stdout=subprocess.PIPE, shell=True)#Assigns the output from the grepto the gps variable (output, error) = gps.communicate() if 'gpsd' in output: GPIO.output(17, False) #Turn on GPSD LED else: GPIO.output(17, True) #Turn off GPSD LED
def runGPSD(): gps = subprocess.Popen(['ps -ef | grep gpsd'], stdout=subprocess.PIPE, shell=True) (output, error) = gps.communicate() if 'gpsd' in output: gpsd_stat = "1" else: print("GPSD Daemon not running!")
def executeGPS(): gps = subprocess.Popen( ['ps -ef | grep gpsd'], stdout=subprocess.PIPE, shell=True) #Assigns the output from the grepto the gps variable (output, error) = gps.communicate() if 'gpsd' in output: GPIO.output(17, False) #Turn on GPSD LED else: GPIO.output(17, True) #Turn off GPSD LED
#Makes sure all LED's are at the same state initially (off): GPIO.output(4, True) GPIO.output(17, True) GPIO.output(22, True) GPIO.output(9, True) GPIO.output(10, True) while 1 < 2: kismet = subprocess.Popen(['ps -ef | grep kismet_server'])#checks if kismet_server is running. stdout = subprocess.PIPE, shell=True() #Assigns the output from the grep to the kismet variable. (output, error) = kismet.communicate() if 'kismet_server' in output: GPIO.output(4, False) #Turn on KISMET LED else: GPIO.output(4, True) #Turn off KISMET LED. gps = subprocess.Popen(['ps -ef | grep gpsd'], stdout = subprocess.PIPE, shell=True)#Assigns the output from the grep to the gps variable (output, error) = gps.communicate() if 'gpsd' in output: GPIO.output(17, False) #Turn on GPSD LED. else: GPIO.output(17, True) #Turn off GPSD LED #Button snippet,connects to your wlan node,and stops kismet_server,also uploads the logfiles to wigle.net while True: if (GPIO.input(26)): time.sleep(0.05)#Button debounce. os.system('killall kismet')#stops all instances of kismet. os.system('killall kismet_server')#stops all instances of kismet_server. time.sleep(2)# added so kismet has the time to die. os.system('/etc/init.d/networking restart')#restarts networking time.sleep(1.5)#wait for networking to restart. os.system('wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf')#connects to your wlan node. time.sleep(10)#added so wlan0 has time to autenticate and assosiate with the wlan node. command = os.system('ping -c 5 http://www.wigle.net')#checks if wigle.net is up.