Skip to content

A PowerShell script for retrieving GPS data from Location Sensors on Windows. Seamlessly captures location information through Windows Location API and direct COM port reading. Designed for easy GPS tracking, with automatic COM port detection and support for multiple data sources.

Notifications You must be signed in to change notification settings

AdnerVL/GPS-Data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GPS Data Reader for Location COM Devices πŸŒπŸ“‘πŸ›°οΈ

Description πŸ“πŸ—ΊοΈ

This PowerShell script suite is designed to retrieve and display GPS data from Location COM devices on Windows systems. It utilizes:

  • Windows Location API 🌍🧭 to fetch processed location data if available.
  • COM Port Reading πŸ”ŒπŸ“Ÿ to capture raw NMEA sentences from GPS devices connected via serial ports.

Disclaimer πŸ€–πŸš§

AI-Assisted Development πŸ€πŸ’‘ This script was created with significant assistance from AI technologies. As the creator is not a professional PowerShell or software developer, the code reflects a collaborative approach between human intent and AI-generated solution.

Features πŸŒŸπŸ”

  • Automatic COM Port Detection πŸ“‹πŸ”Ž: Scans for and lists all available COM ports.
  • Multiple Data Sources πŸ”„πŸŒˆ:
    • Windows Location Service for high-level location data.
    • Direct COM port reading for raw GPS data (NMEA sentences).

How to Use πŸ› οΈπŸ‘¨β€πŸ’»

Prerequisites βœ”οΈπŸ

  • Windows OS with PowerShell 5.1 or higher πŸ’»
  • Administrative privileges might be necessary for accessing COM ports πŸ”

Installation πŸ’Ύ

No installation required; just run the script from PowerShell:

  1. Download or copy the script πŸ“₯ to your local machine.
  2. Open PowerShell πŸ–₯️ as an Administrator if you encounter permission issues.

Usage Steps πŸšΆβ€β™‚οΈπŸ“

  1. Open PowerShell and navigate to the directory containing the script:

    cd "path\to\your\script\directory"
  2. Run the script:

    .\GPSDataReader.ps1

Outcome πŸ“œπŸŒ

  • Try to fetch location data via the Windows Location API. πŸ—ΊοΈ
  • Scan for all available COM ports and attempt to read NMEA data from each.πŸ”

Notes πŸ“ŒπŸ”¬

  • COM Ports: πŸ”Œ The script assumes a baud rate of 9600. Adjust this in the script if your device uses a different rate.
  • Data Output: πŸ“Š Raw NMEA data might not be formatted; you'll see whatever comes through the port.
  • Error Handling: 🚨 Basic error handling is implemented, but you might encounter issues if ports are in use or not configured correctly.

Customization πŸ”§πŸ› οΈ

  • Baud Rate: Change the $baudRate parameter in the Get-NmeaDataFromComPort function.
  • Timeout: Adjust the ReadTimeout in the COM port reading function to optimize for your hardware.

Troubleshooting πŸš¨πŸ•΅οΈβ€β™€οΈ

Common Issues πŸ”πŸ§©

No Data Detected πŸ“‘βŒ

  • Verify GPS sensor power and connection πŸ”‹πŸ”Œ
  • Check Device Manager for port conflicts πŸ’»πŸš§
  • Ensure no other applications are using the COM port πŸ–₯οΈπŸ”’

Permission Errors πŸ”πŸš«

  • Run PowerShell as Administrator πŸ‘‘πŸ’»
  • Verify user has necessary system permissions πŸ›‘οΈπŸ‘€
  • Check Windows Location Service settings βš™οΈπŸŒ

Performance Problems 🐌⏱️

  • Increase ReadTimeout for slower devices πŸ•°οΈπŸ’
  • Verify device-specific communication parameters πŸ“ŠπŸ”§

License πŸ“œβš–οΈ

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Contributions πŸ’‘πŸ€

Pull requests are welcome! πŸŽ‰ For major changes, please open an issue first to discuss what you would like to change.

Happy GPS tracking! πŸš€πŸŒπŸ›°οΈ

About

A PowerShell script for retrieving GPS data from Location Sensors on Windows. Seamlessly captures location information through Windows Location API and direct COM port reading. Designed for easy GPS tracking, with automatic COM port detection and support for multiple data sources.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published