osx 10.11.6 CrcError parsing records
I am hoping this is not a me only problem, then again I hope it's not happening to others. I was trying to use this tool first then install the Clarity app and was able to upload record data successful.
There are a few command that are successful like user_even_data DescribeClocks GetFirmwareHeader { "DexBootVersion": "5", "BLESoftwareVersion": "1.0.0.76/1.0.1", "RFVersion": "1", "ApiVersion": "3.0.0.0", "ProductName": "Dexcom G5 Mobile Receiver", "SoftwareNumber": "SW10617", "TestApiVersion": "2.10.0.0", "BLEHardwareVersion": "HW0072", "SchemaVersion": "1", "ProductId": "G5MobileReceiver", "PortVersion": "4.6.4.66", "FirmwareVersion": "4.0.1.048", "BLEDeviceAddress": "********" }
But a lot around glucose and sensor basically any iter_* return an error similar to below. Any help would be appreciated.
Traceback (most recent call last):
File "/usr/local/bin/openaps-use", line 4, in
@cropp : is this still valid? or did you find a way to fix this issue?
G5MobileReceiver has a different EGVRecord format than G5Receiver. Two extra bytes have been inserted into the record. To be precise, FORMAT = '<2IHxxxxxxxxxcxxxH'.
I just fixed this problem in my own dexcom_reader-derived code, about a week ago, when I got a new G5MobileReceiver, after the old G5Receiver failed. (By the way, the G5Mobile is a travesty of software/UI gore. Truly a terrible regression -- inferior in every way to the G5, except that it supports the backfill.)
I think the dexcom_reader project is dead unfortunately. My PRs from a year ago have yet to receive comment. Along with this thread.
But anyway, I'll create a PR that fixes the issue, eventually. To do it properly requires making it automatically use the format for G5 or G5R, which I haven't done. For now here is a quick fix:
--- a/dexcom_reader/database_records.py
+++ b/dexcom_reader/database_records.py
@@ -333,12 +333,6 @@ class EGVRecord(GenericTimestampedRecord):
self.trend_arrow, self.display_only)
class G5EGVRecord (EGVRecord):
- FORMAT = '<2IHBBBBBBBBBcBH'
- @property
- def full_trend(self):
- return self.data[12]
-
-class G5MobileEGVRecord (EGVRecord):
FORMAT = '<2IHxxxxxxxxxcxxxH'
What I actually have in my code is this:
+++ b/dexcom_reader/database_records.py
@@ -338,4 +338,7 @@ class G5EGVRecord (EGVRecord):
def full_trend(self):
return self.data[12]
+class G5MobileEGVRecord (EGVRecord):
+ FORMAT = '<2IHxxxxxxxxxcxxxH'
--- a/dexcom_reader/readdata.py
+++ b/dexcom_reader/readdata.py
@@ -362,6 +362,16 @@ class DexcomG5 (Dexcom):
'SENSOR_DATA': database_records.SensorRecord,
}
+class DexcomG5Mobile (Dexcom):
+ PARSER_MAP = {
+ 'USER_EVENT_DATA': database_records.EventRecord,
+ 'METER_DATA': database_records.G5MeterRecord,
+ 'CAL_SET': database_records.Calibration,
+ 'INSERTION_TIME': database_records.G5InsertionRecord,
+ 'EGV_DATA': database_records.G5MobileEGVRecord,
+ 'SENSOR_DATA': database_records.SensorRecord,
+ }
+
Then you need to construct the reader like so:
dd = readdata.DexcomG5Mobile.FindDevice()
return readdata.DexcomG5Mobile(dd)
I use a command line option to choose G5R or G5 (or G4). It doesn't auto-detect.
Actually it turns out that this was implemented in #19 just three days ago. It auto-detects G4, G5, G5M, and even G6.