.. _stat_data_collection_outdoor:

STAT: Data Collection (with GPS)
================================

    1. Prepare a satellite image file (e.g. Google Map, Bing Map, OpenStreetMap, etc.) for the outdoor test site and rename the file using the following format:

           **'<ID>$<lat1><lon1><lat2><lon2>.png'**

           - **<ID>**: the map ID

           - **<lat1>**: the latitude correpsonding to the **top-left** corner of the satellite map.
       
           - **<lon1>**: the longitude correpsonding to the **top-left** corner of the satellite map.
       
           - **<lat2>**: the latitude correpsonding to the **bottom-right** corner of the satellite map.
       
           - **<lon2>**: the longitude correpsonding to the **bottom-right** corner of the satellite map.

       Other image formats (e.g. **.jpeg** or **.bmp**) should also work.

       6 decimal points for the latitudes/longitudes should be sufficient for most purposes.

    .. note::

       **Example File Name**:

       'newracom$33.673939,-117.760588,33.670314,-117.756668.png'

    .. warning::
       Double-check to make sure that the GPS coordinates are correct by cross-checking the coordinates with the original satellite map application (e.g. Google Map, Bing Map, OpenStreetMap, etc.).

    2. Relocate the AP to a fixed location and power it on using a portable battery.

    3. Connect the USB-GPS device to the STA and plug in the Ethernet adapter into the laptop. Use a LAN cable to connect the Ethernet adapter and the STA. Power on the STA.

    4. Open the SWiSS application on the laptop and select STAT (Spatial Test Automation Tool):

    .. image:: images/swiss_main_menu_stat.png

    5. Select the satellite map image file.

    .. image:: images/swiss_stat_outdoor.png

    6. Select **GPS** and press **CONNECT** to start the measurement process. Note that logging is disabled by default.
    
    .. image:: images/swiss_stat_outdoor_connect.png

    .. note::

       For the GPS device to function, the sky must be clearly visible from the STA. After a cold boot, it may take a few minutes for the GPS to start. The control panel should display at least three to four fixed satellites for the GPS to operate properly.

    7. Specify the location of the AP by pressing the **SET** button on the AP location control panel. Click the AP location on the pop-up map page and press **OK**.

    .. image:: images/swiss_stat_outdoor_ap_location.png
    
    8. Move to the desired location and start logging measurement data by turning on **CONTINUOUS LOGGING**.
    
    .. image:: images/swiss_stat_outdoor_logging.png
    
    .. note::

       The measurement values in the screenshot are randomly generated using a GPS simulator.

    9. Once all the data points are collected, either turn off **CONTINUOUS LOGGING** or press **DISCONNECT**. To save the data points, access the menu item **File->Save Results** from the top menu bar. This will create a timestamped directory with the log files which can be visualized as heatmaps using the WAVE (WiFi Area Visual Evaluator) tool.

    .. warning::

       Please make sure that the logs are properly saved before you quit the program!
