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

1st
Jun 2018
Ashley112885
@Ashley112885
Jun 01 2018 06:40
TypeError: Cannot read property 'map' of undefined at detectCarbAbsorption (/root/src/oref0/lib/determine-basal/cob.js:8:39) at /root/src/oref0/lib/meal/total.js:68:39 at Array.forEach (native) at recentCarbs (/root/src/oref0/lib/meal/total.js:46:16) at generate (/root/src/oref0/lib/meal/index.js:20:19) at Object.<anonymous> (/root/src/oref0/bin/oref0-meal.js:97:23) at Module._compile (module.js:577:32) at Object.Module._extensions..js (module.js:586:10) at Module.load (module.js:494:32) at tryModuleLoad (module.js:453:12)
can't seem to get 0.7.0 working with Logger, getting the above error, and ideas??
henghayan
@henghayan
Jun 01 2018 07:06
I use PuTTY to connect Pi
Error: Unable to open connection to raspberrypi.local
Martin Haeberli
@mhaeberli
Jun 01 2018 07:13
Try without the .local ; sometimes that works
henghayan
@henghayan
Jun 01 2018 07:22
I have a question. Do my computer need to link to the WiFi launched by Pi before connecting to SSH?
I put wpa_supplicant.conf in the SDcard directory ,right?
Martin Haeberli
@mhaeberli
Jun 01 2018 07:27
Yes, computer must be on same Wi-Fi network.
Empty file called ‘ssh’ AND ‘wpa_supplicant.conf’ both must be placed in top level of SD card after flashing.
henghayan
@henghayan
Jun 01 2018 07:34
So does it mean that it's my computer which is receiving Wifi emitted by Pi
Every time I insert a PI, I take it out and put it on my computer, the SSH disappears.
Martin Haeberli
@mhaeberli
Jun 01 2018 07:59
I don’t know about ssh file disappearing. I’ll have to try ya experiment some other time.
But as to WiFi: it’s not so much that your computer receives Wi-Fi emitted by Pi.
It’s more that your computer and Pi should BOTH connect to the same WiFi router.
Martin Haeberli
@mhaeberli
Jun 01 2018 08:04
If in doubt, it’s good to try to set up Pi with cables, keyboard, display, maybe a mouse. You can use a Pi zero wh if you have the sight cables, or you can use a Pi 3 for testing, though in my experience full looping with hat doesn’t work because of some issues with reporting battery charge status .
But at least you can check that it’s booting, and make sure it talks to the network and connects via ssh
henghayan
@henghayan
Jun 01 2018 08:17
Thank you for your advice. I am still confused how I can connect Pi to my Wifi? Can you help me with that?
hamishsprocket
@hamishsprocket
Jun 01 2018 08:21

I am trying to install oref0 on my backup rig. It was flashed a while back (8 weeks) and I'm currently unable to complete running the setup script. I am stuck on the following error: E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
Running apt-get upgrade
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
Running apt-get autoclean
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
Removing any existing ns device:
Running nightscout autoconfigure-device-crud https://sprocketsnightscout.herokuapp.com hamishsprocket44
Traceback (most recent call last):
File "/usr/local/bin/openaps", line 170, 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", line 154, in run
elif builtins.is_builtin(args.command):
File "/usr/local/lib/python2.7/dist-packages/openaps/builtins.py", line 54, in is_builtin
app.read_config( )
File "/usr/local/lib/python2.7/dist-packages/openaps/cli/init.py", line 69, in read_config
self.config = config.Config.Read(cfg_file)
File "/usr/local/lib/python2.7/dist-packages/openaps/config.py", line 62, in Read
config.read(name)
File "/usr/lib/python2.7/ConfigParser.py", line 305, in read
self._read(fp, filename)
File "/usr/lib/python2.7/ConfigParser.py", line 546, in _read
raise e
ConfigParser.ParsingError: File contains parsing errors: openaps.ini

    [line 366]: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00[DEFAULT]\n'

Traceback (most recent call last):
File "/usr/local/bin/openaps", line 170, 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", line 154, in run
elif builtins.is_builtin(args.command):
File "/usr/local/lib/python2.7/dist-packages/openaps/builtins.py", line 54, in is_builtin
app.read_config( )
File "/usr/local/lib/python2.7/dist-packages/openaps/cli/init.py", line 69, in read_config
self.config = config.Config.Read(cfg_file)
File "/usr/local/lib/python2.7/dist-packages/openaps/config.py", line 62, in Read
config.read(name)
File "/usr/lib/python2.7/ConfigParser.py", line 305, in read
self._read(fp, filename)
File "/usr/lib/python2.7/ConfigParser.py", line 546, in _read
raise e
ConfigParser.ParsingError: File contains parsing errors: openaps.ini

    [line 366]: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00[DEFAULT]\n'

Traceback (most recent call last):
File "/usr/local/bin/openaps", line 170, 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", line 154, in run
elif builtins.is_builtin(args.command):
File "/usr/local/lib/python2.7/dist-packages/openaps/builtins.py", line 54, in is_builtin
app.read_config( )
File "/usr/local/lib/python2.7/dist-packages/openaps/cli/init.py", line 69, in read_config
self.config = config.Config.Read(cfg_file)
File "/usr/local/lib/python2.7/dist-packages/openaps/config.py", line 62, in Read
config.read(name)
File "/usr/lib/python2.7/ConfigParser.py", line 305, in read
self._read(fp, filename)
File "/usr/lib/python2.7/ConfigParser.py", line 546, in _read
raise e
ConfigParser.ParsingError: File contains parsing errors: openaps.ini

    [line 366]: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00[DEFAULT]\n'

Could not run nightscout autoconfigure-device-crud

Martin Haeberli
@mhaeberli
Jun 01 2018 08:28
@henghayan best advice I can give from here: a) flash the SD; b) create empty ssh file at root of SD; c) create correct wpa_supplicant.conf file and copy to root of SD; d) eject SD; e) insert SD in RPi and then plug RPi into power.
RPi should connect to WiFi and then you should be able to connect w putty.
But IF your WiFi network is somewhat locked down, like at an office or coffee shop, this might not work.
henghayan
@henghayan
Jun 01 2018 08:30
@mhaeberli thanks!!!!!!!!
Martin Haeberli
@mhaeberli
Jun 01 2018 08:30
If you’re on a router at home, it probably should.
If none of this works, attach monitor, keyboard, mouse to RPi before booting. Then at least someone can advise from there.
IF you have a network scanning tool and know how to use it, scan just your local WiFi network before you turn on the RPi, and again 5 minutes AFTER you turn on the RPi. The RPi should show up as a new IP address on the network. You can putty to pi@<new IP address> , like pi@192.168.1.37, if that is the address..
Laura Whitted
@NAGW322
Jun 01 2018 14:59

Can anyone help me correct this?
login as: root
root@Jarvis's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu May 31 23:53:47 2018 from 192.168.1.245
root@Jarvis:~# l
Temp refreshed: monitor/temp_basal.json: {"duration":0,"rate":0.375,"temp":"abso lute"}
enact/smb-enacted.json: "Rate: 0.375 Duration: 30"
Temp refreshed: monitor/temp_basal.json: {"duration":30,"rate":0.375,"temp":"abs olute"}
No bolus needed. glucose.json newer than pump_loop_completed
git fetch failed
Your instance of oref0 [0.6.0, master] is out-of-date by 125 commits: you may wa nt to consider updating.
Please make sure to read any new documentation and release notes that accompany the update.
Completed oref0-pump-loop at Fri Jun 1 06:35:16 EDT 2018

Starting oref0-pump-loop at Fri Jun 1 06:35:31 EDT 2018 with 2 second waitfor silence:
Waiting up to 4 minutes for new BG: glucose.json newer than pump_loop_completed
Radio ok. Listening: .No interfering pump comms detected from other rigs (this i s a good thing!)
Preflight OK. Profile less than 60m old; Profile valid. Refreshed pumphistory an d meal.json
Checking pump clock: "2018-06-01T06:36:09-04:00" is within 90s of current time: Fri Jun 1 06:36:00 EDT 2018
Temp refreshed
Autotune exists! Hoorah! You can use microbolus-related features.
{"carbs":0,"nsCarbs":0,"bwCarbs":0,"journalCarbs":0,"mealCOB":0,"currentDeviatio n":4.19,"maxDeviation":1.86,"minDeviation":-17.34,"slopeFromMaxDeviation":0,"slo peFromMinDeviation":10.47,"allDeviations":[4,-7,-17,-5,-4,2],"lastCarbTime":0,"b wFound":false}
{"iob":0.046,"activity":0.0013,"basaliob":0,"bolusiob":0.046,"netbasalinsulin":0 ,"bolusinsulin":0.7,"time":"2018-06-01T10:36:13.000Z","iobWithZeroTemp":{"iob":0 .046,"activity":0.0013,"basaliob":0,"bolusiob":0.046,"netbasalinsulin":0,"bolusi nsulin":0.7,"time":"2018-06-01T10:36:13.000Z"},"lastBolusTime":1527836272000,"la stTemp":{"rate":0.375,"timestamp":"2018-06-01T06:35:21-04:00","started_at":"2018 -06-01T10:35:21.000Z","date":1527849321000,"duration":1.76}}
{"delta":0,"glucose":128,"noise":2,"short_avgdelta":1.61,"long_avgdelta":-5.86," date":1527849337333}
Autosens ratio: 1.19; Adjusting basal from 0.4 to 0.475; ISF from 132 to 110.9; CR: 12.485
currenttemp: { duration: 30, rate: 0.375, temp: 'absolute' } last

I must've tried to paste too much & all the logs didn't make it onto gitter. Here's the last of the loop logs
Starting oref0-pump-loop at Fri Jun 1 06:40:02 EDT 2018 with 12 second wait_for_silence:
Waiting up to 4 minutes for new BG: glucose.json newer than pump_loop_completed
Radio ok. Listening: .No interfering pump comms detected from other rigs (this is a good thing!)
Preflight OK. Profile less than 60m old; Profile valid. Refreshed
Error: ENOSPC, no space left on device
at Object.fs.writeSync (fs.js:537:18)
at SyncWriteStream.write (fs.js:1749:6)
at Console.log (console.js:53:16)
at Object.<anonymous> (/home/.rootfs/usr/local/lib/node_modules/oref0/bin/oref0-calculate-iob.js:67:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
pumphistoryWarning: could not parse monitor/glucose.json

/home/.rootfs/usr/local/lib/node_modules/oref0/lib/determine-basal/cob.js:8
glucose_data = inputs.glucose_data.map(function prepGlucose (obj) {
^
TypeError: Cannot call method 'map' of undefined
at detectCarbAbsorption (/home/.rootfs/usr/local/lib/node_modules/oref0/lib/determine-basal/cob.js:8:40)
at recentCarbs (/home/.rootfs/usr/local/lib/node_modules/oref0/lib/meal/total.js:101:13)
at generate (/home/.rootfs/usr/local/lib/node_modules/oref0/lib/meal/index.js:20:19)
at Object.<anonymous> (/home/.rootfs/usr/local/lib/node_modules/oref0/bin/oref0-meal.js:97:23)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
and meal.json
Checking

Ashley112885
@Ashley112885
Jun 01 2018 15:06
@NAGW322 I just had this same problem, after a few hours it resolved itself, not the best answer but perhaps yours will do the same
Laura Whitted
@NAGW322
Jun 01 2018 15:08
@Ashley112885 My son's stopped looping approx 20 hrs ago. It resolved itself 5 hrs ago, but didn't last. We're back to not looping.
garykidd
@garykidd
Jun 01 2018 15:17
noticed that rif requires restart after leaving wifi and going BT...get continual preflight fails until I manually restart. What exactly is preflight checking and what causes it to fail?
kelseyyearick
@kelseyyearick
Jun 01 2018 15:47
@scottleibrand I am not seeing any missing information in my autotune directory but neither isf adjustments or carb ratio are changing, only basals.
Ashley112885
@Ashley112885
Jun 01 2018 15:55
Any ideas how to resolve “Looped NaN mins ago” with offline webpage? How do I change NaN to a number?
Martin Haeberli
@mhaeberli
Jun 01 2018 15:58
@Ashley112885 - this probably doesn’t help, but NaN is geek-speak for ‘not a number’ - basically, the thing that is trying to print ‘Looped 3 mins ago’ or some such has an invalid value, a ‘NaN’, rather than a valid number, like 3, as an input. As to the root cause, i don’t know.
Scott Leibrand
@scottleibrand
Jun 01 2018 15:58
@NAGW322 “no space left on device” means your rig has a fill disk. There is a troubleshooting page for that.
Martin Haeberli
@mhaeberli
Jun 01 2018 15:58
one minor suggestion- probably not relevant here, but try making sure your MongoDB is not full - see tips in oref0 troubleshooting about that
Scott Leibrand
@scottleibrand
Jun 01 2018 16:00
@hamishsprocket did you try running the dpkg command it suggested?
Diabetic_Dude
@diabetic_dude_twitter
Jun 01 2018 16:02
I am getting the following error when trying to run the bootstrap script
Scanning for wifi networks:
Ignoring unknown interface wlan0=wlan0.
Failed to connect to non-global ctrl_ifname: (null) error: No such file or directory
I think my edison board may be going bad, I am pretty sure my OTG port is fried.
Laura Whitted
@NAGW322
Jun 01 2018 16:03
@scottleibrand I'm on that troubleshooting page now, and I've been trying to follow the instructions there, but with no luck. I'm still doing something wrong.
Scott Leibrand
@scottleibrand
Jun 01 2018 16:23
How much space is free? What have you tried deleting?
Laura Whitted
@NAGW322
Jun 01 2018 16:25
I haven't gotten even that far. The instructions just aren't making sense to me. :(
john36m
@john36m
Jun 01 2018 16:26
I haven't been following here for a while, but today I noticed an inconsistency in the docs in the section adding more wifi... http://openaps.readthedocs.io/en/latest/docs/Customize-Iterate/on-the-go-wifi-adding.html The doc says that " Simply enter edit-wifi (which is a shortcut command for nano /etc/wpa_supplicant/wpa_supplicant.conf" However, on the rig I just set up this morning the alias edit-wifi opened up vi instead. My old rig which I just updated a few days ago still has it using nano. Linux users have debated about the best text editor for decades, and I have no personal preference. However, nano is kind of self instructing, while vi requires you to actually remember the commands.
Ashley112885
@Ashley112885
Jun 01 2018 16:28
So the offline webpage NaN issue is only a problem on my phone, working on my PC ok 🤷‍♀️
Zakm0n
@Zakm0n
Jun 01 2018 16:33
So, I just started using logger, and I'm trying to find a way to show sensor status in night scout. I feel like I'm overlooking something here.
Scott Leibrand
@scottleibrand
Jun 01 2018 16:58
@john36m nano behaves really badly over serial console unless your window is exactly 80 characters wide. So we switched that one command to vi, which is more forgiving. Docs probably need updated, if you can PR them.
@NAGW322 don’t just complain or give up. Ask specific questions. Tell us what you’ve tried, and what it did, and what your next question is.
Dana Lewis
@danamlewis
Jun 01 2018 17:18
@Ashley112885 could you comment on openaps/oref0#979 and note that phone/PC difference? Thanks!
Laura Whitted
@NAGW322
Jun 01 2018 17:22
@scottleibrand I apologize if I sounded like I was complaining! I went back over to Facebook as Tynbendad Dadtynben was walking me through it there. Honestly, I don't even know what I tried until about 30 minutes ago when I went back to FB. I've been running high fevers for 3 days and just had a break from it this morning finally - so I think I've just been out of it. Anyway, he got us up and running again. Everyone's help is very much appreciated!
Dana Lewis
@danamlewis
Jun 01 2018 17:23
@Zakm0n might want to ask in the xdripjs gitter channel?
Dana Lewis
@danamlewis
Jun 01 2018 17:31
@NAGW322 glad you got it sorted - thanks for letting us know here it was resolved. Glad you're feeling better too
Dana Lewis
@danamlewis
Jun 01 2018 17:47
@Ashley112885 thx!
john36m
@john36m
Jun 01 2018 17:47
@scottleibrand Just proposed my first PR on the vi editor for adding new wifi
garykidd
@garykidd
Jun 01 2018 17:57
what is actually being checked with pre-flight?
Laura Whitted
@NAGW322
Jun 01 2018 18:10
@danamlewis thank you!
so it's just asking the pump for its model number
openaps report invoke settings/model.json
garykidd
@garykidd
Jun 01 2018 18:53
so if it fails it means there's some form of communications issue......but I was able to use Termius to ssh into rig successfully...was stuck for a while .
garykidd
@garykidd
Jun 01 2018 19:11
I've had this happen a couple time on 0.7.0 but not sure it's related to running this version or not. I guess I should check network.log when I get home.
make sense?
Zakm0n
@Zakm0n
Jun 01 2018 19:24
Ok, maybe this question will fit in here. How do you edit the shortcuts like edit-pref?
Scott Leibrand
@scottleibrand
Jun 01 2018 19:26
@garykidd network.log is for rig to Internet connectivity. a preflight fail is inability to talk to the pump
garykidd
@garykidd
Jun 01 2018 19:27
right---got it (now)
Scott Leibrand
@scottleibrand
Jun 01 2018 19:27
@Zakm0n vi ~/.bash_profile or nano ~/.bash_profile
garykidd
@garykidd
Jun 01 2018 19:27
Does it seem strange that a manual restart fixes it
?
Scott Leibrand
@scottleibrand
Jun 01 2018 19:28
what do the LEDs do when it's having preflight failures?
you might want to carefully reseat the Edison on the EB
and/or try ccprog
garykidd
@garykidd
Jun 01 2018 19:30
ccprog seems like overkill when holding the microswitch down is so easy though
Scott Leibrand
@scottleibrand
Jun 01 2018 19:31
I meant to hopefully fix it so it doesn't go into the needs-reboot state
garykidd
@garykidd
Jun 01 2018 19:36
deosnt it ccprog anyway if it doesnt connect after awhile (or just mmtune)?
Dana Lewis
@danamlewis
Jun 01 2018 19:56
@john36m I didn't see the PR come through, can you double check? You might've PR'd from yourself to yourself?
Scott Leibrand
@scottleibrand
Jun 01 2018 20:04
@garykidd it just mmtunes. ccprog actually re-flashes the cc1110 chip's firmware. I haven't seen intermittent failures caused by the cc1110 firmware going bad, but we have seen full hard failures fixed that way, so it might be worth a shot.
john36m
@john36m
Jun 01 2018 20:26
@danamlewis Like I said, my first PR. I'll look.
Dana Lewis
@danamlewis
Jun 01 2018 20:32
Just came in - thanks!
john36m
@john36m
Jun 01 2018 20:32
@danamlewis I quit following the instructions too soon.