EM7455B NMEA on COM3 how to get GPS Coordinates via Powershell

Hello,

I have Model: EM7455B Revision: SWI9X30C_02.20.03.22 r6827 CARMD-EV-FRMWR2 2016/10/11 16:03:14 and the Skylight app will provide me with GPS so I know it works. But how does one programmatically get the gps coordinates via commandline or powershell? All of my attempts seem to time out. Heres some of the stuff I have tried:

#$port=new-object system.io.ports.serialport com3,9600,None,8,One
#$port.Open()
#$port.WriteLine(“at!gpsloc”)
#$port.Close()

#$port= new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one
#$port.Open()
#$port.ReadLine()

#$Rport= new-Object System.IO.Ports.SerialPort com3,9600,None,8,one
#Register-ObjectEvent -InputObject $Rport -EventName “DataReceived” -SourceIdentifier $Name > $null
#$Rport.Open()
#$Rport.ReadLine()

Any help would be appreciated, the goal is to log GPS coordinates during windows login via startup, login or scheduled task scripts.

you need to use AT command like AT!GPSFIX and AT!GPSLOC to get the location.

Unfortunately, I already tried that and it did not work:
#$port.WriteLine(“at!gpsloc”)

Anyone have some example PowerShell or command line that works?

is COM3 the AT command port?

It is the NMEA port. Am I supposed to be using some other com port? One dedicated to AT commands?

yes, you need to use modem port for AT command instead of NMEA port.


Getting somewhere! Thanks @jyijyi !

I found this post that might help. MC7455 GPS not functioning - #5 by zainol69
Code:
$port=new-object system.io.ports.serialport com4,9600,None,8,One
$port.Open()
$port.WriteLine(“ATI1” + “r") start-sleep -m 50 $port.ReadExisting() start-sleep -m 50 $port.WriteLine("AT!GPSLOC" + "r”)
start-sleep -m 50
$port.ReadExisting()
start-sleep -m 50
$port.WriteLine(“AT!GPSFIX” + “r") start-sleep -m 50 $port.ReadExisting() start-sleep -m 50 $port.WriteLine("at!gpstrack=?" + "r”)
start-sleep -m 50
$port.ReadExisting()
start-sleep -m 50
$port.WriteLine(“at!gpstrack=1,255,1000,30,1” + “r") start-sleep -m 50 $port.ReadExisting() start-sleep -m 50 $port.WriteLine("at!custom?" + "r”)
start-sleep -m 50
$port.ReadExisting()
$port.WriteLine(“at!entercnd="A710"” + “r") start-sleep -m 50 $port.WriteLine("AT!CUSTOM=“GPSENABLE",1" + "r”)
start-sleep -m 50
$port.WriteLine(“AT!CUSTOM="GPSLPM”,0” + “r") start-sleep -m 50 $port.WriteLine("AT!RESET" + "r”)
start-sleep -m 50
$port.WriteLine(“at!gpsstatus?” + “r") start-sleep -m 50 $port.ReadExisting() start-sleep -m 50 $port.WriteLine("AT!GPSLOC" + "r”)
start-sleep -m 50
$port.ReadExisting()
start-sleep -m 50
$port.WriteLine(“AT!GPSFIX” + “`r”)
start-sleep -m 50
$port.ReadExisting()
$port.Close()

Output:
ATI1
Manufacturer: Sierra Wireless, Incorporated
Model: EM7455B
Revision: SWI9X30C_02.20.03.22 r6827 CARMD-EV-FRMWR2 2016/10/11 16:03:14
MEID: xxx
IMEI: xxx
IMEI SV: 6
FSN: LF823629820310
+GCAP: +CGSM

OK

AT!GPSLOC
ERROR

AT!GPSFIX
ERROR

at!gpstrack=?
!GPSTRACK: ,,,,
: 1-Standalone, 2-MS-Based, 3-MS-Assisted
: 1-255 seconds
: 1-4294967280 meters
: 1-1000,1000=continuous
: 1-65535 seconds

OK

at!gpstrack=1,255,1000,30,1
ERROR

at!custom?
!CUSTOM:
GPSENABLE 0x01
GPIOSARENABLE 0x01
GPSSEL 0x01
IPV6ENABLE 0x01
SIMLPM 0x01
USBSERIALENABLE 0x01

OK

at!entercnd=“A710”
OK
AT!CUSTOM=“GPSENABLE”,1
OK
AT!CUSTOM=“GPSLPM”,0
OK
AT!RESET
OK
at!gpsstatus?
Current time: 1980 01 06 6 00:00:55

1980 01 06 6 00:00:55 Last Fix Status = NONE
1980 01 06 6 00:00:01 Fix Session Status = ACTIVE

No TTFF available

OK

AT!GPSLOC
ERROR

AT!GPSFIX
ERROR

Im getting closer but still not getting coordinates. Any advice?

PS C:\Users\me> $port=new-object system.io.ports.serialport com6,9600,None,8,One
$port.Open()

start-sleep -m 50
$port.WriteLine("AT!GPSFIX=1,255,1" + "`r")
start-sleep -m 50
$port.ReadExisting()

start-sleep -m 50
$port.WriteLine("AT!GPSSATINFO?" + "`r")
start-sleep -m 50
$port.ReadExisting()


start-sleep -m 50
$port.WriteLine("AT!GPSLOC" + "`r")
start-sleep -m 50
$port.ReadExisting()
start-sleep -m 50
$port.WriteLine("AT!GPSFIX" + "`r")
start-sleep -m 50
$port.ReadExisting()


$port.Close()

OK


Satellites in view:  4 (2021 07 14 2 18:11:19)
* SV:  2  ELEV: 48  AZI:   53  SNR: 36
* SV: 12  ELEV: 54  AZI:  161  SNR: 32
* SV: 20  ELEV: 48  AZI:  108  SNR: 34
* SV: 29  ELEV: 45  AZI:  291  SNR: 29

OK


ERROR


ERROR


PS C:\Users\me>

I think I finally got it!

PS C:\Users\me> $port=new-object system.io.ports.serialport com6,9600,None,8,One
$port.Open()

start-sleep -m 50
$port.WriteLine("AT!GPSFIX=1,255,1" + "`r")
start-sleep -m 50
$port.ReadExisting()

start-sleep -m 50
$port.WriteLine("AT!GPSSATINFO?" + "`r")
start-sleep -m 50
$port.ReadExisting()

start-sleep -m 50
$port.WriteLine("AT!GPSSTATUS?" + "`r")
start-sleep -m 50
$port.ReadExisting()

start-sleep -m 50
$port.WriteLine("AT!GPSLOC?" + "`r")
start-sleep -m 50
$port.ReadExisting()

$port.Close()

OK


Satellites in view:  5 (2021 07 14 2 18:22:55)
* SV:  2  ELEV: 43  AZI:   54  SNR: 22
* SV: 12  ELEV: 48  AZI:  161  SNR: 24
* SV: 20  ELEV: 50  AZI:   99  SNR: 32
* SV: 25  ELEV: 69  AZI:  232  SNR: 30
* SV: 29  ELEV: 49  AZI:  295  SNR: 18

OK


Current time: 2021 07 14 2 18:23:21

2021 07 14 2 18:22:55 Last Fix Status    = SUCCESS
2021 07 14 2 18:23:21 Fix Session Status = ACTIVE

TTFF (sec) = 109

OK


Lat: obfuscated
Lon: obfuscated
Time: 2021 07 14 2 18:23:12 (GPS) 
LocUncAngle: 0.0 deg  LocUncA: 48 m  LocUncP: 21 m  HEPE: 52.392 m
2D Fix 
Altitude: 45 m  LocUncVe: 192.0 m
Heading: 0.0 deg  VelHoriz: 0.0 m/s  VelVert: 0 m/s

OK


PS C:\Users\me>