openaps / openxshareble

openaps driver for Dexcom G4 with Share BLE
MIT License
11 stars 10 forks source link

Error trying to get glucose data #5

Open dduugg opened 8 years ago

dduugg commented 8 years ago

hi, i'm at this step, trying to get glucose data, but getting an error:

pi@raspberrypi:~/my_openaps $ openaps use cgm oref0_glucose --hours 2.0
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 719, in run_script
  File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 57, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 92, in __call__
    return self.method.selected(args)(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 31, in __call__
    return self.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openxshareble/__init__.py", line 97, in __call__
    res = self.ble.run_mainloop_with(run, quit_with_loop=False)
TypeError: run_mainloop_with() got an unexpected keyword argument 'quit_with_loop'
pi@raspberrypi:~/my_openaps $ openaps use cgm oref0_glucose --no-raw --hours 2.0
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 719, in run_script
  File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 57, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 92, in __call__
    return self.method.selected(args)(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 31, in __call__
    return self.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openxshareble/__init__.py", line 97, in __call__
    res = self.ble.run_mainloop_with(run, quit_with_loop=False)
TypeError: run_mainloop_with() got an unexpected keyword argument 'quit_with_loop'

i see a similar error was reported here: https://gitter.im/nightscout/intend-to-bolus?at=57001e1f76b6f9de194d85c3

Let me know if you have any suggestions. I'm using a G4 with Share.

dduugg commented 8 years ago

I think the issue here is that

sudo pip install git+git://github.com/bewest/Adafruit_Python_BluefruitLE.git'#wip/bewest/custom-gatt-profile'

should be:

sudo pip install git+git://github.com/bewest/Adafruit_Python_BluefruitLE.git@wip/bewest/custom-gatt-profile

However, with that change, I'm getting a different error:

pi@raspberrypi:~/my_openaps $ openaps use cgm oref0_glucose  --hours 2.0
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.1.5', 'openaps-use')
  File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 719, in run_script
  File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 1504, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/EGG-INFO/scripts/openaps-use", line 57, in run
    output = app(args, self)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 92, in __call__
    return self.method.selected(args)(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/uses/__init__.py", line 31, in __call__
    return self.method(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openxshareble/__init__.py", line 97, in __call__
    res = self.ble.run_mainloop_with(run, quit_with_loop=False)
  File "/usr/local/lib/python2.7/dist-packages/Adafruit_BluefruitLE/bluez_dbus/provider.py", line 121, in _user_thread_main
    self._return_code = target()
  File "/usr/local/lib/python2.7/dist-packages/openxshareble/__init__.py", line 93, in run
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/dexcom.py", line 402, in main
    iter_glucose = self.get_glucose_data(params, args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.1.5-py2.7.egg/openaps/vendors/dexcom.py", line 381, in get_glucose_data
    return itertools.takewhile(self.comparison, self.dexcom.iter_records('EGV_DATA'))
AttributeError: 'NoneType' object has no attribute 'iter_records'
dramageek commented 8 years ago

I was getting the same error from your first comment for every use command. Re-installing the adafruit library with your updated command worked somewhat- list_dexcom now returns a valid response. However, I still get the same error as you when trying for actual communication with the device.

PieterGit commented 8 years ago

same quit_with_loop error with raspberry pi3 and openaps 0.1.6-dev and bluez_5.23-2+b1_armhf.deb. What bluez version works?

bschrag620 commented 8 years ago

I seem to be having same issue. Can find g4 with list_device but every other command has error ending with something similar to

AttributeError: 'NoneType' object has no attribute 'iter_records'

Setting the g4 up as wired and using the Medtronic vendor works but would prefer to have the Bluetooth working.

PieterGit commented 8 years ago

@bschrag620 : what country are you in? I found out that the "Dexcom G4 with share" is only available in the USA. I think the European G4's have bluetooth, but probably the EU firmware prevents them from working. They push the G5 in Europe and won't allow G4 with Share.

jaylagorio commented 7 years ago

Confirming US G4 with Share receiver doesn't work via Bluetooth on an Edison with Explorer board but in my case works fine over USB OTG. Misfiled an issue here: https://github.com/openaps/openaps/issues/114