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

21st
Mar 2019
Jon Cluck
@cluckj
Mar 21 02:47
(^ got it fixed, btw. was out of sync with bugfixes & stuff)
boc-the-git
@boc-the-git
Mar 21 10:55
@cluckj appreciate the openaps-menu change, I run it in nightandday mode. Do you have any thoughts on reversing burn in - is that even possible? I notice that I definitely do have some from the ~6 months I was running my rig prior to this change
Riko L
@Ricco555
Mar 21 13:59

@ecc1

light it on fire and switch to network-manager ?

Eric, do you have any good suggestion on using network-manager for switching wifi and BT connections and working with openaps?
I have some issues that I am unable to pinpoint . e.g. I've managed to migrate wpa configurations to network-manager (I hope) as the rig successfully connects to wifi. when out of range it will go to BT. The weird thing is that I am not sure if oref0-online has some influence in this, weather if it should have any influence. In network logs I see that oref0-online tries to cycle wlan0 interface, but isn't the point in using NM that it should do this instead of oref0-online? before disabling it (and I am unsure yet how or should I disable this) how do I make sure that I have set up NM correctly?
So after the above uncertainty : when migrating to NM, what did you do for it to work? I've removed wlan and bnep from /etc/network/interfaces and created SSID configurations for all wifi APs that the rig connects to in relevant NM folder. other than that, is there something else that needs to be done? like, add BT connection profile, or special configuration in openaps to disable oref0-online?
Sorry for the long text. Hope I am making myself coherent.

btw. we are now running pi-zero as a permanent home rig + edison as a mobile rig. They work great in tandem. The pi is working on ce1e867 dev commit and edison is working on d64c154.

Eric
@ecc1
Mar 21 15:27

@Ricco555 with network-manager the oref0-online script should be unnecessary. I completely removed /etc/network/interfaces and interfaces.d/, also the ifupdown package. You still have to connect once "manually" (using nmcli) to each WiFi network and once to your BT hotspot, but after that network-manager will remember all the required info.

The one thing I haven't tried to do is add a WiFi ESSID and password "ahead of time" without just connecting to it. I find myself just using a couple of known WiFi networks and using BT tethering everywhere else

emericsch1618
@emericsch1618
Mar 21 16:29

Hi,
i build my first rig.
I am stuck at "Installing OpenAPS on your rig" : at the end of Step 4 : setup script

I use that command : cd && ~/src/oref0/bin/oref0-setup.sh

I put my parameter.
I try the script 3 times and the script never ask to schedule a cron.

I got that message:

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/root/src/mraa/ already exists; Updating mraa source to stable release v1.7.0
HEAD is now at 8ddbcde... mraa: Update to v.1.7.0
You are not currently on a branch. Please specify which
branch you want to merge with. See git-pull(1) for details.

git pull <remote> <branch>

Couldn't pull latest mraa v1.7.0 release

Thx for your help,
Emeric

Scott Leibrand
@scottleibrand
Mar 21 16:32
try cd ~/src/oref0 && git checkout master (or dev)
Riko L
@Ricco555
Mar 21 17:05
@ecc1 thanks. I think because I didn't do exactly that, NM is not operating according to my expectations. So I'll try your suggestion. I was considering to use the wifi config ahead of time because the rig will be moving to a few locations and I wanted to have it ready for that. the BT I did not configure or add to NM, so I guess that is also one of the issues. oref0-online had a good thing to log the connections to network.log which is useful for me, so I might only change this script to log the connections and remove cycling the interfaces
emericsch1618
@emericsch1618
Mar 21 17:35
@scottleibrand console answering : Already on 'master'
Your branch is up-to-date with 'origin/master'.
Scott Leibrand
@scottleibrand
Mar 21 17:43
oh, sorry. it's mraa that's not on master. maybe just delete the /root/src/mraa/ (rm -rf /root/src/mraa/) and re-run setup
Eric
@ecc1
Mar 21 17:43
@Ricco555 you can also just do journalctl /usr/sbin/NetworkManager to see what it's been up to
viq
@viq
Mar 21 18:00
@ecc1 @Ricco555 I think that would be journalctl -u NetworkManager
Jacob H
@jdhigh
Mar 21 18:01
Hi all, I've flashed and freshly installed master oref0 on my edison. I'm now trying to install latest dev, but getting hung up at this error message: "Could not run nightscout autoconfigure-device-crud"
Any ideas for workaround?
viq
@viq
Mar 21 18:08
@jdhigh does it say anything more about it?
emericsch1618
@emericsch1618
Mar 21 18:10
@scottleibrand Perfect, that's work. Thanks ! Let's continue now.
Stargazer32584
@Stargazer32584
Mar 21 18:12
@cluckj In the evening, i have some errors on the rig. I think, the main problem is, that he looses his frequency. We need 868 Mhz. An 'echo $MEDTRONIC_FREQUENCY' gives nothing back. Do i 'export MEDTRONIC_PUMP_ID=grep serial ~/myopenaps/pump.ini | tr -cd 0-9 ' with 'mdt settings', he try to connect on 916 Mhz. After every reboot. An 'export MEDTRONIC_FREQUENCY=868.450' set it up to the correct frequency. Then, mdt settings and so on are correct. What is the problem ?
Jacob H
@jdhigh
Mar 21 18:15
Here's the code, minus the NS URL and API/rig sensitive info:
Building dependency tree
Reading state information... Done
Removing any existing ns device:
removed process://ns/nightscout/ns https://
Running nightscout autoconfigure-device-crud https://
added process://ns/nightscout/ns NIGHTSCOUT_HOST API_SECRET
error: sub is not defined
.extra.args |= sub("API_SECRET" ; "") 1 compile error
error: sub is not defined
.extra.args |= sub("NIGHTSCOUT_HOST" ; "https://") 1 compile error
Traceback (most recent call last):
File "/usr/local/bin/openaps-import", line 89, in <module>
app( )
File "/usr/local/lib/python2.7/dist-packages/openaps/cli/init.py", line 51 , in call
self.run(self.args)
File "/usr/local/bin/openaps-import", line 77, in run
candidates = json.load(args.input)
File "/usr/lib/python2.7/json/init.py", line 290, in load
**kw)
File "/usr/lib/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
Could not run nightscout autoconfigure-device-crud
root@:~# Could not run nightscout autoconfigure-device-crud
-bash: Could: command not found
viq
@viq
Mar 21 18:29
I'd have to look in the code, and I'm not by computer right now
Jacob H
@jdhigh
Mar 21 18:29
no prob. In the meantime, I'm going to update to latest nightscout.
Jacob H
@jdhigh
Mar 21 18:46
Ok, I've updated NS to latest version and I also went ahead and switched from API Secret to Token-based authentication (finally!). I reran setup to setup dev and still having the same error.
Stargazer32584
@Stargazer32584
Mar 21 18:55
@cluckj I installed it new. 25 minutes....everything alright...:-D
Jon Cluck
@cluckj
Mar 21 19:12
@boc-the-git no, not without replacing the hardware
@jdhigh can you do a git pull in your ~/src/oref0` directory? there was a bug which made that happen that we fixed
Jacob H
@jdhigh
Mar 21 19:17
ok I did the git pull and it says already up to day.
*date
Jon Cluck
@cluckj
Mar 21 19:24
oh, you're on an edison :)
you'll need to install the jessie-backports version of jq (>1.5)
apt-get -y -t jessie-backports install jq
Jacob H
@jdhigh
Mar 21 19:27
ok doing that now.
tzachi-dar
@tzachi-dar
Mar 21 19:35
@cluckj how should I check openaps/oref0#1225 should I install dev, and then apply the pr, or install the pr directly?
Jacob H
@jdhigh
Mar 21 19:40
@cluckj ok I'm rerunning dev setup now that I've installed the jessie-backports >1.5.
Jon Cluck
@cluckj
Mar 21 19:45
@tzachi-dar either is fine, my x12-fix branch is up to date with dev
tzachi-dar
@tzachi-dar
Mar 21 19:46
ok, so installing dev, then move to your branch.
Jon Cluck
@cluckj
Mar 21 19:47
:thumbsup:
the big changes in that PR are for oref0-setup (removing all the manual file editing), and in oref0-pump-loop (pulling all the settings/etc. from the pump)
so, running oref0-setup.sh from x12-fix will be considerably easier than running it from dev :)
tzachi-dar
@tzachi-dar
Mar 21 19:54
OK, so I'll run from your branch...
Jacob H
@jdhigh
Mar 21 19:55
@cluckj It successfully installed. I'll have to see about a pull request to update the docs for those who still use edison.
tzachi-dar
@tzachi-dar
Mar 21 19:55
Actually, not doing so, will not test everything...
Jacob H
@jdhigh
Mar 21 19:55
Hopefully my rig won't be trying to update my pump's clock every 15 minutes now.
Jon Cluck
@cluckj
Mar 21 20:03
@jdhigh I'm PRing a code change that should help
(about the jq thing)
Jacob H
@jdhigh
Mar 21 20:08
Oh that's terrific. Thank you!
mrboletmrpot
@mrboletmrpot
Mar 21 21:41
Hello! I'm trying to setup a pi0 with a rfm69, I found the tutorial in read the docs, but finally I've this error : mmtune: 2019/03/21 22:16:14 cannot connect to RFM69HCW radio on /dev/spidev0.0
2019/03/21 22:16:14 unexpected hardware version 0000 (should be 0204)
(I think I see the radio at ttyAMAO)
Any idea about my error?
tzachi-dar
@tzachi-dar
Mar 21 21:48
@cluckj setup has finished. pump is getting a basal value. How can I tell if everything is working? What should I verify?
tzachi-dar
@tzachi-dar
Mar 21 21:56
OK, compared the file profile.json, and here is what I have found:
carb ratio correct.
Or should I say: the carb ratios is correct: above it there is a line saying:
carb_ratio 10.
I have no idea what this line means and it does not fit what I would expect base on the time.
tzachi-dar
@tzachi-dar
Mar 21 22:02
isfProfile: pump has only one value and that was copied ok.
bg targets:
pump has the targets 80-120 file has both of them at 80 I THINK THIS ONE IS WRONG
max_bolus 5 is correct.
max_daily_basal 1.4 correct.
basal profile is correct.
anything else I should check?
mrboletmrpot
@mrboletmrpot
Mar 21 22:07
(edit : I see the radio at spidev 0.0 as normal)
Eric
@ecc1
Mar 21 22:12
@mrboletmrpot if it's saying spidev0.0 you're using code built for the old ("walrus") pin configuration. How exactly did you connect your rfm69 to the Pi?
Jon Cluck
@cluckj
Mar 21 22:15
@tzachi-dar thanks :D
if it's looping, it's working :laughing:
tzachi-dar
@tzachi-dar
Mar 21 22:18
@cluckj But what about the high target that was not copied correctly?
Jon Cluck
@cluckj
Mar 21 22:20
is that in bg_targets.json/bg_targets_raw.json? openaps uses the lower end of a target range
tzachi-dar
@tzachi-dar
Mar 21 22:22
bg_targets.json/bg_targets_raw.json got it correctly.
It is the profile.json that got it wrong.
Jon Cluck
@cluckj
Mar 21 22:25
can you paste the part that looks wrong?
tzachi-dar
@tzachi-dar
Mar 21 22:26
from profile.json
Jon Cluck
@cluckj
Mar 21 22:28
my 512 doesn't let me set ranges in the bolus wizard, only single targets
tzachi-dar
@tzachi-dar
Mar 21 22:30
"bg_targets": {
"units": "mg/dL",
"user_preferred_units": "mg/dL",
"targets": [
{
"i": 0,
"high": 80,
"start": "00:00:00",
"low": 80,
"offset": 0,
"x": 0,
"max_bg": 80,
"min_bg": 80
}
],
"first": 1
},
so the problem is that both of the high and low are 80.
Jon Cluck
@cluckj
Mar 21 22:31
are you able to set a target range on your pump?
tzachi-dar
@tzachi-dar
Mar 21 22:31
on the file bg_targets.json it looks like
{
"units": "mg/dL",
"user_preferred_units": "mg/dL",
"targets": [
{
"i": 0,
"high": 120,
"start": "00:00:00",
"low": 80,
"offset": 0,
"x": 0
}
],
"first": 1
}
yes, there is a range there.
Jon Cluck
@cluckj
Mar 21 22:33
what firmware version do you have?
@ecc1 ^
tzachi-dar
@tzachi-dar
Mar 21 22:34
Sorry, but I'm an idiot. It is a 722.
Scott Leibrand
@scottleibrand
Mar 21 22:35
unless you add a specific option to preferences.json, we ignore the pump high target and set the high and low targets both based on the pump high target
you should probably raise your low target to 100 or something
mrboletmrpot
@mrboletmrpot
Mar 21 22:35
Scott Leibrand
@scottleibrand
Mar 21 22:35
also, I just merged @cluckj's PRs to oref0 dev
tzachi-dar
@tzachi-dar
Mar 21 22:36
I have another 712, but that one is currently looping at real time, so all my tests have not being valid.
Jon Cluck
@cluckj
Mar 21 22:36
lol
tzachi-dar
@tzachi-dar
Mar 21 22:36
I'll retest tomorrow with the real 712.
Well, at least we know you did not break anything there...
Jon Cluck
@cluckj
Mar 21 22:37
whew :)
Eric
@ecc1
Mar 21 22:38
@mrboletmrpot unfortunately that scheme is neither of the ones supported by the Go rfm69 code
mrboletmrpot
@mrboletmrpot
Mar 21 22:41
too bad
so I bet I have to understand this one?
Eric
@ecc1
Mar 21 22:46
actually that's the old ("walrus") version. that works with a little effort, but as long as you're re-soldering it anyway, might as well use the new default (the Adafruit bonnet configuration): use pin 15 for DIO0, pin 22 for RESET, and pin 26 (SPI0 CE1) for chip select
mrboletmrpot
@mrboletmrpot
Mar 21 23:00
Should I just change the 3 you mention?
(I'm not sure, I don't find the adafruit bonnet configuration. Here I use on a pi zero without hat)
And what should I solder to "EN" on the rfm69?
mrboletmrpot
@mrboletmrpot
Mar 21 23:10
@ecc1 is there some clear schematics about those wires to solder? I would not make another mess
Eric
@ecc1
Mar 21 23:14
not that I know of, but pinout.xyz is a helpful site
EN is probably the same as (negated) RESET, hopefully
yes the other lines (SPI0 MISO, MOSI, and SCLK) are the same
mrboletmrpot
@mrboletmrpot
Mar 21 23:39
Mine is a bit different, I have G1 to G5 to connect
could it match dio0 and spio ce1?
Eric
@ecc1
Mar 21 23:47
dio0 = G0, you don't need to connect G1 through G5
and you don't need EN either, use RST, and connect CS to the SPI0 CE1 (Pi pin 26)
Dana Lewis
@danamlewis
Mar 21 23:50
@viq when you get a chance, will you paste that autosens sparkline visual example here too?
Eric
@ecc1
Mar 21 23:55
@mrboletmrpot and you have an antenna connected, right? (upper right corner of the picture you posted)
Riko L
@Ricco555
Mar 21 23:56

@ecc1 is there some clear schematics about those wires to solder? I would not make another mess

@mrboletmrpot I have the same breakout board and have used only 8 connections. Vin, Gnd, G0, Sck, MISO, MOSI, CS and RST. Mine is using old walrus connection, but the new one as @ecc1 suggested is preferable because installation of openaps is more straightforward. I can confirm, only change G0 to physical pin 15, CS to pin 26, and RST to 22.