1

I am working on a project which in short consists of a box pc (Dell Edge Gateway 5200 with 4G upgrade) instrumented with accelerometers and a USB GPS unit (Tel0138 GPS receiver). The PC runs Windows 10 IoT which runs a VM of Debian11. I have a program that runs (and reboots automatically when the PC restarts) which activates the sensors for data collection and uses gpsd to stream data from the GPS device. Of note is that this entire system is on a moving vehicle, with the GPS unit attached to the top (outside) of the vehicle. There is also a TE patch antenna attached to the GNSS port of the 4G unit of the PC.

The GPS unit appears to be functioning very poorly, it often doesn't start streaming data and when it does it appears to be incorrect often showing one location for hours when there's been movement. It appears to be having trouble finding signal as when I manually run gpsd and cgps I just get a blank screen with no fix for a long time. I would like to improve this.

The GPS unit has been moved outside ontop of the vehicle so I think there is no improvement to positioning that can be made. For the code that activates the unit it is very simple, calling cgps and starting a stream, and this does work when stationary in testing area so I assume in principle theres no improvement I can make here.

I'm not sure how to query the patch antenna attached to the chip of the PC, I have written a Powershell script that uses the windows location API and this has had some intermittent success, but I am unsure if there is an easier way to query this data? The USB device is easy to setup and run through virtualbox however as mentioned it is very unreliable, is there a high end supplier of this type of device, specifically USB GPS devices? Money is not an issue for this project however I can only find very cheap devices (low powered?) of the same types as the one i currently have.

EDIT: My powershell code is noted below:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Device.Location;
using System.Timers;


namespace Location
{
    class Program
    {
        static (double, double, string) Location()
        {
            GeoCoordinateWatcher watcher = new GeoCoordinateWatcher();

            watcher.TryStart(false, TimeSpan.FromMilliseconds(1000));

            GeoCoordinate coord = watcher.Position.Location;
        
    
            DateTime currentDateTime = DateTime.Now;
            string formattedDateTime = currentDateTime.ToString("dddd, dd MMMM yyyy HH:mm:ss");
            
            double lat = coord.Latitude;
            double lon = coord.Longitude;
            Console.WriteLine("Lat: " + lat + ", Lon: " + lon);
            Console.WriteLine(formattedDateTime);

            (double, double, string) t1 = (lat, lon, formattedDateTime);
            return t1; 

        }
        static void Location_Write()
        {
            using (StreamWriter writer = new StreamWriter("C:\\Documents\\test.txt", true))
            {
                writer.WriteLine(Location());


            }
        }
        public static void Main()
        {
            
            SetTimer();
            Console.WriteLine("\nPress the Enter key to exit the application...\n");
            Console.WriteLine("The application started at {0:HH:mm:ss.fff}", DateTime.Now);
            Console.ReadLine();
            //aTimer.Stop();
            //aTimer.Dispose();
        }
        private static void SetTimer()
        { Timer aTimer = new System.Timers.Timer(1000);
            aTimer.Elapsed += OnTimedEvent;
            aTimer.AutoReset = true;
            aTimer.Enabled = true;
        }
        private static void OnTimedEvent(Object source, System.Timers.ElapsedEventArgs e)
        { Location_Write();
        }
    }
}

And my cgps call:

gpspipe -w | grep TPV > /output
GKelly
  • 87
  • 8
  • Good show adding your code. You'll get more eyes on your question if you include *one* tag for the programming language that will help you most solving your problem. This almost a driver issue, but drivers are/sb language agnostic. Sorry I can't help further than that. Good luck. – shellter Aug 02 '23 at 22:51

0 Answers0