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

7th
Jul 2016
Paul Martin
@Spazholio
Jul 07 2016 00:00
Hmmm…I just gave myself a bolus, and OpenAPS has updated several times since then, and it’s not showing.
Ben West
@bewest
Jul 07 2016 00:00
OS doesn't matter, although the way that ubilinux packages a tool to read the data may differ from yocto, it's standard to provide it through a file in /proc
or /sys
Paul Martin
@Spazholio
Jul 07 2016 00:00
There we go. Just had to mention it in public, and it updated. Thanks, all!
Scott Leibrand
@scottleibrand
Jul 07 2016 00:01
@bfaloona can you go figure out where in the docs info about percent vs. absolute mode should be added, and PR a fix?
I'm thinking the troubleshooting section and/or the initial pump setup section
Chris Oattes
@cjo20
Jul 07 2016 00:08
@burgertime14 There is a chip on the edison board itself, called the PMIC (Power Management IC), it does all sorts of wonderful things. It is connected to the CPU via an I2C link. The kernel can send commands over that I2C link and get a number back for the voltage. In Yocto, it provides an interface to that number through /sys/devices/platform/pmic_ccsm/battery_level, which ubilinux does not provide.
Brett
@burgertime14
Jul 07 2016 00:17
@cjo20 Thanks for that, the thread I was reading was a bit old, but it was an Intel engineer saying that it was't possible w/o an ADC. If it is possible in Yocto, it is possible in Ubilinux, would possibly require a kernel rebuild, but there is no reason that it shouldn't be possible
I will keep looking
Chris Oattes
@cjo20
Jul 07 2016 00:20
The i2c device is /sys/devices/i2c-8
Martin Haeberli
@mhaeberli
Jul 07 2016 00:44
@bewest - using ns as cgm source, not local cgm, how do I do the equivalent of :
openaps use cgm oref0_glucose --hours 2.0
?
Chris Oattes
@cjo20
Jul 07 2016 00:47
@burgertime14 I think it might be something to do with /sys/devices/platform/bcove_acd
Martin Haeberli
@mhaeberli
Jul 07 2016 00:51

@bewest also, using only NS as data source (no local pump / cgm):
openaps use ns shell format-recent-history-treatments monitor/pump-history.json model.json
results in:
```Could not parse pumphistory: { [Error: Cannot find module '/home/ubuntu/Documents/edenghOpenAPS/monitor/pump-history.json'] code: 'MODULE_NOT_FOUND' }
No JSON object could be decoded

Traceback (most recent call last):
File "/usr/local/bin/openaps-use", line 6, in <module>
exec(compile(open(file).read(), file, 'exec'))
File "/home/ubuntu/openaps/bin/openaps-use", line 63, in <module>
app( )
File "/home/ubuntu/openaps/openaps/cli/init.py", line 51, in call
self.run(self.args)
File "/home/ubuntu/openaps/bin/openaps-use", line 58, in run
reporter(output)
File "/home/ubuntu/openaps/openaps/reports/reporters/init.py", line 33, in call
self.blob = self.serialize(data)
File "/home/ubuntu/openaps/openaps/reports/reporters/init.py", line 31, in serialize
return self.method.serialize(render(data), self)
File "/home/ubuntu/openaps/openaps/vendors/process.py", line 56, in prerender_json
return json.loads(data)
File "/usr/lib/python2.7/json/init.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
```

Could not parse pumphistory:  { [Error: Cannot find module '/home/ubuntu/Documents/edenghOpenAPS/monitor/pump-history.json'] code: 'MODULE_NOT_FOUND' }
No JSON object could be decoded

Traceback (most recent call last):
  File "/usr/local/bin/openaps-use", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/ubuntu/openaps/bin/openaps-use", line 63, in <module>
    app( )
  File "/home/ubuntu/openaps/openaps/cli/__init__.py", line 51, in __call__
    self.run(self.args)
  File "/home/ubuntu/openaps/bin/openaps-use", line 58, in run
    reporter(output)
  File "/home/ubuntu/openaps/openaps/reports/reporters/__init__.py", line 33, in __call__
    self.blob = self.serialize(data)
  File "/home/ubuntu/openaps/openaps/reports/reporters/__init__.py", line 31, in serialize
    return self.method.serialize(render(data), self)
  File "/home/ubuntu/openaps/openaps/vendors/process.py", line 56, in prerender_json
    return json.loads(data)
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Brett
@burgertime14
Jul 07 2016 01:05
@cjo20 I am still trying to track down the driver to get this fully functional. It appears that there was an update to Yocto around 9/15 that added this functionality, hoping someone has pulled the code from the Yocto base...
Martin Haeberli
@mhaeberli
Jul 07 2016 01:08
@bewest, @ openaps gather-clean-data returns openaps: 'gather-clean-data' is not an openaps command. See 'openaps --help’. - yes, I’m using dev branch of docs. help / advice welcome
Chris Oattes
@cjo20
Jul 07 2016 01:17
Does anyone have an edison running on a battery with the intel breakout that isn't currently fully charged?
Brett
@burgertime14
Jul 07 2016 01:17
yes
Chris Oattes
@cjo20
Jul 07 2016 01:18
can you check the voltage?
Brett
@burgertime14
Jul 07 2016 01:18
with a multimeter?
Chris Oattes
@cjo20
Jul 07 2016 01:18
yes
Brett
@burgertime14
Jul 07 2016 01:18
sure
Chris Oattes
@cjo20
Jul 07 2016 01:19
let me know when you've done it and I'l give you a command to try :)
Brett
@burgertime14
Jul 07 2016 01:22
3.959
Chris Oattes
@cjo20
Jul 07 2016 01:23
ok, I'm hoping that this will give a result of 900
Brett
@burgertime14
Jul 07 2016 01:23
echo 900 ?
:)
Chris Oattes
@cjo20
Jul 07 2016 01:23
sudo -i
 echo 0x1 > /sys/devices/platform/bcove_adc/basincove_gpadc/channel && echo 1 > /sys/devices/platform/bcove_adc/basincove_gpadc/sample && cat /sys/devices/platform/bcove_adc/basincove_gpadc/result
something is majorly wrong if echo 900 doesn't give 900 :P
Brett
@burgertime14
Jul 07 2016 01:24
990
Chris Oattes
@cjo20
Jul 07 2016 01:24
aww
too high
Brett
@burgertime14
Jul 07 2016 01:25
maybe not, lemme try again...
Chris Oattes
@cjo20
Jul 07 2016 01:27
can you paste the output if you change the first echo to 0xFF?
Brett
@burgertime14
Jul 07 2016 01:28
so I have a adafruit powerboats 1000c in front of my edison, which make the 990 make sense, I think
Chris Oattes
@cjo20
Jul 07 2016 01:28
ahh
if I plug my otg in to my PC, it jumps to 995, if I unplug it, it drops to 907
my battery is at 4.02v
(4.02/4.5) * 1024 = 914
Any chance of copying out the output of
echo 0x1FF > /sys/devices/platform/bcove_adc/basincove_gpadc/channel && echo 1 > /sys/devices/platform/bcove_adc/basincove_gpadc/sample && cat /sys/devices/platform/bcove_adc/basincove_gpadc/result
Brett
@burgertime14
Jul 07 2016 01:32
root@ubilinux:/home/bhiscock# echo 0x1 > /sys/devices/platform/bcove_adc/basincove_gpadc/channel && echo 1 > /sys/devices/platform/bcove_adc/basincove_gpadc/sample && cat /sys/devices/platform/bcove_adc/basincove_gpadc/result
sample_result[0] = 988
sample_result[1] = 0
sample_result[2] = 0
sample_result[3] = 0
sample_result[4] = 0
sample_result[5] = 0
sample_result[6] = 0
sample_result[7] = 0
sample_result[8] = 0
seems like it might be voltage to board, might be useful to issue a shutdown if it drops too much, but it does seem to bounce around some
Brett
@burgertime14
Jul 07 2016 01:40
@cjo20 here is a sample of data:while true; do echo 0x1 > /sys/devices/platform/bcove_adc/basincove_gpadc/channel && echo 1 > /sys/devices/platform/bcove_adc/basincove_gpadc/sample && cat /sys/devices/platform/bcove_adc/basincove_gpadc/result | grep "sample_result[0]"; sleep 1; done
sample_result[0] = 988
sample_result[0] = 983
sample_result[0] = 984
sample_result[0] = 984
sample_result[0] = 987
sample_result[0] = 984
sample_result[0] = 984
sample_result[0] = 986
sample_result[0] = 989
sample_result[0] = 983
sample_result[0] = 987
sample_result[0] = 986
sample_result[0] = 991
sample_result[0] = 986
Spazholio @Spazholio is following with rapt attention and cautious optimism.
Scott Leibrand
@scottleibrand
Jul 07 2016 01:41
:+1:
Paul Martin
@Spazholio
Jul 07 2016 01:41
I also have an Edison rig with an Adafruit 1000c, if you need a second (third?) data set.
Chris Oattes
@cjo20
Jul 07 2016 01:42
@Spazholio I'd prefer it if the battery was directly connected to the board tbh
Paul Martin
@Spazholio
Jul 07 2016 01:43
Does it have to be Ubilinux? Or can it be Yocto?
Because I’ve got another one….wait, I don’t have another battery. Curse it all. Someone hook me up with a battery, wouldja? In the next 10 mins would be great, kthx.
Oh wait, I do. I have the one I bought for my RileyLink. Ok, so…can it be Yocto?
Chris Oattes
@cjo20
Jul 07 2016 01:45
I don't know
Paul Martin
@Spazholio
Jul 07 2016 01:45
Well…one way to find out, I suppose...
Brett
@burgertime14
Jul 07 2016 01:47
I can switch mine, to J2, right? what is the polarity?
Chris Oattes
@cjo20
Jul 07 2016 01:47
negative closer to the middle of the board
tazitoo
@tazitoo
Jul 07 2016 01:49
'''
sample_result[0] = 924
sample_result[1] = 0
sample_result[2] = 0
sample_result[3] = 0
sample_result[4] = 0
sample_result[5] = 0
sample_result[6] = 0
sample_result[7] = 0
sample_result[8] = 0
Chris Oattes
@cjo20
Jul 07 2016 01:49
` not '
tazitoo
@tazitoo
Jul 07 2016 01:50
edison + mini breakout + fully charged lipo
(sorry no voltmeter available)
Paul Martin
@Spazholio
Jul 07 2016 01:52

The output of

echo 0x1FF > /sys/devices/platform/bcove_adc/basincove_gpadc/channel && echo 1 > /sys/devices/platform/bcove_adc/basincove_gpadc/sample && cat /sys/devices/platform/bcove_adc/basincove_gpadc/result

is

sample_result[0] = 920
sample_result[1] = 0
sample_result[2] = 510
sample_result[3] = 467
sample_result[4] = 0
sample_result[5] = 0
sample_result[6] = 340
sample_result[7] = 0
sample_result[8] = 0

while running Yocto. No clue how charged this battery is.

(Edison + intel breakout + ??? charged LiPo + Yocto)
Brett
@burgertime14
Jul 07 2016 01:54
I can't get the edison to power with the battery connected directly to J2...odd
japrobo
@japrobo
Jul 07 2016 01:54
@mhaeberli do you have the gather-clean-data alias created?
Brett
@burgertime14
Jul 07 2016 01:54
@cjo20 where did you get the 0x1FF from?
Chris Oattes
@cjo20
Jul 07 2016 01:56
@burgertime14 It's a bitmask
Brett
@burgertime14
Jul 07 2016 01:57
@cjo20 assuming that you are addressing a specific register?
Chris Oattes
@cjo20
Jul 07 2016 01:57
It's a bitmask of the channels to read on the ADC
I found it in some source code for the bcove driver
Brett
@burgertime14
Jul 07 2016 01:58
awesome,that was what I was looking for
tazitoo
@tazitoo
Jul 07 2016 01:58
apt-get install i2c-tools
# i2cdetect -l
i2c-1   i2c             i2c-designware-1                        I2C adapter
i2c-2   i2c             i2c-designware-2                        I2C adapter
i2c-3   i2c             i2c-designware-3                        I2C adapter
i2c-4   i2c             i2c-designware-4                        I2C adapter
i2c-5   i2c             i2c-designware-5                        I2C adapter
i2c-6   i2c             i2c-designware-6                        I2C adapter
i2c-7   i2c             i2c-designware-7                        I2C adapter
i2c-8   i2c             PMIC I2C Adapter                        I2C adapter
might take some configuration to get i2c configured to access i2c-8, but then communication might be workable (without knowing bit masks...)
Chris Oattes
@cjo20
Jul 07 2016 02:00
wget http://cjo20.net/cjo20_battery_voltage
chmod a+x cjo20_battery_voltage
sudo ./cjo20_battery_voltage
Eric
@ecc1
Jul 07 2016 02:02
Another approach would be to just run the Yocto kernel with the Ubilinux userland. I tried that recently to see if it worked, and it seemed to, but I didn't test it very thoroughly. You can do it all via temporary changes to the u-boot variables.
Chris Oattes
@cjo20
Jul 07 2016 02:03
@tazitoo There isn't documentation available for the the device the i2c connects to, so we don't know how to read it
If I'm right then the method I've found uses a proper driver to get the same information back
Paul Martin
@Spazholio
Jul 07 2016 02:05
Any bash commands you can think of that are quick and computationally expensive? Like a fork bomb, but less…fork-bomb-y? I want to do something that I know will run the battery down a bit...
tazitoo
@tazitoo
Jul 07 2016 02:05
How about this on using the i2c tools to read the registers:
https://m2aglabs.com/2015/04/10/i2c-interfacing-on-intel-edison/
Paul Martin
@Spazholio
Jul 07 2016 02:05
I’m at around the high 89% mark, but the bit after the decimal is fluctuating a bit. Usually upward.
tazitoo
@tazitoo
Jul 07 2016 02:06
root@ernie:/home/brian/src# ./cjo20_battery_voltage 
***EXPERIMENTAL!
I've not yet found anyone without a mostly full battery to test this yet.
It could be accurate, it could be garbage.
Raw value: 913
Battery voltage: 4.01v (89.16%)
Paul Martin
@Spazholio
Jul 07 2016 02:06
(but I imagine this isn’t 100% precise and that’s to be expected)
tazitoo
@tazitoo
Jul 07 2016 02:07
Would be good to check how it drops...doesn't have to be perfect, just usable (or be able to calibrate it)
Chris Oattes
@cjo20
Jul 07 2016 02:07
Mine has drifted down from 912 to 901 over the last 30 minutes or so
I'm going to leave it going overnight and see what it does
tazitoo
@tazitoo
Jul 07 2016 02:08
Mostly interested in the cut-off value...when would you stop/shutdown if powered by a li-po? 3.5V?
Chris Oattes
@cjo20
Jul 07 2016 02:08
not sure, I thought the edison had a built-in cutoff
tazitoo
@tazitoo
Jul 07 2016 02:09
I seem to have drastically diminished the longevity of a couple of lipo's by having my edison shut off...
@cjo20 - thanks for the current voltage utility! Ciao for now...
Chris Oattes
@cjo20
Jul 07 2016 02:11
@tazitoo Thank me if it turns out it works :P
Paul Martin
@Spazholio
Jul 07 2016 02:12
root@edison:~# battery-voltage 
Battery Voltage = 4030 mV
Battery level = 72%
compared to
root@edison:~# ./cjo20_battery_voltage 
***EXPERIMENTAL!
I've not yet found anyone without a mostly full battery to test this yet.
It could be accurate, it could be garbage.
Raw value: 919
Battery voltage: 4.04v (89.75%)
root@edison:~#
Chris Oattes
@cjo20
Jul 07 2016 02:13
That looks promising
I could cope with being 10mV out :P I'll have to look at how they calculate %
Paul Martin
@Spazholio
Jul 07 2016 02:14
I was about to say, the percentage is a bit off. =)
Either way, kudos to you man.
Chris Oattes
@cjo20
Jul 07 2016 02:15
I just updated the file to get rid of the crud at the start
Chris Oattes
@cjo20
Jul 07 2016 02:21
if anyone isn't there, in mmeowlink,
```
pancreas2:/# sudo ./cjo20_battery_voltage
Raw value: 874
Battery voltage: 3.84v (85.35%)
pancreas2:/# battery-voltage
Battery Voltage = 3840 mV
Battery level = 37%
pancreas2:/#
:tada:
Ben West
@bewest
Jul 07 2016 02:34
nice
so, that's the missing piece to prevent git corruption btw...
to prevent git corruption, we need to shut down when battery is critically low
Brett
@burgertime14
Jul 07 2016 02:46
with the 1000c, it should stay relatively constant until it is about to die, I will through the output to a log file and see if we can get an indicator to act on to avoid corruption
*throw
Paul Martin
@Spazholio
Jul 07 2016 02:46
For those not in the mmeowlink room, the tool doesn’t work on my production rig, and I’m using a 1000c.
Matt Walker
@walker0
Jul 07 2016 02:47
The 1000c has a low battery output pin, you could connect it to a gpio pin with a resistor and poll that
Tim Mecklem
@tmecklem
Jul 07 2016 02:59
Ive been reading through the archives. Has anyone used BLE on the pi 3 to communicate with Dexcom G4 platinum receiver with share?
Scott Leibrand
@scottleibrand
Jul 07 2016 03:00
I believe openxshareble works on a Pi. Not sure if anyone's done it with a pi3's built-in BT vs. a separate dongle.
Paul Martin
@Spazholio
Jul 07 2016 03:02
I had to use a separate dongle when I got it working.
Chris Oattes
@cjo20
Jul 07 2016 03:03
g'night all
Brett
@burgertime14
Jul 07 2016 03:07
as much fun as all this hardware nerd time has been, I have to brag about my results, range for the day is 72-155, maybe a best ever (or since 1992).
Sarah Hodson Grady
@shgrady
Jul 07 2016 03:08
@burgertime14 :sparkles:
Paul Martin
@Spazholio
Jul 07 2016 03:09
Nice!
Dana Lewis
@danamlewis
Jul 07 2016 03:17
:confetti_ball: @burgertime14
Martin Haeberli
@mhaeberli
Jul 07 2016 03:41
@japrobo - no - I’ll give that a try
Sarah Hodson Grady
@shgrady
Jul 07 2016 03:42
@bewest previously told me to focus on one method of getting BG values, I chose NS, now I am getting errors when doing gather-clean-data because it is grabbing raw-cgm/glucose-raw.json which I had not built, do I want to edit the alias now, or edit the report later(setting up now for NS)?
Martin Haeberli
@mhaeberli
Jul 07 2016 03:44
@japrobo - alias gather-clean-data to what ?
Sarah Hodson Grady
@shgrady
Jul 07 2016 03:51
This message was deleted
This message was deleted
Ben West
@bewest
Jul 07 2016 08:31
@shgrady hmm, yeah, you can do something like openaps use ns shell oref0_glucose tz count=10
and put that as the report
openaps report add raw-cgm/glucose-raw.json JSON ns shell oref0_glucose tz count=10
Chris Oattes
@cjo20
Jul 07 2016 08:54
@bewest could you take a look at openaps/oref0#150 when you've got a few seconds? (I think that's literally all it should take)
Chris Oattes
@cjo20
Jul 07 2016 09:14
I was asked this in PM last night by @iananders but didn't see it at the time. I tend to just build from git checkouts, could someone that knows what they're doing answer properly?
@iananders: how can i update from oref0 git? that sounds like a useful thing to understand as the code gets cleaned up/improved over time
thanks so much for the guidance so far
@iananders: would    `sudo npm install -g git://github.com/openaps/oref0.git'#dev' `that update my current instance? i built it step-by-step via the docs previously..
Paul Davis
@SirBinky
Jul 07 2016 12:32
Hi everyone, I'm going through the new openaps to nightscout guide "https://openaps.readthedocs.io/en/latest/docs/walkthrough/phase-1/openaps-to-nightscout.html" I've downloaded the aliases and I'm making sure i've got report names that match Bewest's. I'm confused the raw json's: raw-pump/clock-raw.json monitor/clock.json are these not the same thing?
same with "monitor-pump-history = report invoke raw-pump/pump-history-raw.json monitor/pump-history.json"
Chris Oattes
@cjo20
Jul 07 2016 12:41
The -raw are reports straight from the pump, the non-raw version have been processed in some way
Paul Davis
@SirBinky
Jul 07 2016 12:46
ah ok
so what command do i use to get the raw clock data?
Chris Oattes
@cjo20
Jul 07 2016 12:46
If you look at the openaps.ini, you can see what all of the reports do
Paul Davis
@SirBinky
Jul 07 2016 12:47
i don't have the report cause i'm using bewest's aliases
so i'm working backwards from the alias saying you need these reports, to me then adding them so none of the alias's fail
Chris Oattes
@cjo20
Jul 07 2016 12:48
ah, ok
Paul Davis
@SirBinky
Jul 07 2016 12:48
i've got read_clock for monitor/clock.json
Chris Oattes
@cjo20
Jul 07 2016 12:48
I think that's in the docs somewhere, but I can't remember where
read_clock is probably for the raw version
I think it's referred to as clock-zoned in the docs
The tz device generates clock.json from clock-raw.json
Paul Davis
@SirBinky
Jul 07 2016 12:49
i've got a print out of the pump --help with all the commands
That talks you though some of it. In that document, where it refers to clock.json, that's clock-raw.json in bewests script, and clock-zoned.json is equivalent to your clock.json, If I've understood correctly
I've got to head back to work now
Paul Davis
@SirBinky
Jul 07 2016 12:53
ah ok yeah i get it
thanks
that's much clearer!
Chris Oattes
@cjo20
Jul 07 2016 14:54
Does anyone know where to get ubilinux kernel headers from?
Chris Oattes
@cjo20
Jul 07 2016 15:37
ubilinux is starting to annoy me now. There isn't an obvious way to get the kernel headers -_-
Paul Martin
@Spazholio
Jul 07 2016 15:48
https://docs.google.com/document/d/1y9bV2iU1QPFvuh_L5C85-ZlfTSO5j7Fh6tvv6t4Rgc4/edit#heading=h.sbxzbkkqrtna <-- am I correct in the assumption that this isn't quite what you were looking for?
Sarah Hodson Grady
@shgrady
Jul 07 2016 15:49
@bewest Thanks, I was goofing the tz part.
Brett
@burgertime14
Jul 07 2016 16:09
@cjo20 Emulex does not appear to sharing the procedure to build or their source, w/o the whole source, it will be a nightmare to recompile the kernel (which is what I am assuming you want to do)
might be time to try something like Arch Linux, it appears that it may be working on Edison now...(looks like since Jan '16)
Paul Martin
@Spazholio
Jul 07 2016 16:12
I've emailed Emutex. We'll see what they say, even though I suspect we already know.
Which makes VERY little sense to me. If you're abandoning the project, why NOT release what you have so tinkerers can continue on?
Chris Oattes
@cjo20
Jul 07 2016 16:17
@burgertime14 I don't want to rebuild the kernel, just a module. I've got it working
I'm going to make a kernel module that will allow users (not requiring sudo) to do cat /sys/kernel/edison_voltage/voltage and cat /sys/kernel/edison_voltage/percentage and get the relevant values returned
GabeA23
@GabeA23
Jul 07 2016 16:19
Hey guys... basic question here. What does the "remainder" argument do in OpenAPS reports?
Chris Oattes
@cjo20
Jul 07 2016 16:19
@GabeA23 it's extra arguments that are passed to whatever runs the report
GabeA23
@GabeA23
Jul 07 2016 16:29
Thanks @cjo20
So I've spent about a week on this page alone, trying to get my openaps data pushed to my nightscout:
https://github.com/openaps/docs/blob/master/docs/docs/walkthrough/phase-1/openaps-to-nightscout.md
I'm at the point where I run the "do-everything" command
It generates all my reports and doesn't output any errors. However, the final output says "Nothing to upload"
and when i cat my uploaded.json file it's empty.
My question for everyone is: is that normal?
Chris Oattes
@cjo20
Jul 07 2016 16:38
what are the input files to the uploaded.json report?
GabeA23
@GabeA23
Jul 07 2016 16:41
@cjo20 scratch that... I just did a test bolus and it works!
I guess the uploaded.json file was correct to be empty
Chris Oattes
@cjo20
Jul 07 2016 16:43
Most of the time it will say "nothing to upload", becuase it checks to see whether anything new has happened
GabeA23
@GabeA23
Jul 07 2016 16:45
now i'm having a problem with the "nightscout/openaps_status.json" report
mine looks like this:
[report "nightscout/openaps_status.json"]
oper = monitor/clock.json
use = shell
reporter = JSON
json_default = True
device = ns
remainder = monitor/iob.json predict/oref0.json enact/enacted_temp_basal.json monitor/battery.json monitor/reservoir.json monitor/status.json
I'm not quite sure what this report is even for, but the walkthrough suggests creating it, and when I run it I get a
"No JSON object could be decoded
Unknown request: monitor/clock.json" error message
Chris Oattes
@cjo20
Jul 07 2016 16:51
I think you might have missed an argument when creating that
GabeA23
@GabeA23
Jul 07 2016 16:55
That's probably true because I don't really understand this report...
Paul Martin
@Spazholio
Jul 07 2016 16:56
I was just thinking, that's a LOT of items in the remainder field.
What do you get from openaps report show --cli nightscout/openaps_status.json?
GabeA23
@GabeA23
Jul 07 2016 16:56
This was the original code in the OpenAPS docs that was supposed to create the report:
openaps report add nightscout/openaps-status.json JSON ns-status shell monitor/clock.json oref0-monitor/iob.json oref0-predict/oref0.json oref0-enacted/enacted-temp-basal.json monitor/battery.json monitor/reservoir.json monitor/status.json
Martin Haeberli
@mhaeberli
Jul 07 2016 16:57
picking up the thread again … can someone advise how to define / alias gather-clean-data ?
GabeA23
@GabeA23
Jul 07 2016 16:57
but that code doesn't work because it specifies a device "ns-status" which doesn't exist.
I tried to look at @bewest 's sample openaps.ini config file but he doesn't even have an "openaps-status.json" report
@Spazholio
this is what it returns when I run the code you suggested:
openaps use ns shell monitor/clock.json monitor/iob.json predict/oref0.json enact/enacted_temp_basal.json monitor/battery.json monitor/reservoir.json monitor/status.json
GabeA23
@GabeA23
Jul 07 2016 17:02
Does anyone else have the openaps-status.jsonreport in their openaps.ini config file? If so, could you show me what your arguments look like?
@mhaeberli, have you looked at this sample config file? https://github.com/bewest/openaps-example/blob/master/openaps.ini
you can take a look at the gather-clean-data alias there
Martin Haeberli
@mhaeberli
Jul 07 2016 17:05
@GabeA23 thx - looks promising… (note to self: crawl, walk, then run) ...
Chris Oattes
@cjo20
Jul 07 2016 17:06
GabeA23: I'd try recreating the report. At the moment I think it's trying to run nightscout.sh monitor/clock.json ...
which isn't right
GabeA23
@GabeA23
Jul 07 2016 17:07
@cjo20 any suggestion on what the report should look like? or what it should even be doing?
Chris Oattes
@cjo20
Jul 07 2016 17:07
if the ns-status device doesn't exist you'll need to create one - It's documented somewhere (can't remember where)
Paul Martin
@Spazholio
Jul 07 2016 17:08
I can't SSH into my rig while at work, or I'd show you how I have mine set up. Sorry about that...
Chris Oattes
@cjo20
Jul 07 2016 17:09
oref0 device-helper ns-status 'ns-status $*' | openaps import try that?
GabeA23
@GabeA23
Jul 07 2016 17:10
@cjo20 ok, going to try that and keep going with that page, I'll report back in a few mins
Paul Martin
@Spazholio
Jul 07 2016 17:13
Does anyone know if it's possible to pair a Pebble to more than one device at a time?
Scott Leibrand
@scottleibrand
Jul 07 2016 17:15
pretty sure that is not possible.
Paul Martin
@Spazholio
Jul 07 2016 17:15
Actually it looks like you might be able to, but it can only use one at a time. Grr.
Scott Leibrand
@scottleibrand
Jul 07 2016 17:16
right
Paul Martin
@Spazholio
Jul 07 2016 17:16
I want to pair it directly to my rig so I can try and write some code that will run code on the rig.
GabeA23
@GabeA23
Jul 07 2016 17:22
thanks @cjo20 that worked and got me a lot farther along... now I have two more reports to figure out
can anyone tell me what the nightscout/recent-missing-entries.json report and the nightscout/uploaded-entries reports are for?
Jason Calabrese
@jasoncalabrese
Jul 07 2016 17:24
for uploading cgm data to Nightscout
GabeA23
@GabeA23
Jul 07 2016 17:25
@jasoncalabrese Ah, I see. I'm using an Edison+TI stick rig without a dexcom receiver
So that's probably why those two reports aren't working for me
Jason Calabrese
@jasoncalabrese
Jul 07 2016 17:25
they work by pulling data from NS, then processing the data looking for gaps, and then pulling from a dexcom receiver using usb or ble
for ble you need openxshareble
GabeA23
@GabeA23
Jul 07 2016 17:27
@jasoncalabrese Gotcha... So I'm going to delete any references to those reports in my aliases because I'm not using a dexcom receiver... just using a nightscout bridge for my G5
mm22dl
@mm22dl
Jul 07 2016 17:29
Just a question out of curiosity for you guys who can achieve that: how do you not peak after eating? Even if my carb count is fine and my factors adjusted, I'll always end up peaking around 180-200 after each meal... I usually eat between 60 to 75g carbs per meal and try as much as I can to eat only when I'm under 50, if not then I usually prebolus for like 30g carbs... but still I always get peaks
GabeA23
@GabeA23
Jul 07 2016 17:31
@mm22dl (1) what kind of carbs are these (i.e. juice, whole grains, fruits, etc.)? and (2) do your BGs eventually go down? or do you have to bolus more than your pre-meal bolus in order to get your BGs down?
Dana Lewis
@danamlewis
Jul 07 2016 17:31
*not a guy, but highly recommend “eating soon mode” to get insulin activity peaking by the time your carbs get in
with even a minute amount of insulin activity, it goes a long way to helping your liver pull in carbs rather than them all going into the blood stream
GabeA23
@GabeA23
Jul 07 2016 17:32
If you end up having to bolus more after the meal to bring your 180-200 down, your insulin:carb ratio could be off
Scott Leibrand
@scottleibrand
Jul 07 2016 17:34
generally waiting for BG to be low is actually counterproductive. it's better to do an eating soon bolus and then eat in 30-60m once BG starts to drop. if you wait until you're <50, you're a lot more likely to get a counterproductive reaction by your liver.
Dana Lewis
@danamlewis
Jul 07 2016 17:34
Screen Shot 2016-05-21 at 5.25.48 PM.png
Screen Shot 2016-05-21 at 5.25.56 PM.png
Easy way to do eating-soon manually: assume your eventualBG is already at your target, so just precalculate (target-80)/ISF and always do that amount 30-60m prior to a meal (unless you're too low).
mm22dl
@mm22dl
Jul 07 2016 17:38
First graph happens a lot when I don't know how much g I'm eating or drinking alcohol or eating high in lipids food
Dana Lewis
@danamlewis
Jul 07 2016 17:38
yep. but eating soon solves for that. doesn’t matter low carb or high carb, it’s about the timing
then you do your normal meal bolus once you eat/know how much you’re eating
mm22dl
@mm22dl
Jul 07 2016 17:39
What about eating when you're already high? Does that solve it as well?
Dana Lewis
@danamlewis
Jul 07 2016 17:40
if you’re high and have not yet done a correction bolus (assuming you are not looping), you would do the correction bolus all the way down to 80 the hour before the meal, or down to your target depending on your comfort level
but in that case, the correction is getting insulin activity going, so the 80 is not a big deal vs your target
Scott Leibrand
@scottleibrand
Jul 07 2016 17:41
more important is to wait the 30-60m for that insulin to get active in the liver before you eat
mm22dl
@mm22dl
Jul 07 2016 17:42
I'm not looping yet, but I always do correction bolus to like 75 when I'm high
Dana Lewis
@danamlewis
Jul 07 2016 17:42
yea, might start thinking about the timing, aim for doing the correction an hour before you eat
mm22dl
@mm22dl
Jul 07 2016 17:42
If I wait for like 60 min, I'll not peak but stay high where I was az
Can the peak of action differ largely between individuals?
Like would it be reasonable to wait up to 90 minutes?
Dana Lewis
@danamlewis
Jul 07 2016 17:43
if that’s true after a correction bolus 1hour before a meal and a 100% meal bolus to cover carbs…your ratios may be off?
sure, if you can finagle that schedule wise, worth a try to experiment and see what works
mm22dl
@mm22dl
Jul 07 2016 17:44
Sure
I might need to check the ratios then
Thanks for the insight :)
Dana Lewis
@danamlewis
Jul 07 2016 17:45
np
mm22dl
@mm22dl
Jul 07 2016 17:49
What would be the max amount of carbs you'll allow yourself to eat not to peak,
?
Dana Lewis
@danamlewis
Jul 07 2016 17:50
errr, I don’t restrict carbs to not peak
there’s lots of people who choose low carb or LCHF and whatnot, but I have not gone the route. just over time observed and with more data, learned methods like eating soon that make the biggest difference for limiting or eliminating spikes
mm22dl
@mm22dl
Jul 07 2016 17:53
When you say a minute can make a difference... how can you bolus so precisely? 😮
Paul Martin
@Spazholio
Jul 07 2016 17:53
Conversely (just to offer another viewpoint) I have gone LCHF because I couldn't manage without it. I kept getting the spikes you're describing @mm22dl so rather than deal with them or do the intense investigation that @danamlewis has done, I just opted to remove as many carbs from the equation as I could.
Scott Leibrand
@scottleibrand
Jul 07 2016 17:56
@mm22dl I don't think anyone said one minute makes a difference
30 minutes definitely does
Leo Clark
@LeodClark_twitter
Jul 07 2016 17:59
This is really useful information for the new guy, how would you factor exercise into that equation Dana? I find that my daughter gets on the roller coaster most often correlates with swimming lesson or dance class, etc... .
Dana Lewis
@danamlewis
Jul 07 2016 18:00
exercise should only factor into this (because again, idea is peaking insulin activity by time carbs hit) if you drastically change ratios
Scott Leibrand
@scottleibrand
Jul 07 2016 18:00
unless you're talking about post-meal exercise
timing timing timing. :)
Dana Lewis
@danamlewis
Jul 07 2016 18:01
this is just shifting away from idea of “doing meal bolus 15 min before meal” and saying, get a tiny amount peaking by doing the bolus an hour before the meal, then do the meal bolus however you would (including adjusted for exercise, if necessary) at the time of eating
Leo Clark
@LeodClark_twitter
Jul 07 2016 18:03
I am figuring that out, Scott. I Get that, Dana. Either a correction 60 min before eating or just a small dose to get it to the liver. Then dose as normal keeping in mind what's already there. I try and put some carbs into my daughter 15 minutes before exercise so they kick in together... sometimes the timing is right and other times not so much.
Keep in mind, 15-20 carbs is a big meal for her.
Scott Leibrand
@scottleibrand
Jul 07 2016 18:04
:+1:
iananders
@iananders
Jul 07 2016 18:16
working on formatting glucose values to get uploaded to nightscout and the error is indicating i can't compare OFFSET-NAIVE and OFFSET-AWARE datetimes - which datetimes is it comparing? my system time (pi) vs nightscout?
Rocky DuBose
@rdubose55_twitter
Jul 07 2016 18:29
@danalewis - I'm sorry, I lost the link you gave me to maybe find some expired G4 transmitters. Please provide again. TIA, Rocky
Jason Calabrese
@jasoncalabrese
Jul 07 2016 18:41
@iananders you probably need to zone the glucose data
David Cintron
@loudestnoise
Jul 07 2016 18:43

this is just shifting away from idea of “doing meal bolus 15 min before meal” and saying, get a tiny amount peaking by doing the bolus an hour before the meal, then do the meal bolus however you would (including adjusted for exercise, if necessary) at the time of eating

:clap::clap::clap::clap::clap: @danamlewis

Martin Haeberli
@mhaeberli
Jul 07 2016 18:52
@cjo20 - if you have a minute, can you please confirm the Intel Edison components needed ? In particular, I understand that I need the breakout board as well as the compute module. So - WHICH breakout board ?
Scott Leibrand
@scottleibrand
Jul 07 2016 18:52
for which configuration? there are multiple documented in the mmeowlink wiki
intel breakout is good for soldering a ribbon cable to a TI stick. sparkfun breakout is good for using the TI over USB OTG
iananders
@iananders
Jul 07 2016 18:56
@jasoncalabrese how do i do that? the way i understand it, the command i was issuing was "zoning the glucose data"
openaps use ns shell format-recent-type tz entries monitor/glucose.json  | json -a dateString | wc -l
Eric
@ecc1
Jul 07 2016 19:00
What gotchas am I likely to encounter if I interpret pump history timestamps as being in my (Edison's) local timezone?
Scott Leibrand
@scottleibrand
Jul 07 2016 19:01
normally that's what the tz tool does: adds the edison local timezone to the end of the pump's timestamps
you have to keep them in sync, obviously. for DST, you'll need to have it automatically run clockset.sh if it detects a mismatch. not sure I've got that working yet: generally I run it manually when we switch timezones
Eric
@ecc1
Jul 07 2016 19:02
Does anything go back and look for pump timechange events? Like when you manually change the pump's time after you arrive in a new time zone? Seems like that would be required
Scott Leibrand
@scottleibrand
Jul 07 2016 19:03
no, we don't do that
generally we wait until morning (before breakfast) to change it, to minimize the effects of mistimed pumphistory events on IOB
Dana Lewis
@danamlewis
Jul 07 2016 19:15
@rdubose55_twitter I don't remember giving a link, but maybe suggested asking around CGM in the cloud on Facebook or other diabetes pay it forward groups?
Eric
@ecc1
Jul 07 2016 19:43
In Go the standard date/time type always has a timezone, unlike Python, so it forces you to make a decision when parsing and formatting them.
Scott Leibrand
@scottleibrand
Jul 07 2016 19:45
we try to make sure everything we deal with has a timezone, but the data from the pump and CGM do not, so the first step has to be inferring the correct timezone and adding it to the data.
Eric
@ecc1
Jul 07 2016 19:45
Right, just wondering why that's not done in decocare when parsing timestamps, vs. adding it to the JSON data later ...
Scott Leibrand
@scottleibrand
Jul 07 2016 19:47
because ben didn't want to make use-case assumptions in the low-level tools
Jason Calabrese
@jasoncalabrese
Jul 07 2016 19:53
@iananders I don't have the commands handy, but this is the ini for my cgm loop, maybe it will help you with the zoning https://github.com/jasoncalabrese/indy-e1-cgm4/blob/master/openaps.ini
iananders
@iananders
Jul 07 2016 19:53
@jasoncalabrese answered my own question! thanks for the help
Jason Calabrese
@jasoncalabrese
Jul 07 2016 19:54
I run 2 loops on the edison, 1 updates cgm data via openxshareble, and the other works with the pump and copies the glucose file from the cgm-loop
mm22dl
@mm22dl
Jul 07 2016 20:18
@scottleibrand Sorry! Language barrier made me misunderstand how precise timing has to be 😆
Not sure if this
was luck but:
mm22dl
@mm22dl
Jul 07 2016 20:26
2016-07-07 22.20.24.jpg
first blue point is corrective bolus, second is meal bolus (for 75g carbs) and last one is because of a chai latte :D
Scott Leibrand
@scottleibrand
Jul 07 2016 20:27
:+1:
mm22dl
@mm22dl
Jul 07 2016 20:28
definitely gonna try more to do small boluses (towards 80) before eating and see what happens :)
Dana Lewis
@danamlewis
Jul 07 2016 20:29
:)
mm22dl
@mm22dl
Jul 07 2016 20:31
thanks again :)
Dana Lewis
@danamlewis
Jul 07 2016 20:32
:+1:
jaylagorio
@jaylagorio
Jul 07 2016 20:44
@danamlewis Is the process you just outlined with @mm22dl documented somewhere on your blog?
Dana Lewis
@danamlewis
Jul 07 2016 20:44
@jaylagorio yep but I wrote it a long time ago so it’s a little wordy ;) https://diyps.org/2015/03/26/how-to-do-eating-soon-mode-diyps-lessons-learned/
jaylagorio
@jaylagorio
Jul 07 2016 20:47
Wonderful, thank you. After tonight I'll be done my third night of looping and would like to start doing meals better.
Dana Lewis
@danamlewis
Jul 07 2016 20:47
:)
mm22dl
@mm22dl
Jul 07 2016 20:50
The 2 graphs you posted are just perfectly describing one of the most common situations T1D face everyday
Even more so when they don't have access to CGMs
Dana Lewis
@danamlewis
Jul 07 2016 20:50
are they helpful? i drew them quickly one day, so the axes aren’t quite equivalent, have thought about re-doing them more properly if they helped better illustrate the concept
jaylagorio
@jaylagorio
Jul 07 2016 20:50
Yup, definitely helpful.
Dana Lewis
@danamlewis
Jul 07 2016 20:54
ok. I’ll add on to my list to re-do them. thx for the feedback
mm22dl
@mm22dl
Jul 07 2016 21:12
Yes!
I'm sure a lot of people will recognize the pattern
Also... this might sound stupid, but I am a bit unsure regarding the compatibility of the 754... is European Veo only there to indicate an equivalence, or has the pump to be european to be working? Or does it simply need to be using firmware 2.6A or lower?
Dana Lewis
@danamlewis
Jul 07 2016 21:21
it does not have to be European to work, but the European models have different model numbers that still are compatible with OpenAPS
Matt Walker
@walker0
Jul 07 2016 21:21
@mm22dl the USA doesn't have the 754/554 models they have 723/523 instead. So a 754/554 with 2.6A or lower should work
mm22dl
@mm22dl
Jul 07 2016 21:27
I see! Thanks!
Paul Martin
@Spazholio
Jul 07 2016 21:35
I you had to guess, what pins should I solder my Edison to on this? https://learn.adafruit.com/adafruit-powerboost-1000c-load-share-usb-charge-boost/pinouts
Because I had it wired incorrectly, so I’ve re-soldered it according to what I thought was correct, but apparently I was not. While it powers the Edison, I’m still getting erroneous readings from @cjo20’s voltage tool.
Matt Walker
@walker0
Jul 07 2016 22:34
@Spazholio if you want the most accurate readings Bat and Ground
Paul Martin
@Spazholio
Jul 07 2016 22:35
Really? Damn it! I just swapped those. Because BAT says it’s an input but what I’m wiring to it is the output to the Edison.
Am I misunderstanding something fundamental here?
Matt Walker
@walker0
Jul 07 2016 22:36
It is just a direct connection to the battery I believe. If you have it wired up to Bat just make sure that the charging behaviour still acts appropriately
Paul Martin
@Spazholio
Jul 07 2016 22:37
Do you see an advantage to BAT over VS?
VS seems to be preferring the USB whenever one is plugged in, but battery if not. BAT doesn’t do the same thing, does it?
Matt Walker
@walker0
Jul 07 2016 22:38
Vs will probably work fine, when plugged in it might exceed the tolerated voltage on the edison lipo header but I'd have to check the breakout spec sheet
David Cintron
@loudestnoise
Jul 07 2016 22:38
This is probably a terrible idea, but has anyone ever hot swapped a reservoir between pumps before? I'm mid set, but I kind of want to start playing with my 723 I acquired. I was thinking I'd just have to prime again.
Matt Walker
@walker0
Jul 07 2016 22:39
You will also not get sensible output from the battery utility while charging using vs but it doesn't really matter because you are charging anyway
Paul Martin
@Spazholio
Jul 07 2016 22:39
As long as it will still charge the battery while plugged in and draw power to the Edison from USB (rather than battery) then I’ll switch to BAT if you think it’ll give better readings.
When connected to VS, I’m getting 100% all the time when plugged in. Which made sense to me.
iananders
@iananders
Jul 07 2016 22:40
@loudestnoise yeah, just disconnect, rewind (on new pump) and let it prime again - you should be good to go
David Cintron
@loudestnoise
Jul 07 2016 22:40
Nice
Chris Oattes
@cjo20
Jul 07 2016 22:40
(make sure you discoonect)
David Cintron
@loudestnoise
Jul 07 2016 22:40
:+1:
iananders
@iananders
Jul 07 2016 22:42
i've done the opposite quite frequently actually - usually when my set gets ripped out or sweats off during a workout - keep the reservoir and swap the set
David Cintron
@loudestnoise
Jul 07 2016 22:43
yeah, I've done that before. Ripped off on door handles and other random things.
Matt Walker
@walker0
Jul 07 2016 22:43
@Spazholio it probably doesn't matter I would't changing it if it is working, the accuracy shouldn't really be affected by either. It is probably prudent to check the tolerated input voltages on J2 though
Paul Martin
@Spazholio
Jul 07 2016 22:47
Well, too late. =)
However, now I’m not getting 100% when it’s plugged in.
Chris Oattes
@cjo20
Jul 07 2016 22:48
what are you getting?
Paul Martin
@Spazholio
Jul 07 2016 22:48
(edison) [mini-panc: ~] $ sudo ./cjo20_battery_voltage 
Raw value: 852
Battery Voltage: 3744mV (Mine: 56%)
Battery level = 20%
(edison) [mini-panc: ~] $ sudo ./cjo20_battery_voltage 1
860,3779,92%,60%
(edison) [mini-panc: ~] $
And the numbers seem to be increasing gradually (as one would expect).
Chris Oattes
@cjo20
Jul 07 2016 22:51
What have you got plugged in to where at the moment?
Matt Walker
@walker0
Jul 07 2016 22:51
Nice, thats how mine works with the sparkfun power block
Paul Martin
@Spazholio
Jul 07 2016 22:52
LiPo -> Adafruit (wired with the BAT pin) -> Edison J2.
And my TI stick connected via serial.
And a USB plugged into the Adafruit to charge, naturally.
New reading:
(edison) [mini-panc: ~] $ sudo ./cjo20_battery_voltage && sudo ./cjo20_battery_voltage 1
Raw value: 860
Battery Voltage: 3779mV (Mine: 60%)
Battery level = 26%
854,3753,91%,57%
(edison) [mini-panc: ~] $
Dana Lewis
@danamlewis
Jul 07 2016 23:20
@loudestnoise not a big deal, people do it all the time, just remember to finish priming when it’s unattached.
(if you stay on prime screen, you get no basal even if you have remembered to reattach your pump)
David Cintron
@loudestnoise
Jul 07 2016 23:23
Good to know. I had an inkling someone here would know.
Or would have experience lol
Brandon Faloona
@bfaloona
Jul 07 2016 23:31
OMG - We ran a closed loop today for an hour and everything looked great! A huge shout out to everyone who has helped me here, and to everyone who's contributed to these projects. Thank you! I can see a much happier T1D on the horizon. :smile_cat: :sparkles: :fire:
Jeremy M Lucas (GetRileyLink.org)
@jlucasvt
Jul 07 2016 23:42
@bfaloona :+1:
tazitoo
@tazitoo
Jul 07 2016 23:42
@bfaloona :+1:
Jason Calabrese
@jasoncalabrese
Jul 07 2016 23:46
:smile:
David Cintron
@loudestnoise
Jul 07 2016 23:47
Woohoo! :confetti_ball:
Dana Lewis
@danamlewis
Jul 07 2016 23:48
:sparkles: :clap: :confetti_ball: @bfaloona
jim-andrews
@jim-andrews
Jul 07 2016 23:49
@bfaloona Wait till you see what it does to your evening readings. I'm two days in, and I can't believe it. It's like I'm looking at a non-diabetic readings. Almost flat all night long. I use to wake up in the middle of the night with 295 readings. I'm getting a good nights sleep. It's totally worth it if not just for that.
Dana Lewis
@danamlewis
Jul 07 2016 23:49
:) :) :) @jim-andrews
David Cintron
@loudestnoise
Jul 07 2016 23:49
OpenAPS - Helping T1Ds (and their parents) sleep better since ‘15
Jeremy M Lucas (GetRileyLink.org)
@jlucasvt
Jul 07 2016 23:51
hahah true that @loudestnoise
Dana Lewis
@danamlewis
Jul 07 2016 23:52
:D
you could teeechnically say since ’14 but we won’t split hairs since OpenAPS.org went up in ’15 ;)