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

16th
Jun 2018
alimhassam
@alimhassam
Jun 16 2018 00:01
ah i found it: "There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors."
Martin Haeberli
@mhaeberli
Jun 16 2018 00:05
ok, <= fails
< works
Jon Cluck
@cluckj
Jun 16 2018 00:06
k
thanks
Aaron Michelson
@Aaybob
Jun 16 2018 05:21
@wilson99 If iob is big then much insulin is active. The base basal is modified by openaps algorythms. by default it can increase 130% from pump settings. you can in "preferences" make that any percentage. I would check the autotune file to see if basal adjustment is a good idea. Openaps uses temp basals only. The temp basals are usually set for 30 minutes. If openaps stops working then the base basal is returned to. My temp basals range from 11 to 0 units per hour.
Aaron Michelson
@Aaybob
Jun 16 2018 06:08
node-pre-gyp ERR! Completion callback never invoked! node-pre-gyp ERR! System Linux 3.10.17-poky-edison+ node-pre-gyp ERR! command "/home/.rootfs/usr/bin/node" "/root/Lookout/node_modules/ node-pre-gyp ERR! cwd /root/Lookout/node_modules/usb node-pre-gyp ERR! node -v v6.14.3 node-pre-gyp ERR! node-pre-gyp -v v0.10.0 node-pre-gyp ERR! This is a bug in `node-pre-gyp`. node-pre-gyp ERR! Try to update node-pre-gyp
Tried to install Lookout. How does one update "node-pre-gyp ?
Aaron Michelson
@Aaybob
Jun 16 2018 06:47
Anybody installed Lookout?
Peter Kok
@kretep
Jun 16 2018 14:05

I have a problem with my NS pump and OpenAPS pills not updating (Couldn't generate ns-status.json in ns-loop.log). I traced it down to the battery level not being retrieved properly. openaps-menu/scripts/getvoltage.sh returns an empty output, or actually almost empty: one character is written to monitor/edison-battery.json, causing the call to ns-status to malfunction.

At the moment, I'm powering directly on the USB port, so I'm not sure what the proper behavior of getvoltage.sh should be. It might be related to my screen breaking (problems started after that; I didn't replace it yet). What would be the best way to fix this, apart from forcing oref0-ns-loop.sh to ignore edison-battery.json? I'm running a Pi-0 + HAT on 0.7.0-dev.

garykidd
@garykidd
Jun 16 2018 14:10
@scottleibrand with the setbasal code recently found could that be used to push autotune recommendations to active basal rates on pump?
Dana Lewis
@danamlewis
Jun 16 2018 14:29
@garykidd we'll probably need to design for people to opt in to do that safely
@kretep interesting re battery - thanks for flagging that. Cc @cluckj ^
@Aaybob there's an xdrip-js gitter channel you can join for questions about it
Scott Leibrand
@scottleibrand
Jun 16 2018 14:41
@garykidd in other words, a script you’d run manually on the rig to push the latest autotune results to the pump if you think they make sense.
@kretep sounds like you’ll want to improve oref0-ns-loop to add better error checking
What exactly does the battery file look like?
Jon Cluck
@cluckj
Jun 16 2018 14:49
@kretep it should return something like {"batteryVoltage":4140,"battery":98}
the code that manages the screen also manages the battery voltage
(separate note: we may want to put that in a standalone repo, like edison-voltage is)
I also agree about the error checking in ns-loop :)
Peter Kok
@kretep
Jun 16 2018 14:56
@scottleibrand @cluckj there is only one character in my edison-battery.json and I think it's a newline character
Scott Leibrand
@scottleibrand
Jun 16 2018 14:59
Paste your cat output?
We have lots of similar error checks in oref0-pump-loop. Make your changes to the 0.7.0-refactor branch: it makes these checks into more understandable functions.
Peter Kok
@kretep
Jun 16 2018 15:04
root@rpi0:~/myopenaps# cat monitor/edison-battery.json

root@rpi0:~/myopenaps#
So there's not much there; and the file is just one byte long
Jon Cluck
@cluckj
Jun 16 2018 15:06
is there a battery hooked up to the HAT?
Peter Kok
@kretep
Jun 16 2018 15:06
I'm not sure how to check for this condition in a shell script
@cluckj no, there's no battery
Jon Cluck
@cluckj
Jun 16 2018 15:07
:laughing: okay so we need error checking in ns-loop
what does ~/src/openaps-menu/scripts/getvoltage.sh return?
Peter Kok
@kretep
Jun 16 2018 15:12
root@rpi0:~/myopenaps# ~/src/openaps-menu/scripts/getvoltage.sh

root@rpi0:~/myopenaps#
In oref0-ns-loop.sh, in the function format_ns_status there is a check: if [ -s monitor/edison-battery.json ]; then that doesn't catch the one-character file
Scott Leibrand
@scottleibrand
Jun 16 2018 15:15
Look for the minimum size checks.
Jon Cluck
@cluckj
Jun 16 2018 15:18
or a jq check?
Peter Kok
@kretep
Jun 16 2018 16:31
@scottleibrand @cluckj this seems to do the trick: if test $(wc -c < monitor/edison-battery.json) -gt 1; then. I tried with jq, but it doesn't error out on the one-character file, so I'm not sure how to check for it other than looking at the file length.
Eric
@ecc1
Jun 16 2018 16:54
Might be cleaner to make getvoltage.sh produce a strictly empty file on error, so you can just test for zero length in the shell. "echo -n ..." should do the trick
ElwinABC
@ElwinABC
Jun 16 2018 18:36
Dear all, I wanted to install Autotune as preparation to get to a closed loop implementation. I tried to install Autotune through "Phase C: Running Autotune for suggested adjustments without an OpenAPS rig". I have installed VirtualBox/Ubuntu on my Windows computer. In the Terminal of Ubuntu I executed the command "sudo curl -s https://raw.githubusercontent.com/openaps/docs/master/scripts/quick-packages.sh | bash -". After that I got a strange error message. Does anyone know how to solve this problem? Many thanks..
The error message started with "Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)"
Peter Kok
@kretep
Jun 16 2018 19:47
@ecc1 thanks, you're right!
garykidd
@garykidd
Jun 16 2018 22:02
@scottleibrand that'd be huge---I'm nobody to comment but that latest discovery does make it seem a lot more achievable ...right? It'd be hug for me, personally....not a big deal but some rounding would be needed it seems
Eric
@ecc1
Jun 16 2018 22:37
I'm trying to catch up with @ps2 by supporting those pump operations in the Go code
Jon Cluck
@cluckj
Jun 16 2018 22:39
haha
:clap:
Jon Cluck
@cluckj
Jun 16 2018 22:44
there are a lot of undeciphered x12 commands
Martin Haeberli
@mhaeberli
Jun 16 2018 23:31
@ElwinABC reboot sometimes helps. google is your friend. try searching for the error message
Martin Haeberli
@mhaeberli
Jun 16 2018 23:36
@scottleibrand @kretep fyi, last time I tried to run Pi Hat on an RPi3 I had the same problem. but it may have been sheer incompetence on my part; I’m not certain I had a battery on it in that configuration.
(that is, no pill because no battery level report…)