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

25th
Apr 2019
Rebecca Drabenstott
@WhatWouldHoneyBadgerDo
Apr 25 01:23
My rig is online! I learned some things about my home network tonight. It has WEP encryption. So I edited the network in wpa_supplicant.conf to look like this:
network={
  ssid="mynetworkname"
  wep_key0="mynetworkpassword"
  wep_tx_keyidx=0
  key_mgmt=NONE
}
Jon Cluck
@cluckj
Apr 25 02:08
@Propelld are you installing dev or master?
Scott Leibrand
@scottleibrand
Apr 25 02:13
@WhatWouldHoneyBadgerDo time for a new home router! WEP is trivially hackable.
Natalia S.
@Propelld
Apr 25 02:21
Dev I beleive? I'm just following HAT steps.
Jon Cluck
@cluckj
Apr 25 02:23
are you using the same config options as your other HAT?
hmm, can you run jq --version?
Natalia S.
@Propelld
Apr 25 02:28
jq-1.5-1-a5b5cbe
Jon Cluck
@cluckj
Apr 25 02:28
and json --version?
Natalia S.
@Propelld
Apr 25 02:35
json 9.0.6
Jon Cluck
@cluckj
Apr 25 02:42
@Propelld does the nightscout url your typed look like https://yourNS.herokuapp.com?
Natalia S.
@Propelld
Apr 25 02:47
Yes
Jon Cluck
@cluckj
Apr 25 02:51
hmm, are you using token authentication?
Natalia S.
@Propelld
Apr 25 02:52
No
Jon Cluck
@cluckj
Apr 25 02:57
can you run the line that's crashing and paste the full output? it's: nightscout autoconfigure-device-crud $NIGHTSCOUT_HOST $API_SECRET
Natalia S.
@Propelld
Apr 25 02:59

sets up:
openaps use ns shell get entries.json 'count=10'
openaps use ns shell upload treatments.json recently/combined-treatments.json

Nightscout Endpoints

  • entries.json - Glucose values, mbgs, sensor data.
  • treatments.json - Pump history, bolus, treatments, temp basals.
  • devicestatus.json - Battery levels, reservoir.
  • profile.json - Planned rates/settings/ratios/sensitivities.
  • status.json - Server status.

Examples

Get records from Nightscout

Use the get feature which takes two arguments: the name of the endpoint
(entries, devicestatus, treatments, profiles) and any query arguments to append
to the argument string. 'count=10' is a reasonable debugging value.
The query-params can be used to generate any query Nightscout can respond to.

openaps use ns shell get $endpoint $query-params

Unifying pump treatments in Nightscout

To upload treatments data to Nightscout, prepare you zoned glucose, and pumpmodel reports, and use the following two reports:

openaps report add nightscout/recent-treatments.json JSON ns shell  format-recent-history-treatments monitor/pump-history.json model.json
openaps report add nightscout/uploaded.json JSON  ns shell upload-non-empty-treatments  nightscout/recent-treatments.json

Here are the equivalent uses:

openaps use ns shell format-recent-history-treatments monitor/pump-history.json model.json
openaps use ns shell upload-non-empty-treatments nightscout/recent-treatments.json

The first report runs the format-recent-history-treatments use, which fetches
data from Nightscout and determines which of the latest deltas from openaps
need to be sent. The second one uses the upload-non-empty-treatments use to
upload treatments to Nightscout, if there is any data to upload.

Uploading glucose values to Nightscout

Format potential entries (glucose values) for Nightscout.

openaps use ns shell format-recent-type tz entries monitor/glucose.json  | json -a dateString | wc -l
# Add it as a report
openaps report add nightscout/recent-missing-entries.json JSON ns shell format-recent-type tz entries monitor/glucose.json
# fetch data for first time
openaps report invoke nightscout/recent-missing-entries.json

# add report for uploading to NS
openaps report add nightscout/uploaded-entries.json JSON  ns shell upload entries.json nightscout/recent-missing-entries.json
# upload for fist time.
openaps report invoke nightscout/uploaded-entries.json

root@nataliasAPS:~#

Jon Cluck
@cluckj
Apr 25 03:04
lol, change $NIGHTSCOUT_HOST and $API_SECRET to your nightscout url and your api secret; it looks like it didn't save them to environment variables
it should say something like:
added process://ns/nightscout/ns NIGHTSCOUT_HOST API_SECRET
process://ns/nightscout/ns https://yourURL.herokuapp.com 854ab45f4f42db6dbd69d4d833db416d1886515d
or spit out a bunch of errors and then ConfigParser.DuplicateSectionError: Section 'device "ns"' already exists
Natalia S.
@Propelld
Apr 25 03:09
Not an openaps environment, run: openaps init
parse error: Invalid numeric literal at line 1, column 4
Not an openaps environment, run: openaps init
Jon Cluck
@cluckj
Apr 25 03:11
cd ~/myopenaps first :)
Natalia S.
@Propelld
Apr 25 03:14
Traceback (most recent call last):
File "/usr/local/bin/openaps-device"
, line 35, in <module>
app( )
File "/usr/local/lib/python2.7/dist-
packages/openaps/cli/init.py", lin
e 47, in call
self.configure_parser(self.parser)
File "/usr/local/bin/openaps-device"
, line 21, in configureparser
self.commands = devices.configure

commands(parser, parent=self)
File "/usr/local/lib/python2.7/dist-
packages/openaps/devices/init.py",
line 36, in configure_commands
parent.devices = get_device_map(pa
rent.config)
File "/usr/local/lib/python2.7/dist-
packages/openaps/devices/init.py",
line 21, in get_device_map
for device in Device.FromConfig(ve
ndors, conf):
File "/usr/local/lib/python2.7/dist-
packages/openaps/devices/device.py", l
ine 77, in FromConfig
vendor = vendors.lookup(config.get
(candidate, 'vendor').split('.').pop(
), config)
File "/usr/local/lib/python2.7/dist-
packages/openaps/vendors/init.py",
line 27, in lookup
return get_map(config)[name]
File "/usr/local/lib/python2.7/dist-
packages/openaps/vendors/init.py",
line 22, in get_map
vendors = all_vendors(config)
File "/usr/local/lib/python2.7/dist-
packages/openaps/vendors/init.py",
line 36, in all_vendors
return get_vendors( ) + find_plugi
ns(config)
File "/usr/local/lib/python2.7/dist-
packages/openaps/vendors/init.py",
line 16, in find_plugins
return [ v.get_module( ) for v in
vendors ]
File "/usr/local/lib/python2.7/dist-
packages/openaps/vendors/plugins/vendo
r.py", line 19, in get_module
return importlib.importmodule(sel
f.name)
File "/usr/lib/python2.7/importlib/

_init.py", line 37, in import_module import(name)
ImportError: No module named mmeowlink
.vendors.mmeowlink
Traceback (most recent call last):
File "/usr/local/bin/openaps-device"
, line 35, in <module>
app( )
File "/usr/local/lib/python2.7/dist-
packages/openaps/cli/
init.py", lin
e 47, in
call
self.configure_parser(self.parser)
File "/usr/local/bin/openaps-device"
, line 21, in configureparser
self.commands = devices.configure

commands(parser, parent=self)
File "/usr/local/lib/python2.7/dist-
packages/openaps/devices/
init.py",
line 36, in configure_commands
parent.devices = get_device_map(pa
rent.config)
File "/usr/local/lib/python2.7/dist-
packages/openaps/devices/
init.py",
line 21, in get_device_map
for device in Device.FromConfig(ve
ndors, conf):
File "/usr/local/lib/python2.7/dist-
packages/openaps/devices/device.py", l
ine 77, in FromConfig
vendor = vendors.lookup(config.get
(candidate, 'vendor').split('.').pop(
), config)
File "/usr/local/lib/python2.7/dist-
packages/openaps/vendors/
init.py",
line 27, in lookup
return get_map(config)[name]
File "/usr/local/lib/python2.7/dist-
packages/openaps/vendors/
init.py",
line 22, in get_map
vendors = all_vendors(config)
File "/usr/local/lib/python2.7/dist-
packages/openaps/vendors/
init.py",
line 36, in all_vendors
return get_vendors( ) + find_plugi
ns(config)
File "/usr/local/lib/python2.7/dist-
packages/openaps/vendors/
init.py",
line 16, in find_plugins
return [ v.get_module( ) for v in
vendors ]
File "/usr/local/lib/python2.7/dist-
packages/openaps/vendors/plugins/vendo
r.py", line 19, in get_module
return importlib.importmodule(sel
f.name)
File "/usr/lib/python2.7/importlib/

_init
.py", line 37, in import_module
import(name)
ImportError: No module named mmeowlink
.vendors.mmeowlink
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", lin
e 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 291, in load
**kw)
File "/usr/lib/python2.7/json/init .py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decode
r.py",
Jon Cluck
@cluckj
Apr 25 03:17
pip show mmeowlink
Natalia S.
@Propelld
Apr 25 03:18
Nothing
Jon Cluck
@cluckj
Apr 25 03:18
progress :)
sudo pip install --default-timeout=1000 -U mmeowlink
Natalia S.
@Propelld
Apr 25 03:20
I'll take your word for it :P
Jon Cluck
@cluckj
Apr 25 03:20
:laughing:
that should end with: Successfully installed mmeowlink-0.11.1
Natalia S.
@Propelld
Apr 25 03:21
Collecting mmeowlink
Using cached https://files.pythonhosted.org/packages/5a/64/4e65171d73e6390a496177b124cbe936c203934ac21b07e4ad52736266cf/mmeowlink-0.11.1.tar.gz
Requirement already up-to-date: argcomplete in /usr/local/lib/python2.7/dist-packages (from mmeowlink)
Requirement already up-to-date: decocare in /usr/local/lib/python2.7/dist-packages (from mmeowlink)
Requirement already up-to-date: pyserial in /usr/local/lib/python2.7/dist-packages (from mmeowlink)
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 487, in _prepare_file
req_to_install, finder)
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 428, in _check_skip_installed
req_to_install, upgrade_allowed)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
return self.request('GET', url, kwargs)
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args,
kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
resp = self.send(prep, send_kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
r = adapter.send(request,
kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
Jon Cluck
@cluckj
Apr 25 03:26
iirc this is a "debian's version of pip is bad at retries" thing
Natalia S.
@Propelld
Apr 25 03:27
A whatawhata?
Jon Cluck
@cluckj
Apr 25 03:28
the download mirror for the file you want to install is being spotty and this particular version of the installer doesn't like that
Natalia S.
@Propelld
Apr 25 03:29
Hm
Jon Cluck
@cluckj
Apr 25 03:30
I'm looking to see what the fix is...
Natalia S.
@Propelld
Apr 25 03:47
Ah thank you 🙏
Jon Cluck
@cluckj
Apr 25 03:49
okay, several commands: python -m pip install --upgrade pip then apt-get remove python-pipand then source ~/.bash_profile
aaaand then try this again: sudo pip install --default-timeout=1000 -U mmeowlink
Natalia S.
@Propelld
Apr 25 04:02
Ok at the install --upgrade pip I get
root@nataliasAPS:~/myopenaps# install --upgrade
install: unrecognized option '--upgrade'
Try 'install --help' for more information.
Jon Cluck
@cluckj
Apr 25 04:04
that's all one command: python -m pip install --upgrade pip
Natalia S.
@Propelld
Apr 25 04:09
Ok. After
source ~/.bash_profile
I get
-bash: /root/.bash_profile: No such file or directory
Is that ok?
Jon Cluck
@cluckj
Apr 25 04:11
try the mmeowlink install command
Natalia S.
@Propelld
Apr 25 04:11
After running the last command I got
Successfully built mmeowlink
Installing collected packages: mmeowlink
Successfully installed mmeowlink-0.11.1
Jon Cluck
@cluckj
Apr 25 04:11
:D
Natalia S.
@Propelld
Apr 25 04:11
👍
Jon Cluck
@cluckj
Apr 25 04:12
press the up arrow till you get to the nightscout autoconfigure-crud command with your nightscout url and api secret in it, and run that again
Natalia S.
@Propelld
Apr 25 04:18
Ok
Do you want me to post?
Jon Cluck
@cluckj
Apr 25 04:19
if it just had two lines of output like I showed earlier, no (it'd have your url and api secret in it)
if it was a whole barf of error messages, yes
Natalia S.
@Propelld
Apr 25 04:26
Ok, it doesn't look like errors but it also isn't two lines
I do see my url and api in there
Jon Cluck
@cluckj
Apr 25 04:27
that should be okay
re-run setup and cross your fingers
Natalia S.
@Propelld
Apr 25 04:28
Ok
Jon Cluck
@cluckj
Apr 25 04:28
cd && ./src/oref0/bin/oref0-setup.sh
Natalia S.
@Propelld
Apr 25 04:55
Seems to have worked!
I appreciate your help
Jon Cluck
@cluckj
Apr 25 13:02
:thumbsup: no problem! glad it's working
pmgauthier
@pmgauthier
Apr 25 14:36

Hi all. Having trouble connecting to my Edison Board in terminal to flash. I have confirmed that my USB cables are good for data and I can see the edison image in finder. However, when I type "sudo screen /usr/tty.usbserial-* 115200" in Terminal I get a warning:

"Cannot exec '/usr/tty.usbserial-*': No such file or directory"

Can anyone help identify my problem? Can't seam to find any helpful troubleshooting tips..

Eric
@ecc1
Apr 25 14:53
should be "dev", not "usr". I advise copying and pasting rather than retyping and introducing errors
pmgauthier
@pmgauthier
Apr 25 15:06
Apologies. I copied and pasted the error when I tried "usr" instead of "dev". The error still occurs in “dev” ..code was copied and pasted from the install guide
pmgauthier
@pmgauthier
Apr 25 15:35

I've tried to install Homebrew, etc, on three different Macs now.

Still getting the following error when running command "sudo screen /dev/tty.usbserial-* 115200":

"Cannot exec '/dev/tty.usbserial-*': No such file or directory"

:(

Also reflashed the board with a fresh edison image using Intel's Edison Setup Application (Successfully). Error still persists when trying to sudo screen in :(

Scott Leibrand
@scottleibrand
Apr 25 15:47
Check/swap your USB cables, and reboot your Mac.
pmgauthier
@pmgauthier
Apr 25 16:35
Thanks @scottleibrand. Unfortunately not luck. I have checked my cables for data and swapped them with each other and about 6 other data cables, so I don't think that is the issue (also rebooted all three macs as well as Reseting SMC several times). Is there a chance I have been sold a bad Edison board? I have been able to flash back to Poky using Intel's Edison Setup Application, which gives me hope, but still unable to get into "screen" in Terminal.
Scott Leibrand
@scottleibrand
Apr 25 16:36
Are you using a USB hub?
It works best with a direct cable: you can get USB-C to microUSB cables to bypass the hub if you have a USB-C Mac.
pmgauthier
@pmgauthier
Apr 25 16:40
No. Direct to USB ports on the Mac. Tried on 3 computers, so I get the sense it’s an issue with the Edison/Explorer
pmgauthier
@pmgauthier
Apr 25 17:27
Whenever I try to go into “screen” the red light on explorer board (not the one between USB ports) goes off. When I reconnect or reboot the board with the black button, they go back on. Not sure if this is helpful information?
Bernhard Klein
@Volberger
Apr 25 17:51

Have problems again with my WPA_Supplicant.conf. A few days ago I received from Scott Leibrant and Jon Cluck the recommendation to simply copy a new wpa_supplicant.conf to the SD card and restart the rig. I did that today to use a mobile router for my rig. All devices (rig, router, phone and notebook) are in the same network, blood sugar values are transmitted via Xdrip. But I can not get on my rig with ssh root @ pancreas. The rig even shows the correct sugar levels and the time is right, but the loop does not work. This is my wpa_supplicant.conf

country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
ssid="HUAWEI-6DB2"
psk="1457XXXXX"
}

SSH answers: Could not resolve hostname pancreas: The specified host is unknown.

What have I done wrong?

Greetings from germany Bernhard Klein

pmgauthier
@pmgauthier
Apr 25 18:00

UPDATE: Managed to enter "screen" on edison, but any key I press looks like random characters.

This is what I get when trying to override the Boot with "run do_flash" as suggested in troubleshooting guide. Every key I press produces random characters and "�"s.

I am at a loss..

"> ��BIp�sP�a@���7ȃU���U

L�%)�5d�P�D�
KH�r�ѻ�i��"��<INTERRUPT>
boot > ytkIp
Unknown command 'ytkIp' - try 'help'
boot > ���Od���Ȟ�=���I>�'���$��z�ĺ20B 0D!�<INTERRUPT> boot > ��=�m-�-љ�И���aH�H\8L�Q8$�NAV�5��D;Qc�&I"A �����<INTERRUPT> boot > �����A syntax error boot > �B��v- Unknown command '�B��v-' - try 'help' boot > ,DE���;�z���0T"�$-B�(^�d ]� �s BBzu0<INTERRUPT> boot > *J�*�20#"Pi�<INTERRUPT> ���O0.�Z%�6
��8e�"����B]J�5�S�, ^��8D��H"� Unknown command '���O0.�Z%�6��8e�����B]J�5�S�(, ^��8D��H�' - try 'help'
boot > h��f+�$���`�<INTERRUPT>
boot > y|kY���Od��<D.��2��I>�'���$��z�ĺ20B a0D����?�m-�-љ�Ԙ��l� �aL�H\ P��:UR
syntax error
boot > �QFX�À%�
Unknown command '�QFX�À%�' - try 'help'
boot > �!2�>�'P"

Scott Leibrand
@scottleibrand
Apr 25 18:07
@Volberger do you see the rig joining the network from the phone/router side? (lots of details on how to do this in the openaps docs)
NSewar
@nsewar01
Apr 25 18:32
attempting Edison reflash and putty window stuck on "boot>" the "sudo ./flashall.sh" command is not recognised any help appreciated thks
Raymond Richmond
@PedanticAvenger
Apr 25 18:37
@Volberger connecting to your mobile gateway the name pancreas is probably not being registered anywhere. If you can determine what IP the rig received then ssh to the IP address rather than the name.
Abigail Cember
@acember
Apr 25 18:59
@pmgauthier I'm also aiming to upgrade my hardware to G5 transmitter --> rig on Edison --> watch. (This is the minimal possible hardware, AFAIK). Thus I am following your progress and may bother you in the future for assistance.
pmgauthier
@pmgauthier
Apr 25 19:03
@acember I will let you know if I have success with that... as soon as I have a functioning and flashed edison rig to build upon! My current issues are not related to my offline rig goals.
Abigail Cember
@acember
Apr 25 19:06
@pmgauthier Ah, are you just starting out? I already have a functioning rig, running on PI +HAT (largely thanks to @cluckj , of course). But I want to do some bigtime hardware consolidating so that I can race (running) while looping.
Unfortunately I still have a G4 transmitter, so first step is to wait for that warranty to be up :[
Scott Leibrand
@scottleibrand
Apr 25 19:11
@pmgauthier if you think the issue is with hardware, next step is probably to get two of everything and swap out individual components to isolate the problematic one
pmgauthier
@pmgauthier
Apr 25 19:19
@acember Indeed I am. Currently a DIY Loop iOS user, but hoping to try out OpenAPS as an alternative. I like what I read about the adaptability with autosense/autotune as well as the future use of oref1 features to lessen my diabetes workload and improve my A1C.
pmgauthier
@pmgauthier
Apr 25 19:26

@scottleibrand I was afraid that may be the next course of action.. Just finished waiting two weeks for shipments of both an edison from eBay and the Explorer Board. Would love to avoid having to order hundreds of dollars more gear and another 2 weeks of waiting for it (given I was not quite 100% sure I'd switch full time from DIY Loop to OpenAPS).. Regardless, thanks everyone for your input and any help or suggestions along the way.

Has anyone had this kind of experience where when you "sudo screen /dev/tty.usbserial-* 115200" into your Edison Rig all button presses (including "delete" and "esc") result in random characters such as "y|kY���Od��<D.��2��I>�'���$��z�ĺ20B a0D"??

Scott Leibrand
@scottleibrand
Apr 25 19:26
FWIW I have seen that on a temporary basis, and resolved it by reseating everything. I've never seen it persistent like you're describing.
pmgauthier
@pmgauthier
Apr 25 19:32
Thanks @scottleibrand. I will definitely try to reseat again (done that twice). Perhaps my spacers are a tad too tall, if the connection between the boards is what’s causing trouble. I used the ones that came with the explorer board.. will try again and maybe reevaluate those spacers.
Jon Cluck
@cluckj
Apr 25 19:49
@acember edison+explorer+xdrip-js?
@pmgauthier is your port speed set correctly?
nevermind, you're on a mac :)
Scott Leibrand
@scottleibrand
Apr 25 20:09
Or try without spacers. They’re only needed for stability when mobile.