These are chat archives for nightscout/intend-to-bolus

19th
Jan 2016
Ben West
@bewest
Jan 19 2016 00:03
ah, yeah
when you run it manually
eg, time openaps loop
time command will time how long it takes
what would ?
what might happen if it takes longer than a minute?
cron won't wait for the previous one to finish
it'll start the next one
JaysonEwer
@JaysonEwer
Jan 19 2016 00:08
What is the most graceful way to recovery from the following conditions? I've seen some mention of the mm-stick reset-usb, but the comment after the help seems to indicate it's not very graceful.
pi@Ewer-Open-APS:~/Documents/openaps $ mm-stick -h
Usage: mm-stick [{scan,diagnose,help},...]

    scan      - Print the local location of a plugged in stick.
    diagnose  - Run python -m decocare.stick $(python -m decocare.scan)
    warmup    - Runs scan and diagnose with no output.
                Exits 0 on success, non-zero exit code
                otherwise.
    insert    - Insert usbserial kernel module.
    remove    - Remove usbserial kernel module.
    udev-info - Print udev information about the stick.
    list-usb  - List usb information about the stick.
    reset-usb - Reset entire usb stack. WARNING, be careful.
    fail      - Always return a failing exit code.
    help      - This message.
pi@Ewer-Open-APS:~/Documents/openaps $
Jan 18 17:28:01 Ewer-Open-APS Stick transmit[TransmitPacket:ReadHistoryData:size[1024]:[page][0]:data[0]:] reader[ReadRadio:size:78] download_i[8] status[<LinkStatus:0x03:status:size=??LinkS
tatus:error:True:reason:[]:size(0)>] poll_size[0] poll_i[False] command[<LinkStatus:0x03:status:size=??LinkStatus:error:True:reason:[]:size(0)>]:download(attempts[8],expect[0],results[512]:d
ata[0]):BAD AILING
Jan 18 17:59:32 Ewer-Open-APS FAILED TO DOWNLOAD ANYTHING, after 0  expected:64
Jan 18 17:59:32 Ewer-Open-APS ACK is zero bytes!
Ben West
@bewest
Jan 19 2016 00:08
ACK is zero bytes!?
some of those mini tools are to make it easier to write scripts
my favorite is mm-stick diagnose
I often use that to check on the stick
JaysonEwer
@JaysonEwer
Jan 19 2016 00:16
Yeah, it's not happy at the moment, I was just wondering what the most graceful way is to recover it? Since i'm not exactly looping yet, I thought I might try to figure out as precisely as possible what may have caused it to get into a bad state.
pi@Ewer-Open-APS:~/Documents/openaps $ mm-stick diagnose
INFO:__main__:howdy! I'm going to take a look at your carelink usb stick.
INFO:decocare.link:Link opened serial port: Serial<id=0x76857db0, open=True>(port='/dev/serial/by-id/usb-0a21_8001-if00-port0', baudrate=9600, bytesize=8, parity='N', stopbits=1, timeout=0.5, xonxoff=False, rtscts=False, dsrdtr=False)
INFO:__main__:PROCESS:OPEN:0.109
INFO:__main__:PROCESS:START:0.817:ProductInfo:0x04
INFO:__main__:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[<ProductInfo:0x04:size(64)>] processing ProductInfo:0x04)
INFO:__main__:send_force_read: attempt 0/1 send command, read until we get something within some timeout
INFO:__main__:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[<ProductInfo:0x04:size(64)>] sending ProductInfo:0x04)
INFO:root:usb.write.len: 3
0000   0x04 0x00 0x00                             ...
DEBUG:__main__:sleeping 0.001
INFO:root:usb.read.len: 0
INFO:root:usb.read.raw:

INFO:__main__:zero length READ, try once more sleep .250
INFO:root:usb.read.len: 0
INFO:root:usb.read.raw:

CRITICAL:__main__:FAILED TO DOWNLOAD ANYTHING, after 0  expected:64
INFO:__main__:process zero length READ, try once more sleep .010
INFO:root:usb.read.len: 0
INFO:root:usb.read.raw:

ERROR:__main__:ACK is zero bytes!
INFO:__main__:failed:(0):
ACK is 0 bytes:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.21-py2.7.egg/decocare/stick.py", line 907, in <module>
    stick.open( )
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.21-py2.7.egg/decocare/stick.py", line 869, in open
    log.info('%s' % self.product_info( ))
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.21-py2.7.egg/decocare/stick.py", line 510, in product_info
    return self.query(ProductInfo)
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.21-py2.7.egg/decocare/stick.py", line 504, in query
    return self.process( )
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.21-py2.7.egg/decocare/stick.py", line 491, in process
    ack, response = self.command.respond(raw)
  File "/usr/local/lib/python2.7/dist-packages/decocare-0.0.21-py2.7.egg/decocare/stick.py", line 66, in respond
    raise AckError("ACK is 0 bytes:\n%s" % lib.hexdump(raw))
decocare.errors.AckError: ACK is 0 bytes:
Scott Leibrand
@scottleibrand
Jan 19 2016 00:21
You can't do much better than reset-usb unfortunately.
Unless you physically unplug it.
I've seen rumors it's possible to shut off just one USB port, but haven't tried that.
JaysonEwer
@JaysonEwer
Jan 19 2016 00:25
I guess this is all part of the exception handling everyone keeps talking about, right? Does it warrant further investigation at this point or do you think I should restore functionality for now. :-)
Scott Leibrand
@scottleibrand
Jan 19 2016 00:34
Just cron your reset-usb and make sure it works.
Or put it in preflight probably.
JaysonEwer
@JaysonEwer
Jan 19 2016 00:34
Ok, sounds good. Thank you .
Ben West
@bewest
Jan 19 2016 01:12
I just pushed some patches to openxshareble that might help
what I noticed is that the --experimental flag really needs to be there when running blutoothd also, so bluetoothd --experimental
Ben West
@bewest
Jan 19 2016 01:18
with these patches, I can switch back and forth between laptop and pi after forgetting device, and it seems to work first time
also tweaked the help messages on some medtronic uses
 $ openaps use ti set_temp_basal  -h
usage: openaps-use ti set_temp_basal [-h] input

 Set temporary basal rates.

positional arguments:
  input

optional arguments:
  -h, --help  show this help message and exit

  Requires json input with the following keys defined:
    * `temp` - the type of temporary rate, `percent` or `absolute`
    * `rate` - The temporary rate, in units.  Examples, 0.0, 1.2, 0.1
    * `duration` - The duration in minutes of the temporary rate.  The duration must be multiples of 30 minutes.
  Eg, actively canceling a rate:
  { "temp": "absolute", "rate": 0, "duration": 0 }
  Zero basal for half hour:
  { "temp": "absolute", "rate": 0, "duration": 30 }
  One and a half units for one hour:
  { "temp": "absolute", "rate": 1.5, "duration": 60 }
Matt Pressnall
@logichammer
Jan 19 2016 02:01
@JaysonEwer, I do a check to see if I can pull model back, if I can't, I reset-USB and then test again (it always works) and then into talking to the pump to get pumphistory. I always run reset-USB.sh right before I have a temp basal to set. Also, I don't know about you, put I had to open up permissions (777) on the file you need to write for USB to be able get that to work without having to pass in root password.
Scott Leibrand
@scottleibrand
Jan 19 2016 02:07
You only want to oref0-reset-usb if mm-stick warmup fails. If you reset every time you walk out of range and can't get model, you will likely end up with broken wifi after an hour of continuous resets.
Matt Pressnall
@logichammer
Jan 19 2016 02:13
dah! Haven't run into that yet (all of day 2.5 in) but now that that I know...refactoring is on the horizon!
I need to get familiar with all the commands available to me...
JaysonEwer
@JaysonEwer
Jan 19 2016 02:25
Thanks for the tips @logichammer @scottleibrand.
So, I just seemed to have lost my pump model in my pump.ini file. But when I poll the pump, it responds correctly, so I'm able to communicate.
```
pi@Ewer-Open-APS:~/Documents/openaps $ openaps use pump model
"515"pi@Ewer-Open-APS:~/Documents/openaps $ cat pump.ini
[device "pump"]
serial = 014560
expires = 2016-01-18T21:25:24.500355
model = 

pi@Ewer-Open-APS:~/Documents/openaps $
It is usually the inability to communicate with the pump that prevents the pump model from being populated, right?
Ok, Its back now.
I need to order my rileylink kit. :-D
I did not intervene, other than to bring my pump a bit closer to the carelink stick.
Thomas Emge
@ThomasEmge
Jan 19 2016 03:15
@bewest with the new patches for openxshareble I am now getting
  File "/home/pi/openxshareble/openxshareble/__init__.py", line 89, in __call__
    res = self.ble.run_mainloop_with(run, quit_with_loop=False)
  File "/home/pi/Adafruit_Python_BluefruitLE/Adafruit_BluefruitLE/bluez_dbus/provider.py", line 121, in _user_thread_main
    self._return_code = target()
  File "/home/pi/openxshareble/openxshareble/__init__.py", line 85, in run
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-py2.7.egg/openaps/vendors/dexcom.py", line 91, in main
    for item in self.dexcom.iter_records('EGV_DATA'):
AttributeError: 'NoneType' object has no attribute 'iter_records'
and back to Can't find UART device.
Ben West
@bewest
Jan 19 2016 03:38
ah
ok, that indicates you are not running bluetoothd with --experimental
the model in the INI comes and goes depending on the session expiry
diabeticgonewild
@diabeticgonewild
Jan 19 2016 04:09

I wanted to share some good news tonight. This afternoon, I managed to successfully solve the 1 of the 2 Markov chain Monte Carlo implementations that I need to use in order to create a "virtual patient". So far, with the static tests, so good!

So this means, that once I am done programming this, I will be off to programming a controller (which I managed to program one in 2011) in MATLAB. It will be like a blast from the past. After that, I will be interfacing with OpenAPS tools and Nightscout. So, I am almost to the point where the worst is over with.

Well, the worst is probably over with. But we will see.
I get intravenous immunoglobulin on Wednesday, which messes me up diabetes-wise for a few days, so I am going to do "the experiment" to generate the values of the parameters that represent me as a virtual patient on Monday or Tuesday. But I may not be done with the programming by then. But having the data will be good!
I uploaded it cause if I lost it I would have a heart attack!!!!!!
Dana Lewis
@danamlewis
Jan 19 2016 04:15
Hey @jmatheson Just catching up on everything today, not sure if anyone responded to you directly in channel when you asked, but a few hours ago someone had also posted a link to a suggested search in MedWow for relevant pumps and there was also a discussion on pricing. You might've seen but wanted to tag you in case you hadn't and it was still semi-easy to scroll back.
Jim Matheson
@jmatheson
Jan 19 2016 04:16
Thanks Dana, I saw the MedWow link…. that is what i had seen before but was struggling to find again.
Dana Lewis
@danamlewis
Jan 19 2016 04:18
Cool. And it's mentioned in the hardware section, but not sure if it's the specific search link or a general MW link. If it's general, feel free to put in a PR to the docs with the updated search link!
diabeticgonewild
@diabeticgonewild
Jan 19 2016 04:19
But yeah, the second Markov chain Monte Carlo is more involved and more complicated, but I have enough information to certainly solve it, especially by now, after all of the work I have put into this.
I have straightforward examples that are almost straight shots in terms of applicability. But I got this down!
But back to work!

One more thing: the controller that I am programming, the nonlinear model predictive controller.....

You will get graphs of the current, past, and present ISF and I:C ratios just like you would get of your current BG on the CGM in Nightscout---in the cloud....

Aaron Michelson
@Aaybob
Jan 19 2016 04:25
what is the report to use for "input" of set_temp_basal? I'm not finding documentation beyond the alias "loop" except use cron and be careful
Scott Leibrand
@scottleibrand
Jan 19 2016 04:26
That is on purpose, to make sure you understand what you're doing. :-)
What reports have you read about that would generate something suitable to be set as a temp basal?
Aaron Michelson
@Aaybob
Jan 19 2016 04:27
trying openaps use pumpbuilding set_temp_basal enact/suggested.json
Ok it worked
scottleibrand @scottleibrand nods
Scott Leibrand
@scottleibrand
Jan 19 2016 04:28
Did it actually set a temp?
Aaron Michelson
@Aaybob
Jan 19 2016 04:28
yes
Scott Leibrand
@scottleibrand
Jan 19 2016 04:28
cool. :-)
Aaron Michelson
@Aaybob
Jan 19 2016 04:28
Now I need to learn cron.......
I go into /etc and make a text file of name crontab or something like that?
Scott Leibrand
@scottleibrand
Jan 19 2016 04:31
That's the systemwide one. You can just do crontab -l instead, to edit the pi user's crontab file.
Sorry, crontab -e to edit. -l is list.
Aaron Michelson
@Aaybob
Jan 19 2016 04:32
yea its actually pretty simple from alias "loop" and you guys left obvious bugs in the documentation
Dana Lewis
@danamlewis
Jan 19 2016 04:33
7 stages of openAPS development: 1) oh I couldn't do it, too hard 2) well, maybe i can with help 3) I can't do this, help! 4) the docs will help, surely. 5) ugh! The docs aren't good enough! 6) wait..maybe..with the right questions, I think I can figure it out. 7) I did it!! (Something like this? :) )
LadyViktoria
@LadyViktoria
Jan 19 2016 04:37
:)
danalewis ftw
Aaron Michelson
@Aaybob
Jan 19 2016 04:42
Id put it like this: 1.)some guy is waking up every morning with a good blood sugar? I'm jeleous. 2.)there's a group that helps people make their own? I'm there. 3.) wheew I'm lucky to have most of the parts. 4.)the parts finally got here. 5.) this is kinda fun. 6.)now i know why i didn't want to program. 7.) its so exciting to make some progress and other people are doing it. 8.)nothing's working. 9.) didn't need it to be working. 10.) part of the automatic pancreas is working.
Dana Lewis
@danamlewis
Jan 19 2016 04:45
:)
Thomas Emge
@ThomasEmge
Jan 19 2016 06:01
@bewest what am I missing ?
pi@socalAPS ~/red_1 $ which bluetoothd
/usr/local/bin/bluetoothd
pi@socalAPS ~/red_1 $ cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

/usr/local/bin/bluetoothd --experimental &
exit 0
Ben West
@bewest
Jan 19 2016 06:16
oh, hmm, thay looks pretty good actually
Thomas Emge
@ThomasEmge
Jan 19 2016 06:18
I removed and added vendor and device and openaps use share iter_glucose is now stuck at
pi@socalAPS ~/red_1 $ openaps use share iter_glucose
[ /org/bluez/test ]
    org.bluez.SimAccessTest1
[ /org/bluez/hci0 ]
    org.bluez.ThermometerManager1
    org.bluez.SimAccess1
      Connected = 0
    org.bluez.GattManager1
    org.bluez.Media1
    org.bluez.HeartRateManager1
    org.bluez.CyclingSpeedManager1
    org.bluez.NetworkServer1
    org.bluez.LEAdvertisingManager1
    org.bluez.Adapter1
      Name = socalAPS
      Powered = 1
      Modalias = usb:v1D6Bp0246d0525
      DiscoverableTimeout = 180
      Alias = socalAPS
      PairableTimeout = 0
      Discoverable = 0
      Address = 5C:F3:70:75:C6:FA
      Discovering = 0
      Pairable = 1
      Class = 4194304
      UUIDs = dbus.Array([dbus.String(u'00001801-0000-1000-8000-00805f9b34fb'), dbus.String(u'0000112d-0000-1000-8000-00805f9b34fb'), dbus.String(u'0000110e-0000-1000-8000-00805f9b34fb'), dbus.String(u'00001200-0000-1000-8000-00805f9b34fb'), dbus.String(u'00001800-0000-1000-8000-00805f9b34fb'), dbus.String(u'0000110c-0000-1000-8000-00805f9b34fb')], signature=dbus.Signature('s'), variant_level=1)
[ /org/bluez ]
    org.bluez.ProfileManager1
    org.bluez.HealthManager1
    org.bluez.Alert1
    org.bluez.AgentManager1
[ /org/bluez/hci0/dev_E3_96_DA_EC_32_E9 ]
    org.bluez.Device1
      Name = DEXCOMRX
      Paired = 0
      Adapter = /org/bluez/hci0
      LegacyPairing = 0
      Alias = DEXCOMRX
      Connected = 1
      UUIDs = dbus.Array([dbus.String(u'f0aca0b1-ebfa-f96f-28da-076c35a521db')], signature=dbus.Signature('s'), variant_level=1)
      Address = E3:96:DA:EC:32:E9
      Trusted = 0
      Blocked = 0
<Adafruit_BluefruitLE.bluez_dbus.gatt.BluezGattService object at 0x75d26390>
paired? 0
pairing...
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 607, in msg_reply_handler
    *message.get_args_list()))
  File "/home/pi/Adafruit_Python_BluefruitLE/Adafruit_BluefruitLE/bluez_dbus/device.py", line 80, in pair_error
    raise RuntimeError('Exceeded timeout waiting to Pair with device! %s', error)
RuntimeError: ('Exceeded timeout waiting to Pair with device! %s', DBusException(dbus.String(u'Authentication Canceled'),))
Ben West
@bewest
Jan 19 2016 06:18
it won't go past that?
Thomas Emge
@ThomasEmge
Jan 19 2016 06:22
it took about 1-2 minutes to finish of with this
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.0.9', 'openaps-use')
  File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 745, in run_script
  File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 1670, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-py2.7.egg/openaps/cli/__init__.py", line 44, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-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.0.9-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.0.9-py2.7.egg/openaps/uses/__init__.py", line 31, in __call__
    return self.method(args, app)
  File "/home/pi/openxshareble/openxshareble/__init__.py", line 89, in __call__
    res = self.ble.run_mainloop_with(run, quit_with_loop=False)
  File "/home/pi/Adafruit_Python_BluefruitLE/Adafruit_BluefruitLE/bluez_dbus/provider.py", line 121, in _user_thread_main
    self._return_code = target()
  File "/home/pi/openxshareble/openxshareble/__init__.py", line 84, in run
    self.before_main(args, app)
  File "/home/pi/openxshareble/openxshareble/__init__.py", line 69, in before_main
    self.setup_dexcom(serial=serial)
  File "/home/pi/openxshareble/openxshareble/app.py", line 56, in setup_dexcom
    self.remote.disconnect()
  File "/home/pi/Adafruit_Python_BluefruitLE/Adafruit_BluefruitLE/bluez_dbus/device.py", line 113, in disconnect
    raise RuntimeError('Exceeded timeout waiting to disconnect from device!')
RuntimeError: Exceeded timeout waiting to disconnect from device!
if I do another run immediately after I get
pi@socalAPS ~/red_1 $ openaps use share iter_glucose
[ /org/bluez/test ]
    org.bluez.SimAccessTest1
[ /org/bluez/hci0 ]
    org.bluez.ThermometerManager1
    org.bluez.SimAccess1
      Connected = 0
    org.bluez.GattManager1
    org.bluez.Media1
    org.bluez.HeartRateManager1
    org.bluez.CyclingSpeedManager1
    org.bluez.NetworkServer1
    org.bluez.LEAdvertisingManager1
    org.bluez.Adapter1
      Name = socalAPS
      Powered = 1
      Modalias = usb:v1D6Bp0246d0525
      DiscoverableTimeout = 180
      Alias = socalAPS
      PairableTimeout = 0
      Discoverable = 0
      Address = 5C:F3:70:75:C6:FA
      Discovering = 0
      Pairable = 1
      Class = 4194304
      UUIDs = dbus.Array([dbus.String(u'00001801-0000-1000-8000-00805f9b34fb'), dbus.String(u'0000112d-0000-1000-8000-00805f9b34fb'), dbus.String(u'0000110e-0000-1000-8000-00805f9b34fb'), dbus.String(u'00001200-0000-1000-8000-00805f9b34fb'), dbus.String(u'00001800-0000-1000-8000-00805f9b34fb'), dbus.String(u'0000110c-0000-1000-8000-00805f9b34fb')], signature=dbus.Signature('s'), variant_level=1)
[ /org/bluez ]
    org.bluez.ProfileManager1
    org.bluez.HealthManager1
    org.bluez.Alert1
    org.bluez.AgentManager1
[ /org/bluez/hci0/dev_E3_96_DA_EC_32_E9 ]
    org.bluez.Device1
      Name = DEXCOMRX
      Paired = 0
      Adapter = /org/bluez/hci0
      LegacyPairing = 0
      Alias = DEXCOMRX
      Connected = 1
      UUIDs = dbus.Array([dbus.String(u'f0aca0b1-ebfa-f96f-28da-076c35a521db')], signature=dbus.Signature('s'), variant_level=1)
      Address = E3:96:DA:EC:32:E9
      Trusted = 0
      Blocked = 0
<Adafruit_BluefruitLE.bluez_dbus.gatt.BluezGattService object at 0x75ce5450>
paired? 0
pairing...
paired
[UUID('00001800-0000-1000-8000-00805f9b34fb'), UUID('00001801-0000-1000-8000-00805f9b34fb'), UUID('00001804-0000-1000-8000-00805f9b34fb'), UUID('0000180a-0000-1000-8000-00805f9b34fb'), UUID('f0aca0b1-ebfa-f96f-28da-076c35a521db')]
finding service
SERVICE <Adafruit_BluefruitLE.bluez_dbus.gatt.BluezGattService object at 0x75ccfb50>
sending auth code SM50555956
<Adafruit_BluefruitLE.bluez_dbus.gatt.BluezGattCharacteristic object at 0x75ccf9b0>
Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 4, in <module>
    __import__('pkg_resources').run_script('openaps==0.0.9', 'openaps-use')
  File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 745, in run_script
  File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 1670, in run_script
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-py2.7.egg/EGG-INFO/scripts/openaps-use", line 63, in <module>
    app( )
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-py2.7.egg/openaps/cli/__init__.py", line 44, in __call__
    self.run(self.args)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-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.0.9-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.0.9-py2.7.egg/openaps/uses/__init__.py", line 31, in __call__
    return self.method(args, app)
  File "/home/pi/openxshareble/openxshareble/__init__.py", line 89, in __call__
    res = self.ble.run_mainloop_with(run, quit_with_loop=False)
  File "/home/pi/Adafruit_Python_BluefruitLE/Adafruit_BluefruitLE/bluez_dbus/provider.py", line 121, in _user_thread_main
    self._return_code = target()
  File "/home/pi/openxshareble/openxshareble/__init__.py", line 85, in run
    output = self.main(args, app)
  File "/usr/local/lib/python2.7/dist-packages/openaps-0.0.9-py2.7.egg/openaps/vendors/dexcom.py", line 91, in main
    for item in self.dexcom.iter_records('EGV_DATA'):
AttributeError: 'NoneType' object has no attribute 'iter_records'
Thomas Emge
@ThomasEmge
Jan 19 2016 06:30
@bewest should I switch to install from source and attempt 0.0.10-dev ?
Scott Leibrand
@scottleibrand
Jan 19 2016 06:31
ok, I need a "wtf-assist" from someone with better JS debugging skills than I have, to figure out what is making the tests fail in https://github.com/openaps/oref0/tree/wtf-indeed - I added a || condition that evaluates false, but the act of evaluating it somehow messes up the test results in weird consistently random ways, depending on what exactly I evaluate. I tried simplifying the condition down, but can’t find a pattern that makes any sense
Ben West
@bewest
Jan 19 2016 06:32
@ThomasEmge for openxshareble?
curious what version of bluez you're using
Thomas Emge
@ThomasEmge
Jan 19 2016 06:33
for openaps?
Ben West
@bewest
Jan 19 2016 06:33
oh, I don't think it's an openaps issue
I think it's a bluez/bluetooth thing
at this point I'm tempted to ask you to try another ble dongle
Scott Leibrand
@scottleibrand
Jan 19 2016 06:34
FWIW, I have two BLE dongles, and they both see the NoneType thing most of the time
Ben West
@bewest
Jan 19 2016 06:35
even with the patch?
what version of bluez?
Thomas Emge
@ThomasEmge
Jan 19 2016 06:35
I have 5.37
Ben West
@bewest
Jan 19 2016 06:35
hmm, that's what I'm using
Thomas Emge
@ThomasEmge
Jan 19 2016 06:36
@bewest what dongle do you have?
Scott Leibrand
@scottleibrand
Jan 19 2016 06:40
I haven't patched yet. Probably won't get a chance to this week, as I'm leaving town in the morning and the Dexcom isn't. :-)
Ben West
@bewest
Jan 19 2016 06:57
this one is iogrear GBu521W6
Thomas Emge
@ThomasEmge
Jan 19 2016 07:02
I see I think it is using a CSR chipset vs a Broadcom that I currently have. Let's see...the amazon order is in. I'll keep you posted once the hardware comes this week.
Scott Leibrand
@scottleibrand
Jan 19 2016 07:07
How would I check what mine are? They aren't labeled usefully...
Aaron Michelson
@Aaybob
Jan 19 2016 07:10
why doesn't cron run? I've never run it before.
in my git project directory I ran crontab -e and added lines
0,3,6,9,12,15,18 to ,57 pi ~/pancreas/openaps loop
2,5,8,11,14,17 to 59 pi ~/pancreas/openaps use pump...
and then I restarted RPi2
the "*" are there too between 57 and pi
Scott Leibrand
@scottleibrand
Jan 19 2016 07:11
that's the wrong path to openaps. Do which openaps
for simplicity, that long list of times is the same as */3
Thomas Emge
@ThomasEmge
Jan 19 2016 07:11
@scottleibrand Look at the corresponding product page. It might tell you right there or you can find clues. For mine, plugable BT4LE, under the unix section they have this statement: The adapter’s USB VID is 0x0a5c (Broadcom) and PID 0x21e8.
Aaron Michelson
@Aaybob
Jan 19 2016 07:12
I was just trying everything i could think of the */3 was first but somwhere said wasn't allways an available option. Thanks
Scott Leibrand
@scottleibrand
Jan 19 2016 07:12
It works fine on pi
The other would be 2-59/3
Aaron Michelson
@Aaybob
Jan 19 2016 07:14
/user/local/bin/openaps......so /3 " " pi /usr/local/bin/openaps loop
keeps taking out "*"
Scott Leibrand
@scottleibrand
Jan 19 2016 07:15
wrap it in `
you don't specify the user (pi) if you're not doing /etc/crontab
that field is only used in the system crontab. You're editing pi's crontab, so it's implied.
Aaron Michelson
@Aaybob
Jan 19 2016 07:16
had looked up /etc/crontab as an example
Scott Leibrand
@scottleibrand
Jan 19 2016 07:16
Similar, but with that one difference.
@bewest what would I do to get raw from dexcom_reader?
Aaron Michelson
@Aaybob
Jan 19 2016 07:22
do all my paths have to start at / ?...do I need to reboot after new crontab installed?
Scott Leibrand
@scottleibrand
Jan 19 2016 07:24
No new to reboot.
* * * * * means every minute of every hour of every day of the week and every day of the month of every month.
*/3 for the first one means every 3rd minute
2-59/3 means every 3rd minute starting with minute 2
No need to reboot that is.
Aaron Michelson
@Aaybob
Jan 19 2016 07:26
I have pi's crontab I put in /3 ' ' /user/local/bin/openaps loop
2-59/3 '
* ' /user/local/bin/openaps (and the program that works by hand)
so what's wrong?
Scott Leibrand
@scottleibrand
Jan 19 2016 07:27
Try pasting that again with ` (backticks not quotes) around it.
The ~ key
Aaron Michelson
@Aaybob
Jan 19 2016 07:29
*/3 * * * * /user/local/bin/openaps loop
2-59/3 * * * * /user/local/bin/openaps use p...etc.
it works out of cron
Scott Leibrand
@scottleibrand
Jan 19 2016 07:29
Also, you should be pasting your paths, not typing them.
You have a typo in your path
and you never want a use command in cron.
you need to make a report out of it instead, and probably add it to an alias.
use leaves no trace of what it did.
report keeps an audit trail in the git history
I have an early flight tomorrow, so gonna have to leave it at that.
Good luck!
Ben West
@bewest
Jan 19 2016 08:01
@scottleibrand iter_sensor, iter_sensor_hours
Aaron Michelson
@Aaybob
Jan 19 2016 08:09
I'm just having a heck of a time trying to understand cron
Milos Kozak
@MilosKozak
Jan 19 2016 08:11
do we need openaps lol ? lucky night
blob
Aaron Michelson
@Aaybob
Jan 19 2016 08:14
i can only use shell commands
i can't use any commands that the program has used up to this point
I have to communicate directly with unix
unix goes to my home directory which is I don't know
unix assumes the command is being executed from that unknown locale
unix has a language only it and unix translators understand
and so "intend-to-bolus" provides no guides
Ben West
@bewest
Jan 19 2016 08:46
cron is a little different
someone posted theres earlier tonight

PATH=/usr/bin:/usr/local/bin:/bin:/sbin

*/5 * * * * (cd /home/pi/Documents/openaps && openaps loop 2>&1) | logger -t openaps
cron starts with an empty PATH
so copy things from echo $PATH from your normal shell there
it also starts in / by default, so that switches it to your openaps instance first
it also sends all the output into syslog
JaysonEwer
@JaysonEwer
Jan 19 2016 14:23
@bewest @Aaybob @danamlewis @scottleibrand @logichammer et al. I'm very happy to report I'm still alive! :-D Just kidding, but I've successfully made it through my first night LOOPING!!!! After 6 different devices were all alarming and my dear wife (who is already sleep deprived with an 18 month old that doesn't like to sleep much) woke up and pleaded with me to STOP THE MADDNESS!! I quickly adjusted my min_bg, max_bg and current_basal to bring my numbers above 80. I adjusted a bit too high. It's so sweet that I can just make those adjustments on my pump and the next loop they are in place. :-D I am very grateful to all involved in this project. THANK YOU. I'll be doing some more testing and tweaking, but for the first night looping, I'm very happy!!
JaysonEwer
@JaysonEwer
Jan 19 2016 14:29
@Aaybob You can do it! Unix is your friend. I've used cron before, but wouldn't call myself a cron power user. It took me few questions and a few head scratches to get things set correctly. My AHA MOMENT came when I realized the openaps binary is not in the openaps directory I had been issuing all my report commands from. It was @scottleibrand with the which openaps command that made me realize I didn't have the correct PATH set in my cron file. Once I added the /usr/local/bin/ to my PATH in my cron file it started working.
JaysonEwer
@JaysonEwer
Jan 19 2016 15:22
@MilosKozak Nice graph, btw, I think I owe you a THANK YOU also. This stuff is amazing! Thanks for all your work with nightscout.
Dragan Maksimovic
@dm61
Jan 19 2016 15:22
@JaysonEwer congratulations!
ns_myaps.PNG
so nice to see how OpenAPS is working
JaysonEwer
@JaysonEwer
Jan 19 2016 15:28
@dm61 Thanks, I'm still wrestling with getting the dev branch of nightscout setup. Where there any gotchas, lessons learned that might be helpful?
Scott Leibrand
@scottleibrand
Jan 19 2016 15:31
Nice @dm61 !
Dragan Maksimovic
@dm61
Jan 19 2016 15:36
@JaysonEwer I do not recall problems with setting Nightscout dev, but then I wasted some time to get OpenAPS to upload; I am working on updating that part of the doc now. Any particular questions?
You can see my current version of that section here: https://github.com/dm61/docs/blob/dev/docs/Automate-system/vizualization.md still work in progress, however, so do not assume everything is correct
JaysonEwer
@JaysonEwer
Jan 19 2016 15:42
Thank you @dm61. Nice graph, btw. I'm running into what appears to be a similar problem deploying as I ran into on the master branch before it was fixed. I'm wondering if the same patch was applied to dev. I haven't dug into it yet to check.
Its appears to be an npm issue.
Dragan Maksimovic
@dm61
Jan 19 2016 15:48
I just updated my fork of cgm-remote-monitor to the latest version, deployed my fork to heroku, and let heroku know to use dev instead of master. I did not even touch anything - everything worked fine. You may be using azure - my understand is that the steps are essentially the same
JaysonEwer
@JaysonEwer
Jan 19 2016 15:48
I think I may need to update my fork
yes, i'm using azure
Dragan Maksimovic
@dm61
Jan 19 2016 15:48
yes, I would update the fork first
JaysonEwer
@JaysonEwer
Jan 19 2016 15:48
I'm not a git guru, yet. ;-)
is that a pull request?
Dragan Maksimovic
@dm61
Jan 19 2016 15:49
my git skills are next to zero :smile:
JaysonEwer
@JaysonEwer
Jan 19 2016 15:50
I'll go back an refresh my memory. Thanks for the help.
Dragan Maksimovic
@dm61
Jan 19 2016 15:51
I do a PR on my own fork, then change bases, and then merge. there may be a more automated way, but I do not know.
As far as I could tell, there isn't a single button to push to update fork
JaysonEwer
@JaysonEwer
Jan 19 2016 15:53
Do I need to fork the dev separately? Or when I forked the main repository, does that also include dev and I just need to update my fork? Does that make sense?
Scott Leibrand
@scottleibrand
Jan 19 2016 15:53
Yeah, that's about the easiest way. You could bookmark the comparison URL after changing the base, but you'll still have to merge your PR.
Dragan Maksimovic
@dm61
Jan 19 2016 15:53
everything is included
JaysonEwer
@JaysonEwer
Jan 19 2016 15:53
I see a not that appears to indicate my fork is 100 commits behind. :-D
Scott Leibrand
@scottleibrand
Jan 19 2016 15:53
One PR per branch.
Another option if you have no local changes is to delete and re-fork.
That will get all branches.
JaysonEwer
@JaysonEwer
Jan 19 2016 15:55
"This branch is 100 commits behind nightscout:dev."
Dragan Maksimovic
@dm61
Jan 19 2016 15:55
oh yes, you do need to PR/change base/merge for master and dev separately
JaysonEwer
@JaysonEwer
Jan 19 2016 15:55
ok, thank you
Eric
@ecc1
Jan 19 2016 15:58
Bluetooth debugging tip: run "bluetoothctl" in another terminal window while you're trying to pair etc. Very informative.
JaysonEwer
@JaysonEwer
Jan 19 2016 16:13
success!
NOOB :D
JaysonEwer
@JaysonEwer
Jan 19 2016 16:20
Now that i've got the NS-dev up, I just need to get my pi talking to NS!!
Thanks for the help @dm61 @scottleibrand
Scott Leibrand
@scottleibrand
Jan 19 2016 16:20
:-)
Dragan Maksimovic
@dm61
Jan 19 2016 16:21
:smile:
if you wish, you may take a look at my version of that doc section, and let me know (or PR) what needs to be corrected or updated
JaysonEwer
@JaysonEwer
Jan 19 2016 16:24
Thanks @dm61 do you have the URL handy, I've got 200 tabs open. :-D Well, that may be a slight overstatement, but I have quite a few.
JaysonEwer
@JaysonEwer
Jan 19 2016 16:30
Would it make sense to link to the following for a more detailed view of the nightscout setup? That's what I was using this morning as I setup my dev site. https://github.com/nightscout/cgm-remote-monitor/tree/dev
Dragan Maksimovic
@dm61
Jan 19 2016 16:32
I think I've include that link in the top paragraph of the section
JaysonEwer
@JaysonEwer
Jan 19 2016 16:33
DOH, how did I miss that!!!
sorry
Dragan Maksimovic
@dm61
Jan 19 2016 16:34
not a problem at all :smile:
Dana Lewis
@danamlewis
Jan 19 2016 16:38
:) @jasoncalabrese
And a belated :) for @dm61 , glad it's been working well for you!
JaysonEwer
@JaysonEwer
Jan 19 2016 16:40
@dm61 Your document has spaces in your export statements. That doesn't work. It took when I removed the spaces.
Dana Lewis
@danamlewis
Jan 19 2016 16:40
And @JaysonEwer , glad first night made you happy :)
JaysonEwer
@JaysonEwer
Jan 19 2016 16:41
My wife, on the other hand, not so much. :-/ We'll get there. It will all be better in the end. Thank you once again.
Dragan Maksimovic
@dm61
Jan 19 2016 16:54
Thanks @JaysonEwer. btw, I'll be away from gitter now through the rest of the day, so I won't be replying to any comments; you can collect all for later, or you could even do a PR on my work-in-progress version of the section
JaysonEwer
@JaysonEwer
Jan 19 2016 16:55
@dm61 Have a great day.
Dragan Maksimovic
@dm61
Jan 19 2016 16:55
:smile:
JaysonEwer
@JaysonEwer
Jan 19 2016 16:56
@dm61 I'll figure out how to do a RP one of these days. I know that's part of my PAYMENT to the community.
Dana Lewis
@danamlewis
Jan 19 2016 17:00
@JaysonEwer We're happy to help when you get to that point!
Alex
@SuicidalTissue
Jan 19 2016 17:37
Can anyone tell me if it's possible to flash a wirelessthings slice of radio with rfspy since it supports OTAMP?
without a ccdebugger, sorry.
Dana Lewis
@danamlewis
Jan 19 2016 17:42
If no one jumps in here to answer, another good channel to ask that in would be ps2/rileylink
Daniel Bjørnbakk
@danibjor
Jan 19 2016 18:24
Evening :)
Dana Lewis
@danamlewis
Jan 19 2016 18:24
morning @danibjor :)
Daniel Bjørnbakk
@danibjor
Jan 19 2016 18:25
could anyone point me in the right direction to get the Enlite sensor from Medtronic configured
Dana Lewis
@danamlewis
Jan 19 2016 18:25
You should be able to read the CGM data off with the carelink stick
Daniel Bjørnbakk
@danibjor
Jan 19 2016 18:25
I just got a connection with the pump working
<- fresh in the game
Dana Lewis
@danamlewis
Jan 19 2016 18:25
woohoo!
Daniel Bjørnbakk
@danibjor
Jan 19 2016 18:26
reading trough documentation and trying to set up everything
But the docs only mention Dexcom (as far as I've come in the reading)
My bad - the pump relays the data from the sensor - to the stick
Dana Lewis
@danamlewis
Jan 19 2016 18:38
Correct - Medtronic is not super well documented beyond the fact that it's possible. @oskarpearson @tghoward @johnmales & others may be able to provide some pointers (and then maybe someone can PR to the docs for some better clarity for Medtronic users about what the basic steps are for capturing their cgm data)
Tim Howard
@tghoward
Jan 19 2016 18:43
@danibjor Yes, you can do nearly everything the same as if you were using the Dexcom, the key difference being that all the CGM calls (such as iter_glucose) all go to the pump instead. I don't have it in front of me, but I recall there are a few json tweaks that need to clean up the data before sending up to NightScout, if that's in your plans. But otherwise the process is very similar.
Oskar Pearson
@oskarpearson
Jan 19 2016 18:44
So far as I know, the data needs to be cleaned up for use by all the other openaps functions - not just for nightscout
Tim Howard
@tghoward
Jan 19 2016 18:45
hmm, yes, that might be right. :smile:
Those will clean up and reformat the pump output to make sense for openaps code
There are instructions in those repos for installing it and using it
https://github.com/bewest/openaps-example/blob/master/openaps.ini is probably the best example at the moment
danamlewis @danamlewis puts in another plug for someone PRing this to the docs :)
Daniel Bjørnbakk
@danibjor
Jan 19 2016 19:00
@oskarpearson thanks, I'll read up on those
Oskar Pearson
@oskarpearson
Jan 19 2016 19:03
Our current config's pretty nonstandard (I got something that works, but haven't touched it since)
Tim Howard
@tghoward
Jan 19 2016 19:03
@danamlewis LOL, I don't think I'm using those tools .... so that's why my data are so screwy. :smile: I've got some updating to do.
Obviously ours is nonstandard too.
Oskar Pearson
@oskarpearson
Jan 19 2016 19:03
I'll be cleaning it up sometime soon - I'll try add something to docs etc as I go. If you get there first that'd also be great!
Dana Lewis
@danamlewis
Jan 19 2016 19:04
Ha. No worries. Just know it's something people ask and isn't documented, so even if it's a sentence or two, that'd be great and we can improve even more in the future.
DOCS alert, btw - just merged from dev to master, so for many of the getting-ready-to-loopers, you can use master again.
This includes some of @dm61's good writeup on better understanding useing-oref0-tools and also some new info to help with understanding determine-basal recommendations from @scottleibrand & I.
Dana Lewis
@danamlewis
Jan 19 2016 19:09
Related: #OpenAPS = (n=1)*28!
Tim Howard
@tghoward
Jan 19 2016 19:09
Woohoo!
Daniel Bjørnbakk
@danibjor
Jan 19 2016 19:09
@danamlewis downloaded using the quick installer script last night - should I update before going on?
Dana Lewis
@danamlewis
Jan 19 2016 19:10
downloaded docs or something else? I would re-download if you're using a local copy, or otherwise just refresh any pages you have open to make sure you're getting anything that just updated. https://github.com/openaps/docs
Scott Leibrand
@scottleibrand
Jan 19 2016 19:11
This was just docs not code, so no need to re-run quick-*
Dana Lewis
@danamlewis
Jan 19 2016 19:11
There wasn't any substantial code changes, this is just docs about the setup process with better suggestions to the current process that was detailed already.
Daniel Bjørnbakk
@danibjor
Jan 19 2016 19:12
ah, tought code dev where merged over to master
Dana Lewis
@danamlewis
Jan 19 2016 19:12
no, sorry. Just docs!
Daniel Bjørnbakk
@danibjor
Jan 19 2016 19:14
Medtronic 754 seems to respond to read commands just fine
EU version
Dana Lewis
@danamlewis
Jan 19 2016 19:21
Cool. I think 554 is noted, so makes sense that 754 also works, but would be great to note in the docs if you want to PR that to the hardware page in the dev docs!
Daniel Bjørnbakk
@danibjor
Jan 19 2016 19:21
{ "name": "GlucoseSensorData", "date_type": "prevTimestamp", "_tell": 2, "sgv": 176, "date": "2016-01-19T20:21:00", "packet_size": 0, "op": 88 }
reads gluco too from the medtronic sensor :)
sweet. love this stuff you all have made :)
Ben West
@bewest
Jan 19 2016 19:23
:-)
Dana Lewis
@danamlewis
Jan 19 2016 19:23
Wahoo! h/t @bewest for the magical deco care :)
Ben West
@bewest
Jan 19 2016 19:24
thanks for the docs release, @danamlewis :-)
Dana Lewis
@danamlewis
Jan 19 2016 19:24
(So, OpenAPS = (n=1)*28, that's 16 adults using, 12 kids using <--will be able to update more easily moving forward)
Andrew Warrington
@andrew-warrington
Jan 19 2016 19:31
@danibjor I confirm my 754 EU also responds to read request.... but it won't accept commands e.g. set temp basal. Does yours accept those commands? (if so might be a difference in firmwares)
Dana Lewis
@danamlewis
Jan 19 2016 19:32
@andrew-warrington remind me, which firmware is your 754?
Andrew Warrington
@andrew-warrington
Jan 19 2016 19:33
ver 3.1E 1.1
i have a second one as well, with an older firmware which also does not accept commands... ver 2.8B
Dana Lewis
@danamlewis
Jan 19 2016 19:36
Ok. The one we have confirmed DOES work is an EU 554 of 2.6A.
So good to know 2.8 or higher does NOT work in EU x54s.
Andrew Warrington
@andrew-warrington
Jan 19 2016 19:36
well we're getting closer to finding the cut-off firmware. :D
Dana Lewis
@danamlewis
Jan 19 2016 19:37
:)
Andrew Warrington
@andrew-warrington
Jan 19 2016 19:40
even with PC Connect activated, I tried using @bewest script I found online once to try to bombard the pump with requests to see if any of them worked, and after running letting it run for a while I looked over and the interface was in Slovakian. that was the only change it accepted apparently. :) so if there is anyone Slovakian on the channel I can try to reproduce my results for you. :P although you'll already have the pump in Slovakian so that is not terribly useful for you!
Eric
@ecc1
Jan 19 2016 19:42
That's how they comply with the medical device cybersecurity guidelines :-)
Ben West
@bewest
Jan 19 2016 19:53
interestingly, FDA sent medtronic a letter saying they had so many problems producing insulin pumps, they aren't allowed to sell insulin pumps anymore
solution: sell artificial pancreas instead
that's why 530g is marketed as an AP system
Daniel Bjørnbakk
@danibjor
Jan 19 2016 20:00
"BG Target data is expected to be expressed in mg/dL. Found mmol/L in settings/bg_targets.json ."
where did I screw up? We use mmol up here
Andrew Warrington
@andrew-warrington
Jan 19 2016 20:04
@bewest OMG. is that a reported fact or grapevine stuff?
Dana Lewis
@danamlewis
Jan 19 2016 20:09
This is fun to see:
Screen Shot 2016-01-19 at 12.07.46 PM.png
Jason Calabrese
@jasoncalabrese
Jan 19 2016 20:20
Screen Shot 2016-01-19 at 12.20.13 PM.png
Paul Andrel
@stavlor
Jan 19 2016 20:21
Whats that one?
Jason Calabrese
@jasoncalabrese
Jan 19 2016 20:21
that was the Nightscout adoption, think we're at the 2 and 3rd dot for OpenAPS
Paul Andrel
@stavlor
Jan 19 2016 20:21
ah nice
Jason Calabrese
@jasoncalabrese
Jan 19 2016 20:21
or cgm in the cloud membership
Paul Andrel
@stavlor
Jan 19 2016 20:23
wow almost 16k in CGM in the cloud group on FB
Dana Lewis
@danamlewis
Jan 19 2016 20:23
heh. not apples to apples though :)
Paul Andrel
@stavlor
Jan 19 2016 20:24
true
Ben West
@bewest
Jan 19 2016 20:26
@danibjor there's a converter tool that will convert it
the units vendor
openaps device add units units
s$ openaps use units -h
usage: openaps-use units [-h] USAGE ...

optional arguments:
  -h, --help            show this help message and exit

## Device units:
  vendor openaps.vendors.units

  Units - units tool for openaps



  USAGE                 Usage Details
    bg_targets          Convert bg_targets json to preferred unit.
    insulin_sensitivities
                        Convert read_insulin_sensitivities json to preferred
                        unit.
bewest@bewest-MacBookPro:~/Documents/openaps$
Daniel Bjørnbakk
@danibjor
Jan 19 2016 20:28
@bewest thanks!
Ben West
@bewest
Jan 19 2016 20:28
$ openaps use units bg_targets -h
usage: openaps-use units bg_targets [-h] [--to {mmol/L,mg/dL}] input

    Convert bg_targets json to preferred unit.


positional arguments:
  input

optional arguments:
  -h, --help            show this help message and exit
  --to {mmol/L,mg/dL}, -t {mmol/L,mg/dL}
bewest@bewest-MacBookPro:~/Documents/openaps$
you can take your existing report, run it through that and create a second report called settings/bg-targets-mmol.json or similar
using the original settings/bg-targets.json as the input there
er
replace mmol with mg s appropriate
Daniel Bjørnbakk
@danibjor
Jan 19 2016 20:36
hm, still crashing with the same error after adding the units vendor
Ben West
@bewest
Jan 19 2016 20:37
sorry, to be more clear:
you'll need yo make two reports
the data coming from the device is in mmol
so the report for that should be renamed to be settings/bg-targets-mmol.json
then, you should run a second report using the units bg_targets settings/bg-targets-mmol.json, and save that as eg settings/bg-targets-mg.json
then, in your get-profile and other reports (saved uses), you should use the second one instead, eg settings/bg-targets-mg.json
now, if you rename the first one
you can make the second use the same name, and you won't have to change anything else
but the idea here is we then want the other tools to use the one with the converted units
Daniel Bjørnbakk
@danibjor
Jan 19 2016 20:41
ok, get the idea. Let me do some testing
Ben West
@bewest
Jan 19 2016 20:41
so the fastest thing is probably renaming the first one, or redefining it as settings/bg-targets-raw.json
or -original
I'd go with settings/bg-targets-raw.json to get the thing from the pump
then call the one with the adjusted units settings/bg-targets.json
that way we can just do it all the time
Alin Artiom Kenibasov
@ktomy
Jan 19 2016 20:45
@danibjor Personaly I wouldn't try units conversion before making the loop work as you'll see results in mg/dl in any case, all logs, all decisions, etc are based on mg/dl
and on pump it is just bg_targets
I had my pump in mmol and changed it
Ben West
@bewest
Jan 19 2016 20:45
right, the units tool converts everything to expected unit
so we should just get -raw.json from most reports
Alin Artiom Kenibasov
@ktomy
Jan 19 2016 20:45
my dexcom is still in mmol but I use NS (which is in mg/dl) in 99% of cases
Ben West
@bewest
Jan 19 2016 20:45
and then clean/adjust/unit/timezone everything
and call that the .json
if it's already in mg, the conversion does nothing
so it's safe to run always
Daniel Bjørnbakk
@danibjor
Jan 19 2016 20:46
I cannot change the pump to mg/dL - as she have read mmol for 25 years now.. would not be user friendly for the misses
Ben West
@bewest
Jan 19 2016 20:47
yeah, we support your settings
Alin Artiom Kenibasov
@ktomy
Jan 19 2016 20:47
when uploading loop results in NS you most probaby will see it in mg/dl too as it is partially jst a string ("reason" is definitly just a string)
Ben West
@bewest
Jan 19 2016 20:47
openaps will give you mg version of everything
Alin Artiom Kenibasov
@ktomy
Jan 19 2016 20:47
:) yes, 25 years of experience is a good argument... then you should assume much more testing
Ben West
@bewest
Jan 19 2016 20:48
@ktomy in NS, there is a DISPLAY_UNITS=mmol, which puts the server into mmol mode
everything gets adjusted automatically
in openaps, the units tool will adjust most things and if something is missing, we'll add it
looks like glucose is maybe missing
openaps could do with similar i18n effort, so that it uses mmol without conversion and (and displays the reasons that way also)
Alin Artiom Kenibasov
@ktomy
Jan 19 2016 20:52
ok, I'm just for step-by-step way of configuring the new system, and conversions add you a new possible point of failure, but as @bewest - 25 years of mmol reading ... for me it is a good argument.
Daniel Bjørnbakk
@danibjor
Jan 19 2016 20:56
hm, but earlier when I did a test reading from the guluco sensor, via the pump, it reported 176, witch clearly is mg/dL - even tough the settings son-file read from the pump says mmol
Ben West
@bewest
Jan 19 2016 20:56
yeah, on most systems it's a display only thing
most systems with HQ in US convert their values just for display
Daniel Bjørnbakk
@danibjor
Jan 19 2016 20:57
so the actual readings I get from the pump is in mg/dL - and the pump reports mmol in settings (json-file)
Ben West
@bewest
Jan 19 2016 20:57
yeah, welcome to diabetes technology
Daniel Bjørnbakk
@danibjor
Jan 19 2016 20:58
if I convert from mmol, a value thats mg/dL, to mg/dL, the values will be way off
Ben West
@bewest
Jan 19 2016 20:58
why
using the tool?
these files express what units they are in
the tool considers this evidence, it's harmless to run on an already converted file
$ openaps use units bg_targets monitor/bg-targets.json 
{
  "units": "mg/dL", 
  "raw": "0x01 0x00 0x6a 0x7d 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00", 
  "user_preferred_units": "mg/dL", 
  "targets": [
    {
      "i": 0, 
      "high": 125, 
      "start": "00:00:00", 
      "low": 106, 
      "offset": 0, 
      "x": 0
    }
  ], 
  "first": 1
}bewest@bewest-MacBookPro:~/Documents/openaps$
the other one is insulin_sensitivities
both bg-targets and insulin_sensitivites are inconsistent in this way, it looks like
so those two should always be saved as -raw.json and then have the units tool save it as .json for everyone, all the time
hmm, or maybe a new suite of uses to do that
Jim Matheson
@jmatheson
Jan 19 2016 21:24
Does anyone else have a Dexcom with v3.0 software? I was just playing with my 723 that I have (I replaced my broken 723 with this one just before moving back to my 722 for openAPS).
Under utilities -> Connected Devices it has several options including PC Connect, but also Meters, Remotes and Other Devices.
I have seen folks talking about PC Connect and issues with opening things up there, but are these other options new / worth exploring?
Scott Leibrand
@scottleibrand
Jan 19 2016 21:26
you mean a Medtronic pump with v3.0 firmware?
JaysonEwer
@JaysonEwer
Jan 19 2016 21:26
@jmatheson I've got a dex come with the following version:3.0.1.026
Jim Matheson
@jmatheson
Jan 19 2016 21:27
correct
Dana Lewis
@danamlewis
Jan 19 2016 21:27
It only opens the pump for RF comm for abou a minute, which isn't long enough to do anything with (that we've found so far)
Jim Matheson
@jmatheson
Jan 19 2016 21:27
i’ve got 3.0B 1.1
Scott Leibrand
@scottleibrand
Jan 19 2016 21:28
you can do things during that time, but we haven't found a way to keep it in R/W mode: you have to push buttons each time, so it's not useful for unattended looping
Jim Matheson
@jmatheson
Jan 19 2016 21:28
i see. i was hoping that was only tied to PC Connect
Scott Leibrand
@scottleibrand
Jan 19 2016 21:28
you can use PC Connect mode to test openaps commands manually if you want, though
we have never figured out a way to make the Carelink communicate as an Other Device, either
Jim Matheson
@jmatheson
Jan 19 2016 21:29
alright.
Dana Lewis
@danamlewis
Jan 19 2016 21:29
oh, @jmatheson I see. There's been some hope around some of the meters, but no one's done deep enough investigation to prove one way or another what's possible.
Scott Leibrand
@scottleibrand
Jan 19 2016 21:29
but it might be possible to figure out how to get an SDR stick to communicate with the pump as a Remote
JaysonEwer
@JaysonEwer
Jan 19 2016 21:29
My 530G has 3.0D 1.1 0B 0B
Scott Leibrand
@scottleibrand
Jan 19 2016 21:30
we don't know what the capabilities would be if we did that, though, and since we have a working solution with older pumps, there hasn't been much incentive to try to RE it
presumably one could spoof a MDT remote, but that wouldn't necessarily give you ability to temp basal, just bolus and suspend
Andrew Warrington
@andrew-warrington
Jan 19 2016 21:36
Yep I'm using the Medtronic remote and confirm it only does Bolus and Suspend. Additionally, the bolus is only via Easy Bolus, so not discrete. As Scott says it might be the case that a SDR, registered in the pump as a remote, could send other commands as well, but I highly doubt it.
Scott Leibrand
@scottleibrand
Jan 19 2016 21:44
you could build an APS out of just small easy boluses and suspend/resume if that was your only option, but that's a lot less safe than what we can do with temp basals
Ben West
@bewest
Jan 19 2016 21:44
the cc1111/yardstick will be very good
I highly recommend them
yardstick one will be easier to use, I suspect
Scott Leibrand
@scottleibrand
Jan 19 2016 21:45
any idea whether those could talk to newer pumps via "other devices" registration or similar?
Ben West
@bewest
Jan 19 2016 21:45
it can do MySentry
it can also do the sniffing needed to watch other uses of the pump that exist that we just don't know about
the more I learn, the more features I find in these things
Scott Leibrand
@scottleibrand
Jan 19 2016 21:49
we don't know of anything that remote-controls basals on a newer MDT pump, do we?
I did order my yardstick, FWIW. hopefully it will beat me home and I can play with it this weekend
Dana Lewis
@danamlewis
Jan 19 2016 21:52
your yardstick, huh? ;P
Paul Andrel
@stavlor
Jan 19 2016 21:52
heh uh-oh
Scott Leibrand
@scottleibrand
Jan 19 2016 21:52
you get insurance to buy your toys. I have to buy mine myself. ;-)
Ben West
@bewest
Jan 19 2016 21:53
we know for sure that medtronic is not fully forthcoming about how the product works
it's a black box
Dana Lewis
@danamlewis
Jan 19 2016 21:53
:+1:
Ben West
@bewest
Jan 19 2016 21:53
also, that's best-practice, so don't expect any different from the others
the wisdom imparted on me is "we focus on 'what', not 'how'"
Jason Calabrese
@jasoncalabrese
Jan 19 2016 21:55
think we might have messed up a carelink stick, getting ton of error after usb was restarted multiple times, reboots, etc
Dana Lewis
@danamlewis
Jan 19 2016 21:55
:/
Jason Calabrese
@jasoncalabrese
Jan 19 2016 21:55
probably shouldn't let it hang out of the backpack
Ben West
@bewest
Jan 19 2016 21:58
need an indestructable AP
Jason Calabrese
@jasoncalabrese
Jan 19 2016 21:59
nothing really changed, but it did go out on the playground
Dana Lewis
@danamlewis
Jan 19 2016 22:00
@jasoncalabrese wondering if you could try placing it inside the backpack on the side that his pump is? We did that yesterday when skiing (pi/carelink was inside my library pouch, that was inside the backpack placed on the side of the pump) and it worked well enough most of the time
Jason Calabrese
@jasoncalabrese
Jan 19 2016 22:02
I've done that before and it was ok, but left it out today thinking it might get a little more range
do the sticks go bad and start erroring more? maybe something else is going on
Ben West
@bewest
Jan 19 2016 22:04
did you run mm-stick diagnose?
Jason Calabrese
@jasoncalabrese
Jan 19 2016 22:04
just warmup
Ben West
@bewest
Jan 19 2016 22:04
run that and see what it says
Jason Calabrese
@jasoncalabrese
Jan 19 2016 22:04
I'll try that when they get home
Ben West
@bewest
Jan 19 2016 22:04
does it get counters
maybe unplug/replug
Jason Calabrese
@jasoncalabrese
Jan 19 2016 22:07
I did an unplug/replug while I was there
I have 1 more carelink so I can try that too
and the CC1111 and RL, have some more urgency to get them going now
could use a low temp now, but it's not going to happen :(
Jim Matheson
@jmatheson
Jan 19 2016 22:14
@scottleibrand @andrew-warrington I think that makes sense. they probably built in sw restrictions depending on device type added (meter vs remote vs carelink)
Alin Artiom Kenibasov
@ktomy
Jan 19 2016 22:17
hm, so I should think about buying one more carelink stick
does someone has a eu carelink for sale?
dhermanns
@dhermanns
Jan 19 2016 22:19
Hi Everybody! My son has a 554 with Firmware 2.8B. Is there no way to set a Bolus or Basal Rate using OpenAps?
Rachel Sandlain
@audiefile
Jan 19 2016 22:21
Is there a "pc connect" option under utilities on the pump?
Dana Lewis
@danamlewis
Jan 19 2016 22:28
@dhermanns I don't think the 2.8B, per @andrew-warrington's earlier testing, will write commands to the pump :(. It'll read data, but can't write and thus have a loop.
@audiefile yes, under "Connect Devices", if it's NOT compatible with openaps, aka newer ones
Paul Andrel
@stavlor
Jan 19 2016 22:29
yeah its under utilities->connect devices on newer fw pumps
Ben West
@bewest
Jan 19 2016 22:30
still very very useful for people to a.) start getting used to openaps, b.) monitoring the info, unifying all d-data in a real-time interface and c.) learning how the predict tools will work, doing open-loop as testing/prep/homework
Jason Calabrese
@jasoncalabrese
Jan 19 2016 22:36
yeah, the school nurses were happy to not need to use careportal as much
hoping it will work tomorrow
and tonight
Dana Lewis
@danamlewis
Jan 19 2016 22:43
Do they not need careportal as much because it's reading carbs from the pump?
Scott Leibrand
@scottleibrand
Jan 19 2016 22:44
and boluses
@jasoncalabrese will be interesting to see if you also see a reduction in the number of times nurses have to do corrections and rescue carbs
Jason Calabrese
@jasoncalabrese
Jan 19 2016 22:48
in the past they entered everything, they'll only enter carb corrections now
and hopefully we'll be able to avoid most of those
the rig just got home
Jason Calabrese
@jasoncalabrese
Jan 19 2016 22:54
other stick seems to be working
Ben West
@bewest
Jan 19 2016 23:06
plus, it's just fine to distribute a complete working rig that is monitor/real-time
it's the dosing stuff that kicks the risk up
Jason Calabrese
@jasoncalabrese
Jan 19 2016 23:59
@bewest see anything interesting in that gist with the mm-stick diagnose results?