wiki:WIMXUWI/GPS_Script

Version 10 (modified by dmeyer@cs.wisc.edu, 13 years ago) (diff)

--

Getting Measurements While Driving for the 6250 in Linux

Required Packages

Directions for 6250

We are using a USB GPS dongle and the required packages for it are gpsd and its dependencies.

For the python script to be able to communicate with gpsd, we will need the python-gps package as well.

The names of the data files created use the current date and time, therefore we will need the dateutil python package also.

sudo apt-get install gpsd python-gps python-dateutil

Script Configuration

Next you should open the script in a text editor and look at the global variable and constants. There are options to execute scans for the RSSI values and/or iperf tests. The output to those tests are put in separate directories under the file names based on the current date and time. As it stands, these are the current variables and Constants:

#----------------------------------------------------------------------
# Global Variables / Constants
#----------------------------------------------------------------------
    
# Global debug to output console
DEBUG = True

# Global to write the date and column headers
WRITE_FILE_HEADER = True

# Automatically connect even when disconnected
AUTO_CONNECT = True

# Global for which data set to get
RUN_RSSI = True
RUN_IPERF = False 

# Pause through loop
PRESS_ANY_KEY = False

# Directory constants - The name of the file is the date and time
RSSI_DIRECTORY = "./rssi/"
MBPS_DIRECTORY = "./mbps/"
CREATE_DIRS_IF_NOT_EXIST = False

# wimaxcu constants
SCAN_RSSI_STRING = "RSSI        : "
STATUS_LINK_RSSI_STRING = "RSSI      : "

# Iperf server
IPERF_SERVER = "iperf.wiscnet.net"

Notes

  • The iperf is not tested extensively yet.
  • The GPS session is closed each time at the end of the loop and created again at the beginning of the loop. This is done because the output of the USB GPS dongle is an asynchronous operation, and is contingent upon the surroundings. If this is taken out, your RSSI or Mbps data will more than likely not match to the correct GPS location.
  • That being said, it does take a little time to acquire a valid GPS location.

Script Execution

Open a command line and cd to the directory of the script and type:

python gpsData.py

Script Changes

If anybody has any changes they would like to request, bugs to report, Ubuntu packages missed, or an update they would like to submit, email: Derek Meyer

Attachments (2)

Download all attachments as: .zip