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

18th
Sep 2016
Tim Street
@tim2000s
Sep 18 2016 00:03
@scottleibrand I've tried pretty much everything. The only thing it does is obtain a spurious 81...* Address that I don't know.
Scott Leibrand
@scottleibrand
Sep 18 2016 00:16
Odd. Who does that address belong to (do a Whois lookup)?
And what does your /etc/network/interface file have for that interface?
Russell Gardner
@RussGG
Sep 18 2016 00:52
I will only be pulling numbers from Nightscout. Am I correct that I need to remove reports/aliases/bewest-aliases that I have in my OpenAPS instance that are trying to pull cgm data and then change them to look at entries? IE: monitor/glucose.json JSON ns shell get entries.json
garykidd
@garykidd
Sep 18 2016 01:45
@RussGG that's right...but I think there is one other alias you need to amend as well
maybe its the raw-cgm/glucose-raw.json -->monitor/glucose.json...otherwise the gather-clean-data and do-everything...get tripped up.
can someone point me in the right direction for setting up/troubleshooting wifi and BT.....
garykidd
@garykidd
Sep 18 2016 03:02
So finally got my hotspot working with pi..only through wifi though...and I can connect pi via BT...not automatically though...but when I can connect via BT---cant get hotspot to work...I get Paired succesf successfully ully, but device has no services that can be used with Raspberry PI.....any ideas guys?
Andrew Warrington
@andrew-warrington
Sep 18 2016 06:27
Random: Woke up in a panic this morning - had a dream that my CGM sensors wouldn't insert properly; ran through my last 3 of them trying; was left without CGM and APS. lol. #diabeticnightmares. Reminds me of my weird thought process when watching an apocalypse movie - need solar energy & portable refrigeration & raid as many pharmacies as possible for insulin & glucose tablets, at least to make it through until the expiry date on the boxes...
Scott Leibrand
@scottleibrand
Sep 18 2016 09:00
@PieterGit you're using the Carelink with oref0-setup.sh, not mmeowlink?
PieterGit
@PieterGit
Sep 18 2016 09:04
i'm now trying with carelink. i had problems with the mmeowlink /ti-stick, but completely reinstalled from scratch now. setup G4/nightscout/advanced features autosens meal
Scott Leibrand
@scottleibrand
Sep 18 2016 09:04
@PieterGit can you try cd ~/src/oref0 && git checkout oref0-setup && git pull and then run it again?
I just pushed a fix
PieterGit
@PieterGit
Sep 18 2016 09:04
will try
nope, fails with ConfigParser.DuplicateSectionError: Section 'device "pump"' already exists
Can't add pump. I created a new directory
Scott Leibrand
@scottleibrand
Sep 18 2016 09:08
ah, one more thing I need to do then
PieterGit
@PieterGit
Sep 18 2016 09:08
will try later, AFK
Scott Leibrand
@scottleibrand
Sep 18 2016 09:10
fix for that pushed too. you can pull the latest oref0-setup branch again to test when you're back.
and then if that looks good, please comment on openaps/oref0#214 and I'll merge it to dev.
PieterGit
@PieterGit
Sep 18 2016 09:41
thanks scott. that looks ok afaict. I hit another problem openaps/oref0#215 in my never-ending openaps adventure :smile:
Tim Street
@tim2000s
Sep 18 2016 15:02
@scottleibrand This is the /etc/network/interfaces file
auto lo
iface lo inet loopback

iface eth0 inet manual 

allow-hotplug wlan0

iface wlan0 inet dhcp 
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


allow-hotplug wlan1
iface wlan1 inet manual 
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Tim Street
@tim2000s
Sep 18 2016 15:09
When I run whois against it, it tells me it's an IP address provided by the company that gives me my broadband, which is why it's rather odd.
Tim Street
@tim2000s
Sep 18 2016 15:31
When I check the router logs I can't see a request from the Pi for a DHCP lease either. All rather odd.
Eric
@ecc1
Sep 18 2016 16:00
Those of you who have traveled with your rigs: do you turn them off during flight, or just the RF to the pump, or ... ?
(That's assuming you got the mess of wires and blinking LEDs past TSA :-)
Mike
@libxmike
Sep 18 2016 17:27
@ecc1 i heard people don't have a problem traveling with it, also keeping on while on board, what not, it won't explode or bring the giant bird down :)
garykidd
@garykidd
Sep 18 2016 17:28
@scottleibrand is there anything I can amend here that might make my rig connect to wifi or BT while not connected to my home network..here's my crontab.....
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
* * * * * sudo wpa_cli scan
#* * * * * /home/pi/bin/check-and-connect-bt-pan.sh

*/5 * * * * (cd /home/pi/APS301 && time openaps do-everything) 2>&1 | logger -t openaps-loop


#######################################################################################################################################################################################################################
#                                                            SCOTT LEIBRAND SCRIPT CRON
#* * * * * sudo wpa_cli scan
#* * * * * killall -g --older-than 10m openaps
#* * * * * cd /home/pi/src/APS401 && oref0-reset-git
#* * * * * cd /home/pi/src/APS401 && ps aux | grep -v grep | grep -q 'openaps get-bg' || ( date; openaps get-bg ; cat cgm/glucose.json | json -a sgv dateString | head -1 ) | tee -a /var/log/openaps/cgm-loop.log
#* * * * * cd /home/pi/src/APS401 && ps aux | grep -v grep | grep -q 'openaps ns-loop' || openaps ns-loop | tee -a /var/log/openaps/ns-loop.log
#* * * * * cd /home/pi/src/APS401 && ( ps aux | grep -v grep | grep -q 'openaps pump-loop' || openaps pump-loop ) 2>&1 | tee -a /var/log/openaps/pump-loop.log
Tim Mecklem
@tmecklem
Sep 18 2016 18:29
The rig has to be safer than a Galaxy Note 7 :laughing:
Eric Jensen
@elnjensen
Sep 18 2016 19:13

@tmecklem said:

I’ve been thinking about using and adapting some of the LoopKit frameworks to do BLE serial to the edison and keep from having to fuss with hotspots

Do you have G4 or G5? I'm very interested to trying to adapt the Loopkit / xDripG5 code to Linux, to try to be able to get BG offline from G5. But right now it's just a dream, and definitely beyond my programming experience.

Tim Mecklem
@tmecklem
Sep 18 2016 19:14
We will soon have both. We're switching to the G5 t on the G4 for a while longer.
I believe the loop kit code uses the dex share 2 apps data and doesn't collect the data directly from the dex itself.
I also have some learning to do.
Eric Jensen
@elnjensen
Sep 18 2016 19:18
I think that's true, but this library does listen to the transmitter and collect BG values in real time.
If one could port that to Linux, you'd have a mobile G5 solution. It's essentially acting as another receiver.
One would have to figure out how to translate the iOS/Swift BLE library calls into the corresponding thing on Linux.
Tim Street
@tim2000s
Sep 18 2016 19:25
Well, I've tried just about everything on the pi wifi issues and nonebof it has worked. Think I'll need a rebuild.
Tim Mecklem
@tmecklem
Sep 18 2016 19:49
The trouble I've had with Linux is not with the data, but with the bluez complications and extreme flakiness.
I think the openxshareble work is great, but I could not get it happy because of the state of Bluetooth on Linux. It's still just too messy to set up and keep working.
Scott Leibrand
@scottleibrand
Sep 18 2016 19:55
same. @jasoncalabrese got it reliable somehow, but it hasn't been very good for us.
Tim Mecklem
@tmecklem
Sep 18 2016 19:55
I'm looking to do an end run around it all with something like Adafruit's bluefruit ble breakout that uses an at command set sort of approach over serial
At least as an intermediate step
Ironically, the thing slowing me down the most is that I'm not the openaps looper in the family, so I don't have access to the dex and pump unless my wife is around :)
Scott Leibrand
@scottleibrand
Sep 18 2016 20:00
@ecc1 we never turn off any of our electronics in-flight. there is zero evidence they cause any risk to in-flight systems. All those regulations are legacy from back when we had analog and first-gen digital phones that broadcasted at 10x or higher power, and in different bands that interfered more with speaker systems etc.
Tim Street
@tim2000s
Sep 18 2016 20:26
👍👍👍 Scott. Agree.
Mike
@libxmike
Sep 18 2016 20:28
@scottleibrand are you behind explorer board project?
John Benjamin
@Bender1061
Sep 18 2016 20:43
does anyone know what is required to use your APS rig as your nightscout cgm uploader to nightscout? I am using the mmconnect for my 530G but I'm trying to get everything on my 722 so I don't need to carry two pumps.
Scott Leibrand
@scottleibrand
Sep 18 2016 20:48
@Bender1061 check out the oref0 wiki page on the topic. It does a lot of other stuff with openxshareble, but you can skip that part to do it from CGM over USB. If you're talking about MDT CGM, the steps will be different though.
@libxmike one of the people behind it from the openaps side of things, yes.
Mike
@libxmike
Sep 18 2016 20:49
@scottleibrand just wondering when would be available
Dana Lewis
@danamlewis
Sep 18 2016 20:52
@libxmike waiting to hear from sparkfun in the next few weeks
Mike
@libxmike
Sep 18 2016 20:53
@danamlewis excellent, thanks, then I'll finish building my rig based on Pi Zero and CareLink first
Eric
@ecc1
Sep 18 2016 20:56

I've been looping using BLE to Dexcom G4, so effectively offline, except that it uploads the data to NS on each loop when possible.
The BLE code is similar to openxshareble, but I learned a few things that may make it more reliable. In particular, if the device shows up as "known" (by the BT adapter) but not connected, then you have to remove it and re-discover it, otherwise the authentication protocol will fail. Here's the relevant part of the code I use:
https://github.com/ecc1/dexcom/blob/master/share.go#L60

It will still usually time out the first couple of times after coming back in range, but otherwise it's been pretty solid for me.

garykidd
@garykidd
Sep 18 2016 21:37
is this the right order ..or what most people choose showing mobile hotspot wifi first then home network within wpa_supplicant.conf?
sudo cat wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
    ssid="[MOBILE HOTSPOT]"
    psk="[############]"
    key_mgmt=WPA-PSK
}

network={
    ssid="[HOME NETWORK]"
    psk="[##########]"
    key_mgmt=WPA-PSK
}
I can only seem to get my [HOME NETWORK] access automatically.... though if I boot pi (with monitor attached) I can connect manually to [HOME NETWORK] or [MOBILE HOTSPOT]. And still can't get mobile hotpost to connect via BT. Anyone got any ideas I can try?
Mike
@libxmike
Sep 18 2016 21:44
@garykidd this works for me
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev 
update_config=1
country=GB


network={
        ssid=“mobile_AP”
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk=“xxxx”
        id_str="mobile"
        priority=5
}
network={
        ssid=“home_AP”
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk=“xxxxxxxxxx”
        id_str="home"
        priority=5
}
and that my /etc/network/interfaces
auto wlan0
iface wlan0 inet manual
        wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface mobile inet dhcp
iface home inet dhcp
iface default inet dhcp
Mike
@libxmike
Sep 18 2016 21:51
works automatically for both
John Benjamin
@Bender1061
Sep 18 2016 22:09
@scottleibrand Maybe I'm misunderstanding you but what I'm trying to figure out is how to send the cgm data (which is easy enough to read with my openaps rig, but I need to learn how to send that data to Nightscout. And where exactly is this wiki you are talking about the oref wiki, all i see in there is about the setup.sh file.
Scott Leibrand
@scottleibrand
Sep 18 2016 22:18
oh, maybe it's in the openaps/docs wiki
back on my PC, let me get you a link
@libxmike wpa-roam isn't strictly necessary there. you can do iface wlan0 inet dhcp and wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf and skip the three following lines
wpa-roam just lets you share a config between wlan0 and eth0, so unless you commonly plug in at home it does you no good
and most people forget the iface foo inet dhcp parts, so it ends up not properly switching for them
John Benjamin
@Bender1061
Sep 18 2016 22:26
Thanks @scottleibrand that make a lot more sense, I'll see what I can do with it. Thank you.
garykidd
@garykidd
Sep 18 2016 22:31
thanks @libxmike and for BT...any tips--I cant get it to work for the life of me despite a BT connection.
garykidd
@garykidd
Sep 18 2016 22:42
pi@raspberrypi:/etc/network $ cat interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
@scottleibrand DOes this above look correct ^ ?
and with amended wpa_supplicant.ocnf per below.....
pi@raspberrypi:/etc/wpa_supplicant $ sudo cat wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
        ssid=“Mobile Hotspot”
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk=“££££££££££££”
        id_str="mobile"
        priority=5
}
network={
        ssid=“Home Network 1”
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk=“££££££££££££££££”
        id_str="home"
        priority=5
}
network={
        ssid=“Home Network 2”
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk=“££££££££££££££££”
        id_str="home2"
        priority=5
}
PieterGit
@PieterGit
Sep 18 2016 22:49
I can remember some screenshots with nightscout 0.9 of a purple line showing oref0/openaps prediction of the bg in future (instead of AR2). i can't find any reference to it. Can anybody help me? is it possible to configure that with the new oref0-setup.sh script somehow to visualize the future bg trend?
PieterGit
@PieterGit
Sep 18 2016 23:01
found it myself. https://github.com/openaps/docs/pull/176/files
ENABLE="openaps pump basal pushover maker careportal iob bwp raw"
SHOW_FORECAST="openaps ar2"
DEVICESTATUS_ADVANCED=true
PUMP_WARN_BATT_V=1.39
PUMP_FIELDS="battery reservoir status"
(and yes! it works with my oref0-setup.sh install)
Scott Leibrand
@scottleibrand
Sep 18 2016 23:08
:-)
@PieterGit just pushed your mmol/L support changes, and am testing them for backwards compatibility now
PieterGit
@PieterGit
Sep 18 2016 23:11
i'll test tommorow. for now i'm happy with a loop that works without enacting. i probably changed a couple of things, but will find out what when i create a openaps instance with a fresh checkout. thanks for all the good software. it's great (but a steep learning curve)
Scott Leibrand
@scottleibrand
Sep 18 2016 23:12
still working on flattening the non-essential parts of the learning curve. in addition to oref0-setup.sh, will be trying to make it a lots easier to flash an Edison and get all the prerequisite software installed
PieterGit
@PieterGit
Sep 18 2016 23:14
for some reasong the ti stick doesn't seem to work, perhaps a WW/US issue somewhere. can't bother for now, first want to have a working rig
Scott Leibrand
@scottleibrand
Sep 18 2016 23:17
did you find the directions for making mmeowlink do WW? if not, give that a shot when you're ready to poke at it again.
@PieterGit you forgot to add the _raw reports to the get-settings alias, so they're not getting refreshed
which also means the loop can't bootstrap them the first time (I assume you invoked them manually, so didn't notice that)
fixing in oref0-setup