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

26th
Jun 2018
bjarecki
@bjarecki
Jun 26 2018 01:55
Just wondering how much average battery live people have been getting with new hat rigs. I have been using this 4400 mahttps://www.adafruit.com/product/354 and getting maybe 7 hours at most. That is with no screen, it broke the first day I had it in my pocket.
Zach Gohr
@zgohr
Jun 26 2018 02:01
Wow, 7 hours on 4400mAh. @bjarecki try this: https://github.com/openaps/docs/pull/1303/files
Martin Haeberli
@mhaeberli
Jun 26 2018 02:16
@zgohr I just ran about a 22 hour experiment on a 4400mAh battery
underclocked to 500 MHz; PiZero LED turned off…, display on
Zach Gohr
@zgohr
Jun 26 2018 02:16
yeah, 7 hours on 4400mAh seems like a dud battery
fantastic
Martin Haeberli
@mhaeberli
Jun 26 2018 02:20
but I could see 11 hours or less at full clock speed plus LED on.
also, I have not yet convinced myself that my batteries get fully charged...
Zach Gohr
@zgohr
Jun 26 2018 02:20
yeah, indeed
Martin Haeberli
@mhaeberli
Jun 26 2018 02:21
@zgohr see my additional comment on your PR - which looks very nice by the way
Zach Gohr
@zgohr
Jun 26 2018 02:22
what comment about default speed are you referring to?
cameronrenwick
@cameronrenwick
Jun 26 2018 02:22
@scottleibrand regarding dedicated controller... absolutely.. and 2 years ago I wasn't interested in having my BG on my phone at all ...and now couldn't live without it... so I may be the Luddite here.. time'll tell!
Zach Gohr
@zgohr
Jun 26 2018 02:24
also, @mhaeberli I wasn’t confident arm_freq_minwas necessary because my understanding was that it’s more for dynamic overclocking (where the cpu can burst) - in fact, setting that value could hurt battery life (but likely has no affect, because the default value could be higher already
but i could very well be wrong. also the fact i didn’t run a test with it - i have nothing to add. ha
bjarecki
@bjarecki
Jun 26 2018 02:52
@zgohr thanks I will give that a try.
Martin Haeberli
@mhaeberli
Jun 26 2018 03:18
@zgohr - sounds like you found the comment -didn’t seem to hurt.
Zach Gohr
@zgohr
Jun 26 2018 03:26
@mhaeberli yeah, looks like the default value for Pi Zero is 700, so changing it to 500 wouldn’t have any effect. thanks for pointing it out, though!
Martin Haeberli
@mhaeberli
Jun 26 2018 03:31
well, actually, the DOCUMENT says it’s 700, but when I flash a new pizero and check, it’s actually 1000.
I did see what appeared to be longer runtimes at 500Mhz but I don’t have enough good data yet
Zach Gohr
@zgohr
Jun 26 2018 03:31
which document? i read that from the raspberry pi website
Martin Haeberli
@mhaeberli
Jun 26 2018 03:34

the default value (commented out) in the newly flashed device is 700MHz. But if you read the clock speed, with, for example,

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

it’s 1000

(this is on a freshly flashed raspberry stretch lite image from 4/18/18
so the ‘document’ config.txt says one thing; the behavior does another. you can try this by commenting out the 500MHz line in config.txt, rebooting, and seeing what it says
also, I was able to do some experiments with a USB in-line digital power meter and the RPi, and saw some (albeit modest) improvement from changing the clock from 700 to 500
Scott Leibrand
@scottleibrand
Jun 26 2018 03:38
the 700MHz is the speed of the original Raspberry Pi. The 2, 3, and Zero are all faster, but they never updated the comment in config.txt in the Raspbian image.
Zach Gohr
@zgohr
Jun 26 2018 03:38
yeah it’s a bit tricky because that config is probably reused from older versions
700MHz is the min freq, 1000MHz is the full, burst speed
Scott Leibrand
@scottleibrand
Jun 26 2018 03:38
the Pi Zero is definitely 1000MHz, so 500MHz is 50% underclocking, which does make a significant difference to power draw (and speed)
if you're talking about two different config values, I'll butt out. :)
Martin Haeberli
@mhaeberli
Jun 26 2018 03:39
no, I think we’re on the same page
@scottleibrand on a related note, pls remind me what governs how often 'Starting oref0-pump-loop’ should happen? (and what is the maximum interval tolerable)? I thought of downclocking some more to see how slow I could make it and still have it follow the rules...
Scott Leibrand
@scottleibrand
Jun 26 2018 03:42
Ideally one loop for every CGM data point.
lyntonr
@lyntonr
Jun 26 2018 04:39
Hi, just got my explorer hat... But they sent the wrong antenna. Sooo disappointed. Guess I just have to wait for a replacement. Anyway just wondering if it would work at all using the 868 antenna sent with my Australian 916 freq pump ? Can it hurt to try ?
Martin Haeberli
@mhaeberli
Jun 26 2018 05:03
in my opinion, it can’t hurt to try
likely range will be reduced
lyntonr
@lyntonr
Jun 26 2018 05:33
It says antenna can be attached / detached up to 30 times so I guess it's ok to try, but likely frequency will be too far out of range :(. After 2 months waiting already I guess another 2-3 weeks won't hurt ... Damn, i had thought I was going to be testing open looping by today.
Jens Heuschkel
@juehv
Jun 26 2018 06:56
@mhaeberli I'm not sure how it is handled for USA. But in EU there is an obligation by law to replace failing devices (within the first two years). But yes! I'll be nice for sure!
@N3FM I'm not an expert on bash programming. For me it worked fine if I add the variabled to ~/.profile or change the settings directly withing ~/src/oref0/bin/oref0-pump-loop.sh
Jens Heuschkel
@juehv
Jun 26 2018 07:11
@zgohr @danamlewis @scottleibrand From my personal measurements (and many other measurements presented online) it's known, that underclocking has a minor impact on energy consumption. I think the display is way bigger energy user than any other part (and it's pretty annoying at night). Think we should find a way to switch it off by a timer or so.
Here is a very good article to decrease the power consumption of the PI: https://www.jeffgeerling.com/blogs/jeff-geerling/raspberry-pi-zero-conserve-energy
This undervolting trick is possible with the board I proposed in the hardware-dev channel recently (I still have some to give away for free..)
However, usually in battery constrained scenarios, duty cycling is the way to go. Thus the task should be performed as fast as possible to bring the hardware back to an energy saving state. This could be possible with the pi if somebody build a kernel supporting "suspend to ram" (but that's not part of the default Raspbian).
JohnDoeAkira
@JohnDoeAkira
Jun 26 2018 07:55
@juehv I asked the manufacturer of the edison, the cut off voltage is even higher than we thought, it is 3.3V
@N3FM I asked the manufacturer of the edison, the cut off voltage is even higher than we thought, it is 3.3V (sorry for the double post)
Scott Leibrand
@scottleibrand
Jun 26 2018 09:58
@juehv we’ve tested the draw and the runtime. 500MHz makes the biggest difference. The screen draws less than an LED.
Jens Heuschkel
@juehv
Jun 26 2018 09:59
interesting ...
Scott Leibrand
@scottleibrand
Jun 26 2018 10:08
@lyntonr it’s not a big deal. Both antennas work at both frequencies. For better range you should replace the antenna, but it’s only $4 or so on Mouser.
peterfulvi
@peterfulvi
Jun 26 2018 13:35
Is the PI-HAT by default offline, or do you still need Nightscout, or xdrip to monitor the Blood Sugar readings from the transmitter.
Zach Gohr
@zgohr
Jun 26 2018 13:40
@juehv I’m going to echo @scottleibrand - the under clock makes a huge impact in my test. I’m also going to echo hesitation that LED or that screen are going to make any noticeable difference, but I can’t say for certain because I haven’t tested
Jens Heuschkel
@juehv
Jun 26 2018 13:42
@zgohr Well I did ... but I'll repeat since you guys are so sure :D A LED usually needs around 25mA which is a lot for our super small batteries....
Scott Leibrand
@scottleibrand
Jun 26 2018 13:46
I think the LEDs on the HAT might be less than 25mA (and I know the OLED screen is quite a bit less), but in any event 25mA * 10h = 250 mAh, so not irrelevant, but not the biggest factor either. that said, I believe you can shut off / invert the Pi Zero's bright green LED
Zach Gohr
@zgohr
Jun 26 2018 13:46
well i’d be glad to run a test if i knew how to get the screen off
Scott Leibrand
@scottleibrand
Jun 26 2018 13:47
what exactly do you mean by "get the screen off"? just "write a black bitmap to it"?
Zach Gohr
@zgohr
Jun 26 2018 13:48
whatever it takes to reduce the draw to zero, heh
Scott Leibrand
@scottleibrand
Jun 26 2018 13:50
short of de-soldering it, I think turning off all the pixels is all you can do
Jens Heuschkel
@juehv
Jun 26 2018 14:01

I already checked the library, and it offers functions for dimming and shutting the display off. And yes, its possible to deactivate the green LED on the pi. It's done by adding

dtparam=act_led_trigger=none
dtparam=act_led_activelow=on

to the config.txt
With the command /usr/bin/tvservice -o we can shut down HDMI also saving around 25 mA.
@zgohr @scottleibrand

Scott Leibrand
@scottleibrand
Jun 26 2018 14:03
I think we put the tvservice -o in somewhere already, but we may want to put that on an uptime timer so it only turns off HDMI after the rig has been up for X minutes (in case you need to KVM in)
Jens Heuschkel
@juehv
Jun 26 2018 14:04
hmm good point. Even though I never needed it since ssh+serial service is working fine. So KVM isn't working without it?
Zach Gohr
@zgohr
Jun 26 2018 14:05
i think he means you lose the ability to get in via hard-wired monitor
Jens Heuschkel
@juehv
Jun 26 2018 14:05
ah right ...
Zach Gohr
@zgohr
Jun 26 2018 14:05
i might need to turn the screen off just because it’s so bright
Jens Heuschkel
@juehv
Jun 26 2018 14:07
I agree, it was pretty annoying the last few nights :D I thought it would be nice if it turns of after a few minutes not pressing a button and comes back on when you press one.
Zach Gohr
@zgohr
Jun 26 2018 14:07
yes that would be nice
Scott Leibrand
@scottleibrand
Jun 26 2018 14:07
@zgohr it's odd that it's so bright, because it's already on a fractional duty cycle (shake it back and forth in the dark to see lots of discrete images)
I think it's flashing at something like 40 Hz
discussion on openaps-menu and other screen-related stuff has been mostly in https://gitter.im/openaps/hardware-dev
Zach Gohr
@zgohr
Jun 26 2018 14:08
very interesting
Scott Leibrand
@scottleibrand
Jun 26 2018 14:09
makes it hard to take pictures of it too :)
Zach Gohr
@zgohr
Jun 26 2018 14:09
haha we’ll know how skilled of a photographer you are if you can time it right
Scott Leibrand
@scottleibrand
Jun 26 2018 14:09
or at least that you know how to change the key frame on iOS Live Photos :)
Jon Cluck
@cluckj
Jun 26 2018 14:32
I'll put "screen off" functionality into the menu system?
Zach Gohr
@zgohr
Jun 26 2018 14:33
@cluckj that’d be much appreciated :+1:
Dana Lewis
@danamlewis
Jun 26 2018 15:03
@peterfulvi same concept as before for you choose how to get your BGs to the rig, online or off.
but the HAT means screen is offline by default, no connectivity required to view what's on it
peterfulvi
@peterfulvi
Jun 26 2018 15:05
@danamlewis Got it
Eric
@ecc1
Jun 26 2018 15:20
@lyntonr Since the wavelength of 868 is longer than 915 MHz, you can actually just cut it to the proper length. I'd put a dab of glue at the cut end just to be safe, since those come coated with something non-conductive
I change my Pi Zero's green LED to a simple once-per 5 sec blink:
echo timer > /sys/class/leds/led0/trigger
echo 5000 > /sys/class/leds/led0/delay_off
Jon Cluck
@cluckj
Jun 26 2018 15:46
:thumbsup: I like that
N3FM
@N3FM
Jun 26 2018 16:09
@lyntonr The length difference is 0.166 inches, or 4.2 mm... If desired, you may cut that amount from the end of a WIRE antenna.
Martin Haeberli
@mhaeberli
Jun 26 2018 17:19
@scottleibrand has recently written here briefly about the long view for openaps and controllers - the Dana RS and perhaps the Roche Combo may be approved soon and will work then with Loop and AndroidAPS. A related question, though - IF (and it’s a long shot) it were possible to figure out how to downgrade 7xx and 5xx Medtronic pumps to loopable versions, is it worth doing, and how much effort is it worth?) I ask because I have some new thoughts on a strategy for this, similar to that used for the OmniPod efforts over the last few years. I welcome comments here ...
Eric
@ecc1
Jun 26 2018 17:25
There's a separate room, medtronic-flash, for that kind of discussion, but hasn't really produced anything. Would love to hear any fresh ideas though
Martin Haeberli
@mhaeberli
Jun 26 2018 17:29
@ecc1 understood - the question for THIS room is - how important is this, given likely Dana RS, etc. but I’ll post on medtronic-flash as well.
Jens Heuschkel
@juehv
Jun 26 2018 17:33
I recently thought about writing a "driver" for OpenAPS to communicate with Dana RS
Eric
@ecc1
Jun 26 2018 17:33
Well, there seems to be a huge pool of currently-unloopable Medtronic pumps that would be more affordable than a new BT-enabled pump, and openaps is a known, working APS solution. Downsides are carrying a rig, which isn't much of one really, but the main one will be getting comfort that the Franken-pumps are safe to use
Martin Haeberli
@mhaeberli
Jun 26 2018 17:42
@juehv :+1:
Martin Haeberli
@mhaeberli
Jun 26 2018 18:19
@ecc1 i like your blinky idea above - is there an equivalent I can add to config.txt or do I have to add it to some file that runs on boot (ok, I can google it, but I’ll admit I’m lazy)
Eric
@ecc1
Jun 26 2018 18:20
@mhaeberli it needs to run once (as root) after you've booted into linux. I put mine in /etc/rc.local
There are other values than "timer" you can use, too, like "heartbeat" which is fun
Martin Haeberli
@mhaeberli
Jun 26 2018 18:23
:+1:
Eric
@ecc1
Jun 26 2018 18:23
disclaimer: does not track actual PWD's heartbeat :-)
Zach Gohr
@zgohr
Jun 26 2018 18:23
idea: integrate with smartwatch with heart rate monitor...
Martin Haeberli
@mhaeberli
Jun 26 2018 18:24
:+1: @zgohr :laughing: -> @ecc1
Jon Cluck
@cluckj
Jun 26 2018 18:24
lol
N3FM
@N3FM
Jun 26 2018 18:51
@mhaeberli @ecc1 pump strategy must also include what pumps third-party payers will authorize... Over and above FDA clearance.
Both in US and internationally
Martin Haeberli
@mhaeberli
Jun 26 2018 18:56
:+1:
Martin Haeberli
@mhaeberli
Jun 26 2018 19:19
RPIZeroW default clock speed (1 GHz), LED on 183 mAh after an hour vs 141 mAh @ 500MHz, LED off. So about 23% less power consumption or 30% more battery life… (one experiment, two PiZeroWs side by side, WiFI network, two identical USB power meters…)
(also low power had HDMI output OFF …)
Martin Haeberli
@mhaeberli
Jun 26 2018 20:02
new experiment extrapolates to : 186 mAh after an hour vs 152 mAh @500 MHz, LED off, HDMI on. So HDMI draws about 11 mA
Martin Haeberli
@mhaeberli
Jun 26 2018 20:14
where are we on offline openaps use with G6?
Jon Cluck
@cluckj
Jun 26 2018 20:19
should theoretically work with xdrip+ already
Martin Haeberli
@mhaeberli
Jun 26 2018 20:32
ok thx
new experiment actual : 183 mAh after an hour vs 151 mAh @500 MHz, LED off, HDMI on. So HDMI draws about 12 mA
Martin Haeberli
@mhaeberli
Jun 26 2018 20:58
display looks to be about 10 mA savings when off...
Jens Heuschkel
@juehv
Jun 26 2018 20:58
nice! thanks for the measuremens
Martin Haeberli
@mhaeberli
Jun 26 2018 21:00
:+1: so it sounds like we could have the display time out (optionally) at a parameterized time, then have either menu button wake it… (I’m dreaming of an accelerometer to wake it, but that’s another story)
Jon Cluck
@cluckj
Jun 26 2018 21:08
I need to write a display script picker script, so there may be room for some stuff like that in it
Martin Haeberli
@mhaeberli
Jun 26 2018 21:08
:+1:
Martin Haeberli
@mhaeberli
Jun 26 2018 21:40
new experiment actual : 186 mAh after an hour vs 147 mAh @500 MHz, LED off, HDMI on, display off - so display off saves maybe only 4mA? (I’d like to run this experiment again over a longer baseline to confirm)
marafie
@marafie
Jun 26 2018 21:59
Hi... how can I inforce the NS to override the sensor calibration ... my kids BG is 14.5 and the xdrip/ns is not accepting the calibration And keeping the BG as 10
JohnDoeAkira
@JohnDoeAkira
Jun 26 2018 22:06
Hello, trying to setup the bluettoth tethering with my rig (edison+explorer) and Asus Zenfone2
Everythin goes weel, I can even test the BT connection following the section : Testing to make sure it works after you successfully did the above
My phone indicates that there is a BT connection.
Then I close the connection with sudo bt-pan client -d AA:BB:CC:DD:EE:FF and restart the cron.
I disable my wifi and wait for the rig to connect with BT but nothing happens.
Should I let the bt-pan client AA:BB:CC:DD:EE:FF instead of closing it ? Should the rig automatically creates the connection ?
BTW I have installed the BTautotethering on my phone.
Martin Haeberli
@mhaeberli
Jun 26 2018 22:11
@JohnDoeAkira one question is whether there are any Wifi networks nearby that your rig knows about. If there are, that may well prevent BT from being used
so you can either (temporarily) shut down the wifi interface, or walk far far (200 meters or so) away from your wifi network, with your phone and openaps rig in your pocket
JohnDoeAkira
@JohnDoeAkira
Jun 26 2018 22:13
I have just disabled the wifi on the rig with : iwconfig wlan txpower off
Martin Haeberli
@mhaeberli
Jun 26 2018 22:14
ok so now is it working on BT? or soon?
also watch the logs for a few minutes while this is getting set up
i assume also that you’re using your real BT address vs 'AA:BB:CC:DD:EE:FF '
did you tell your rig to ‘trust’ your phone?
JohnDoeAkira
@JohnDoeAkira
Jun 26 2018 22:15
yes I replaced it with the correct MAC adress. And I also trusted the rig
JohnDoeAkira
@JohnDoeAkira
Jun 26 2018 22:16
yes i do ... I try at least ;-)
Martin Haeberli
@mhaeberli
Jun 26 2018 22:17
so at the step ‘Testing to make sure it works…’ ,after you do sudo bt-pan client … andsudo dhclient bnep0
then run ifconfig bnep0
try pinging 8.8.8.8 (google public DNS) and/or something like ping www.apple.com
just to make sure dns and routing works through your phone
then disconnect
JohnDoeAkira
@JohnDoeAkira
Jun 26 2018 22:18
OK I try that. Give me a mn
yes it pings !
Looks like my phone is not very BT tethering compliant ...
at least with openAPS
Martin Haeberli
@mhaeberli
Jun 26 2018 22:20
ok pinging is good
only suggestions i have are: a) try some alternate ‘additional apps’ for Android; and/or try additional troubleshooting steps...
(i’m in iPhone heck, not in Android heck, so I can’t really help at that point)
but it would be interesting to see what errors you get in the logs
JohnDoeAkira
@JohnDoeAkira
Jun 26 2018 22:25
In which logs ? /var/log/messages just says that data cannot be uploaded to NS.
Martin Haeberli
@mhaeberli
Jun 26 2018 22:26
just type ‘l’ at your console
it will show you the logs
from loop
including connection attempts
JohnDoeAkira
@JohnDoeAkira
Jun 26 2018 22:30
I tried but could not identiy a network error. The rig is looping happily.
Martin Haeberli
@mhaeberli
Jun 26 2018 22:30
that’s a lower case L
hmm
what is your CGM source? (ours is through Share / Nightscout so we don’t work without a network)
JohnDoeAkira
@JohnDoeAkira
Jun 26 2018 22:31
CGM are enlite sensors. I get the BG directly from the medtronic 722 pump.
Martin Haeberli
@mhaeberli
Jun 26 2018 22:31
‘course - I see why that can work with no network
JohnDoeAkira
@JohnDoeAkira
Jun 26 2018 22:32
:smile:
Alright ... I have to go. Thanks for your help. I'll resume my BT quest tomorrow (late EU time here)
Martin Haeberli
@mhaeberli
Jun 26 2018 22:37
good luck!