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

29th
May 2015
diabeticgonewild
@diabeticgonewild
May 29 2015 02:46
So for the RileyLink has anyone besides @StephenBlackWasAlreadyTaken and @ps2 tested it out? What is the range on it? I intend on getting the PCB stencil and soldering soon.
Pete Schwamb
@ps2
May 29 2015 05:34
wow!
This message was deleted
Matthias Granberry
@mgranberry
May 29 2015 05:39
I don't think the technology is getting buried :)
Pete Schwamb
@ps2
May 29 2015 05:42
Definitely not.
Jason Calabrese
@jasoncalabrese
May 29 2015 08:31
the cob plugin we've added to dev is acting really weird
@scottleibrand do you remember the logic for this: ```
      if (delay > minutesleft) {
        initialCarbs = parseInt(treatment.carbs);
      }
      else {
        initialCarbs = parseInt(treatment.carbs) + minutesleft * carbs_min;
      }
seems there's something that counters it, that didn't get ported over to the new plugin
Jason Calabrese
@jasoncalabrese
May 29 2015 09:13
created nightscout/cgm-remote-monitor#612 to try figuring our the issue
Fokko Driesprong
@Fokko
May 29 2015 12:36
Hi guys, It's me again. I have a working connection to the insulin pump as I am able to get the type number:
PUMP MODEL: ReadPumpModel:size[64]:data:'754'
{'radio': {'errors.crc': 0,
           'errors.naks': 0,
           'errors.sequence': 0,
           'errors.timeouts': 3,
           'packets.received': 6L,
           'packets.transmit': 9L},
 'usb': {'errors.crc': 0,
         'errors.naks': 5,
         'errors.sequence': 0,
         'errors.timeouts': 0,
         'packets.received': 102L,
         'packets.transmit': 107L}}
Fokko Driesprong
@Fokko
May 29 2015 12:47
Hi Guys, I have the scripts working and I am able to communicate with the pump. I have ordered a RileyLink pcb and will dust off the hot-air station. Hope that the 0402 won't be too small :smile:
@bewest I have the committed the logs at https://github.com/Fokko/decoding-carelink/tree/master/logs
Matthias Granberry
@mgranberry
May 29 2015 14:02
@ps2 I forgot to mention including a diode to drop the voltage below the input voltage on the part for a low-power switchable voltage divider. You definitely need it if battery voltage is higher than the input voltage, because there is likely an ESD protection diode on the GPIO pin that will burn up and later fry the part if there isn't a very significant resistance on the input
Pete Schwamb
@ps2
May 29 2015 14:46
@mgranberry on the input pin I’m using as the ground leg of the voltage divider?
diabeticgonewild
@diabeticgonewild
May 29 2015 14:50
Those on Medicare can't use the Asante Snap pump which is an issue for whoever got it. The faces or whatever need to be replaced and the 300unit pen cartridges can't be reimbursed by Medicare. That will be a problem for Bigfoot
I don't mean to be negative but it's unfortunate for everyone given the promise that Bigfoot offers
Matthias Granberry
@mgranberry
May 29 2015 15:14
@ps2 the voltage going into the port needs to be below VCC or whatever it is for the technology uses in the microcontroller. If it is set as an input, it will float at whatever the voltage drop is across the resistor. At essentially 0 current, that won't be much, so it will float at the battery voltage until it is set to be an output (unless you activate the 20kOhm pullup/pulldown)
@ps2 if that voltage is higher than VCC (it is), that can cause problems
Pete Schwamb
@ps2
May 29 2015 15:16
Yeah, I understand that, but I didn’t think that would happen, so I’m confused. Probably need to do up a schematic to clarify. If I get that far, I’ll let you know. I’m still focused on the SW side for a while.
diabeticgonewild
@diabeticgonewild
May 29 2015 15:17
0 current essentially occurs at a node when there is a capacitor on it
In the steady state (time invariant)
Matthias Granberry
@mgranberry
May 29 2015 15:18
you can get away without dropping the voltage down on most microcontrollers if you use a very high resistance. I did a zero crossing detector for timing off the power mains by using a 5MOhm resistor with no additional overvoltage protection. Lots of the devices are still out in the wild.
diabeticgonewild
@diabeticgonewild
May 29 2015 15:23
A capacitor probably should always be wired with a resistor in series. A resistor is always a passive device so it will always have a voltage to it and will be in the same node as the capacitor and therefore due to kirchoff's voltage law the capacitor must be of less voltage than Vcc due to it being wired with a resistor in series and therefore on the same node
Matthias Granberry
@mgranberry
May 29 2015 15:30
@ps2 https://www.wolframalpha.com/input/?i=voltage+drop+across+a+100kilohm+resistor+at+1+microamps There are a few ways to handle this. A diode or two in series will "drop" the incoming voltage from .6 to 1.2v depending on the diode to bring it down to a "safe" value and consume no "off" power. You could also activate the internal pulldown on the microcontroller which will activate a 20kOhm resistor to ground that could be used to drop that voltage too, but not at zero power
not sure if ADC ports have an internal PD, but it might be possible to use that instead of one of the external resistors, but that's almost getting silly.
Scott Leibrand
@scottleibrand
May 29 2015 16:30
@jasoncalabrese that code you pasted is just for carb stacking. if the old carbs are gonna run out before the new carbs hit (20m or so), then the old ones don't matter. otherwise, stack them.
Jason Calabrese
@jasoncalabrese
May 29 2015 16:47
@scottleibrand checkout the PR somehow the example 110g's is calculated to be 128g 1 hour and 45 minutes after the 100g nightscout/cgm-remote-monitor#612
Not an OpenAPS cause it uses diffeqs but you could SSH back and forth between the OpenAPS dev tools on the Pi with JSON files
Using bash shell scripts
Scott Leibrand
@scottleibrand
May 29 2015 19:06
@jasoncalabrese ok, I'll try to take a look this weekend. ping me later to remind me if I don't get to it.
diabeticgonewild
@diabeticgonewild
May 29 2015 22:37
So, I think the first part of my project has to be open source. I don't think I can program it all in MATLAB on my own, as there is a part that I am completely lost on and there's little/no documentation on it. So, generating the "virtual copy of a T1D" likely is going to be open source, via WinBUGS
It's really not that big of a deal, cause I have a bunch of the code prepared in MATLAB, so it's just a matter of mostly laying it out in WinBUGS and the package WBDiff. I have integrated and solved differential equations through programming so I'm not too worried. I don't need Simulink to do it spatially. I can do it linearly on the programming interface.
For the second step of my project, I can use an extension in MATLAB with some mods to WinBUGS to create the controller. Of course the controller must run in MATLAB and SimuLink. That's pretty much a given.
I am not really being indecisive, as this was what the paper called for initially. I am just very comfortable with MATLAB, but I am going to have to use something else, as the intrinsic gaussian conditional autoregression is hard to figure out doing markov chain monte carlo (in the form of Metropolis-Hastings sampling) and random walks.
diabeticgonewild
@diabeticgonewild
May 29 2015 22:48
I guess OpenBUGS is an option too, as it has the extension GeoBUGS and a differential equation solver. It is the updated version of WinBUGS I believe...
OpenBUGS, with respect to open source, is the better option, if it's viable
Plus it's platform independent