Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# pynmeagps Release Notes

### RELEASE 1.1.2

1. Add workaround for Unicore UM9* firmware error, which creates malformed NMEA GLL sentences (-ve latitude).

### RELEASE 1.1.1

1. Add helper methods `utc2wnotow` and `wnotow2utc` to convert between UTC datetime and GPS week number, time of week (in milliseconds) and leapsecond offset.
Expand Down
2 changes: 1 addition & 1 deletion src/pynmeagps/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
:license: BSD 3-Clause
"""

__version__ = "1.1.1"
__version__ = "1.1.2"
2 changes: 1 addition & 1 deletion src/pynmeagps/nmeahelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def dmm2ddd(pos: str) -> float | str:
dp = pos.find(".")
if dp < 4:
raise ValueError()
posdeg = float(pos[0 : dp - 2])
posdeg = abs(float(pos[0 : dp - 2]))
posmin = float(pos[dp - 2 :])
return round((posdeg + posmin / 60), 10)
except (TypeError, ValueError):
Expand Down
6 changes: 6 additions & 0 deletions tests/pygpsdata-um981.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$GNGGA,130058.00,5327.03598945,N,00214.41467156,W,1,08,7.5,36.3017,M,51.6775,M,,*5B
$GNGLL,5327.03598945,N,-0214.41467156,W,130058.00,A,A*7E
$GNRMC,130058.00,A,5327.03598945,N,00214.41467156,W,0.097,125.7,240226,0.2,W,A,C*4F
$GNGGA,130059.00,5327.03598242,N,00214.41468053,W,1,08,7.5,36.3232,M,51.6775,M,,*58
$GNGLL,5327.03598242,N,-0214.41468053,W,130059.00,A,A*78

18 changes: 18 additions & 0 deletions tests/test_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,24 @@ def testNMEAUnicore(self): # test Unicore extended NMEA GET messages
i += 1
self.assertEqual(i, len(EXPECTED_RESULTS))

def testNMEAUM981(self): # test Unicore GLL firmware error workaround
EXPECTED_RESULTS = (
"<NMEA(GNGGA, time=13:00:58, lat=53.4505998242, NS=N, lon=-2.240244526, EW=W, quality=1, numSV=8, HDOP=7.5, alt=36.3017, altUnit=M, sep=51.6775, sepUnit=M, diffAge=, diffStation=)>",
"<NMEA(GNGLL, lat=53.4505998242, NS=N, lon=-2.240244526, EW=W, time=13:00:58, status=A, posMode=A)>",
"<NMEA(GNRMC, time=13:00:58, status=A, lat=53.4505998242, NS=N, lon=-2.240244526, EW=W, spd=0.097, cog=125.7, date=2026-02-24, mv=0.2, mvEW=W, posMode=A, navStatus=C)>",
"<NMEA(GNGGA, time=13:00:59, lat=53.450599707, NS=N, lon=-2.2402446755, EW=W, quality=1, numSV=8, HDOP=7.5, alt=36.3232, altUnit=M, sep=51.6775, sepUnit=M, diffAge=, diffStation=)>",
"<NMEA(GNGLL, lat=53.450599707, NS=N, lon=-2.2402446755, EW=W, time=13:00:59, status=A, posMode=A)>",
)
i = 0
with open(os.path.join(DIRNAME, "pygpsdata-um981.log"), "rb") as stream:
nmr = NMEAReader(stream, nmeaonly=False, quitonerror=2)
for raw, parsed in nmr:
if raw is not None:
# print(f'"{parsed}",')
self.assertEqual(str(parsed), EXPECTED_RESULTS[i])
i += 1
self.assertEqual(i, len(EXPECTED_RESULTS))

def testBADHDR_FAIL(self): # invalid header in data with quitonerror = 2
EXPECTED_ERROR = "Unknown protocol header b'$&'."
with self.assertRaises(NMEAParseError) as context:
Expand Down