The STREAM feature is designed to seamlessly integrate into custom anti-spoofing and jamming systems. This functionality grants access to raw data directly from the built-in GNSS module. For users of the DIN L1 model with an activated OSP license, it also provides processed data from the device's onboard interference detection algorithms. Furthermore, the STREAM feature enables the storage of all collected data—both raw and processed—on your computer's local disk, facilitating thorough post-analysis and review.



Activating the STREAM Option


To begin using the STREAM option, follow these steps to ensure proper activation:

  • Access the Web Configuration Panel: Log into the Web Configuration Panel of your GP-Probe DIN L1 device. If you are unsure how to access this panel, please refer to our comprehensive guide here: https://support.gpspatron.com/a/solutions/articles/101000466602 

  • Verify Your License: Ensure that your GP-Probe device's license includes the STREAM option by visiting the 'Admin/Licenses' section 


  • Enable RAW Data Streaming: In the Measurement Config section, find the STREAM option and toggle it on to activate.



Data Acquisition via STREAM


Raw data from the GP-Probe can be obtained in two ways:


1. Through the GP-Probe Web Interface:

  • Navigate to the Status/Measurements section in the Web Configuration Panel of your GP-Probe DIN L1 device.
  • Click the Record button to start capturing raw data directly in your browser.
  • Once recording is complete, you can save the data as a file by downloading it from the interface.


2. By Connecting to the WebSocket:
For real-time data streaming, you can connect directly to the GP-Probe’s WebSocket using the instructions below. This method allows for continuous data acquisition, particularly useful for automated systems and advanced analysis workflows.



Connecting to the Websocket


To connect to your GP-Probe device (both DIN L1 and TGE2 models) and start receiving raw or processed data, you can use the following Python script. This script establishes a WebSocket connection, receives binary data from the device, and saves it to a specified file for post-analysis.

#!/usr/bin/env python

import sys

import asyncio

import websockets

# Function to receive data over a WebSocket connection

async def recv_data():

    # Ensure that IP and file path arguments are provided

    if len(sys.argv) < 3:

        print("Usage: python script.py <device_ip> <output_file>")

        return

    

    # Get IP address and data file path from the command-line arguments

    ip = sys.argv[1]

    data_file = sys.argv[2]

    print(f"Connecting to device at ws://{ip}:8083...")

    print(f"Saving received data to {data_file}")

    # Establish a WebSocket connection

    async with websockets.connect(f'ws://{ip}:8083', ping_interval=None) as websocket:

        print("Connection established. Receiving data...")

        while True:

            try:

                # Receive binary data from the WebSocket

                binAnswer = await websocket.recv()

                # Append the received binary data to the specified file

                with open(data_file, 'ab') as file:

                    file.write(binAnswer)

                # Provide feedback to the user

                print(f"Received {len(binAnswer)} bytes of data. Written to {data_file}.")

            

            except asyncio.CancelledError:

                print("User requested to stop the program. Exiting.")

                break

            except websockets.ConnectionClosedError:

                print("Connection was closed by the server. Exiting.")

                break

# Main execution starts here

if __name__ == "__main__":

    print('Press Ctrl+C to stop the program.')

    asyncio.run(recv_data())


You can find the Python script for downloading data via WebSocket at the bottom of this page. Scroll down to access the download link.




How to Use the Script

  1. Prerequisites:

    • Python 3.8 or newer must be installed on your system.
    • The websockets library must be installed. You can install it using the following command:

      pip install websockets

  2. Save the Script: Save the script to a file on your computer, for example, 

    gp_probe_stream_receiver_v1.0.py


  3. Run the Script: Open a terminal and execute the script using the following command:

            python gp_probe_stream_receiver_v1.0.py <device_ip> <output_file>

    Replace <device_ip> with the IP address of your GP-Probe device and <output_file> with the path where you want the data to be saved. For example:

            python gp_probe_stream_receiver_v1.0.py 192.168.0.120 data.bin

  4. Observe the Output:

    • When the script runs, it establishes a WebSocket connection to the GP-Probe device.
    • Received data will be saved to the specified file in binary format.
    • Each successful reception will display the number of bytes received.

  5. Stop the Script:

    • You can stop the script anytime by pressing Ctrl+C.



Parsing GP-Probe DIN L1 Data


The binary files generated by the GP-Probe DIN L1 contain detailed GNSS-related measurements and diagnostics, grouped into the following key categories:

  1. Device Metadata:

    • Device ID, firmware version, and connection status.
    • Measurement timestamps and error codes for diagnostics.
  2. GNSS Signal Quality:

    • Carrier-to-Noise Ratio (C/N0): Average and individual values for observed satellites.
    • Root-Mean-Square (RMS) residuals for pseudorange calculations.
  3. Satellite Data:

    • Number of visible satellites for each GNSS constellation (GPS, Galileo, BeiDou, GLONASS).
    • Individual satellite parameters, such as signal strength and elevation.
  4. Interference Metrics:

    • Peak power of detected interference.
    • Anomaly percentages related to signal disruptions.
  5. Spectrum Data:

    • Raw signal spectrum for detailed analysis.
    • Normalized spectrum for efficient processing.
  6. Positional Accuracy and Calibration:

    • Position accuracy in meters.
    • Calibration data for satellite visibility and signal strength.

How to Use the Parser Script

To parse binary data and convert it into a readable CSV format:

  1. Prepare Your Environment:

    • Ensure Python 3.8 or later is installed on your system.
    • Save the parser script (e.g., GP-Probe DIN L1 Parser.py) to a known directory.
  2. Execute the Script: Use the following command in a terminal or command prompt:

    python GP_Probe_DIN_L1_Parser_v.1.1.py -i rawdata_0704CB42_28-Nov-2024_15-17-58_15-18-51.bin

    Replace the file paths as necessary:

    • python: Path to your Python executable.
    • GP_Probe_DIN_L1_Parser_v.1.1.py: Path to the parser script.
    • rawdata_0704CB42_28-Nov-2024_15-17-58_15-18-51.bin: Path to the input binary file.
  3. Output:

    • The parsed data will be saved as a CSV file in the same directory as the input file (or specified using the -o option).
    • The CSV will include columns for all essential measurements, satellite data, and interference metrics.
  4. Optional Parameters:

    • Add -o <output_file>.csv to specify a custom output file name.


Example of output CSV file:




Files Attached to This Article

Below is the list of all files included in this article for reference and download:

  1. gp_probe_stream_receiver_v1.0.py

    • A Python script designed to receive raw GNSS data via WebSocket from the GP-Probe device and save it to a local binary file.
    • Usage instructions for this script are provided in the section "Connecting to the WebSocket".
  2. GP_Probe_DIN_L1_Parser_v.1.1.py

    • A Python script for parsing binary GNSS data recorded by the GP-Probe DIN L1 and converting it into a CSV file for analysis.
    • Usage instructions for this script are detailed in the section "Parsing GP-Probe DIN L1 Data".
  3. rawdata_0704CB42_28-Nov-2024_15-17-58_15-18-51.bin

    • A sample binary file containing raw GNSS data collected from the GP-Probe DIN L1 device.
    • Use this file with the provided parser script to test the functionality.
  4. rawdata_0704CB42_28-Nov-2024_15-17-58_15-18-51.csv

    • An example of CSV file generated from the provided binary file.