chrismyers2000 Posted March 26, 2015 Posted March 26, 2015 Anyone know of a fancy set of commands that would allow me to set the system time based on the incoming GPS data while running kismet_server? I have it set up to run using the DIP switches but the system time is always 01/01/2014 00:00. I'd like for the file names to be correctly labeled and also have correct time info for when AP's are seen. I'm also going for portability so I'd really like to not have to SSH in and enter it in manually every time I plug it in. This is my current boot config: ifconfig wlan1 down; iwconfig wlan1 mode monitor; ifconfig wlan1 up; sleep 5; kismet_server Any ideas? Quote
raz0r Posted March 26, 2015 Posted March 26, 2015 Intresting idea you would use the NMEA 0183 for the Lat & Long Quote
chrismyers2000 Posted March 26, 2015 Author Posted March 26, 2015 Intresting idea you would use the NMEA 0183 for the Lat & Long Yes, I already use the GPS for logging Lat and Long using Kismet but would also like to use it at bootup to set the time. NMEA 0183 also contains date and time data. Quote
chrismyers2000 Posted March 26, 2015 Author Posted March 26, 2015 I found this on the Openwrt forums but am still trying to make heads or tails of it. I'm new to this whole linux thing :\ https://forum.openwrt.org/viewtopic.php?id=14382 I know i'd have to change the gps device location to /dev/ttyUSB0 but i'm not sure what else id need to change or if it would even work. Thoughts? Quote
chrismyers2000 Posted March 28, 2015 Author Posted March 28, 2015 Well I figured it out. I stumbled across a post by dvarapala about warwalking and he posted his script which happens to do the exact thing that I want :) https://forums.hak5.org/index.php?/topic/33855-warwalking-redux-and-a-question/ #!/bin/bash # START CLEAN pkill hostapd pkill gpsd pkill kismet /sbin/ifconfig wlan0 down /sbin/ifconfig wlan1 down # START GPSD /usr/sbin/gpsd -n /dev/ttyUSB0 # WAIT UNTIL IT'S READY TO ACCEPT CLIENT CONNECTIONS sleep 1 # MONITOR GPS STATUS AND WAIT FOR SAT LOCK gpspipe -w | grep -qm 1 '"mode":3' # PARSE THE CURRENT UTC TIME FROM THE GPSD OUTPUT UTCDATE=`gpspipe -w | grep -m 1 "TPV" | sed -r 's/.*"time":"([^"]*)".*/\1/' | sed -e 's/^\(.\{10\}\)T\(.\{8\}\).*/\1 \2/'` # SET THE PINEAPPLE'S CLOCK date -u -s "$UTCDATE" # LAUNCH KISMET DAEMON /usr/sbin/iwconfig wlan0 mode Monitor /usr/sbin/iwconfig wlan1 mode Monitor /usr/bin/kismet_server --daemonize I was having problems with gpspipe, it just would not work. I used opkg to uninstall and reinstall, but it still would not work. I ended up reflashing the firmware and starting fresh. It works like a charm now :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.