https://github.com/adnervl/gps-data
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.
https://github.com/adnervl/gps-data
com-port gps gps-data windows
Last synced: 6 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/adnervl/gps-data
- Owner: AdnerVL
- Created: 2024-12-12T19:08:33.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-16T19:53:27.000Z (about 1 year ago)
- Last Synced: 2025-02-22T22:28:03.769Z (11 months ago)
- Topics: com-port, gps, gps-data, windows
- Language: PowerShell
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
```powershell
cd "path\to\your\script\directory"
```
2. **Run the script**:
```powershell
.\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! πππ°οΈ