oref0: Must use the Raspbian lite image for the 0.7.0-dev branch on a Pi Zero + Explorer HAT (GUI version doesn't work)

Tl;dr: I installed this on a Pi Zero W (2018-04-18-raspbian-stretch) with the Explorer HAT. The loop log thows extensive errors with Minimed comms when I first tried to fire it up. I progressed a little closer to where I can get mmtune.py to work, but it’s pretty busted and everything still throws errors. Nowhere near running a full loop.

The saga starts just after a fresh OS load:

sudo bash
curl -s https://raw.githubusercontent.com/openaps/oref0/dev/bin/openaps-install.sh > /tmp/openaps-install.sh && bash /tmp/openaps-install.sh

Hit Ctrl+C before running oref0-setup

cd ~/src/oref0 && git fetch && git checkout 0.7.0-dev && git pull && npm run global-install

No apparent errors.

oref0-setup --dir=/root/myopenaps --serial=xxxxxx --cgm=G5-upload --ns-host=https://xxxxx --api-secret=xxxxx --tty=/dev/spidev0.0 --enable=' autosens meal autotune ' --radio_locale='US' --btmac=xx:xx:xx:xx:xx:xx --max_iob=6.0 --current_basal_safety_multiplier=8 --max_daily_safety_multiplier=8

No apparent errors yet here either. After a reboot though, the following log lines come flowing out as though nothing is even being run between log lines:

Starting oref0-pump-loop at Sun 17 Jun 15:24:08 EDT 2018 with 8 second wait_for_silence:
Waiting up to 4 minutes for new BG: First loop: not waiting
Listening: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Sun 17 Jun 15:24:22 EDT 2018
Preflight fail. Retry 1 of preflight
Preflight fail. Listening: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Sun 17 Jun 15:24:25 EDT 2018
Retry 2 of preflight
Preflight fail. Listening: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Sun 17 Jun 15:24:27 EDT 2018
Retry 3 of preflight
Preflight fail. Couldn't preflight
oref0-pump-loop failed. pump_loop_completed more than 15m old; waiting for 39 s silence before mmtuning
Could not parse profile.json:  { [Error: ENOENT: no such file or directory, open '/root/myopenaps/settings/profile.json']
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/root/myopenaps/settings/profile.json' }
Could not parse edison-battery.json:  { [Error: ENOENT: no such file or directory, open '/root/myopenaps/monitor/edison-battery.json']
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/root/myopenaps/monitor/edison-battery.json' }
Could not parse suggested.json:  { [Error: ENOENT: no such file or directory, open '/root/myopenaps/enact/suggested.json']
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/root/myopenaps/enact/suggested.json' }
Listening: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Sun 17 Jun 15:24:44 EDT 2018
Listening for 39 s silence before mmtuning: Listening: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Sun 17 Jun 15:24:44 EDT 2018
mmtune: Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
No wait required.
If pump and rig are close enough, this error usually self-resolves. Stand by for the next loop.
Unsuccessful oref0-pump-loop at Sun 17 Jun 15:24:54 EDT 2018

Running mmtune.py yeilds an error about how the spi_serial module isn’t installed. So we jump through some hoops to install that and mraa with some hints from this page (even though it’s Edison-based help): https://learn.sparkfun.com/tutorials/installing-libmraa-on-ubilinux-for-edison

sudo apt-get install git build-essential swig3.0 python-dev nodejs-dev cmake libjson-c-dev
git clone https://github.com/intel-iot-devkit/mraa.git
mkdir mraa/build && cd $_
cmake .. -DBUILDSWIGNODE=OFF
make
make install
ldconfig && ldconfig -p | grep mraa

Add export PYTHONPATH=$PYTHONPATH:$(dirname $(find /usr/local -name mraa.py)) to .bash_profile, then install spi_serial:

git clone https://github.com/EnhancedRadioDevices/spi_serial.git
cd spi_serial
python setup.py install

Now the Python module is there and works. Hooray!

python /usr/local/bin/mmtune.py --serial xxxxxx --port /dev/spidev0.0 --subg_rfspy --radio_locale US
{
    "scanDetails": [
        [
            "916.300",
            0,
            -99
        ],
        [
            "916.324",
            0,
            -99
        ],
        [
            "916.348",
            0,
            -99
        ],
        [
            "916.372",
            0,
            -99
        ],
        [
            "916.396",
            0,
            -99
        ],
        [
            "916.420",
            0,
            -99
        ],
        [
            "916.444",
            0,
            -99
        ],
        [
            "916.468",
            1,
            -94
        ],
        [
            "916.492",
            0,
            -99
        ],
        [
            "916.516",
            0,
            -99
        ],
        [
            "916.540",
            0,
            -99
        ],
        [
            "916.564",
            0,
            -99
        ],
        [
            "916.588",
            3,
            -88
        ],
        [
            "916.612",
            5,
            -70
        ],
        [
            "916.636",
            1,
            -93
        ],
        [
            "916.660",
            5,
            -67
        ],
        [
            "916.684",
            5,
            -67
        ],
        [
            "916.708",
            5,
            -68
        ],
        [
            "916.732",
            4,
            -78
        ],
        [
            "916.756",
            0,
            -99
        ],
        [
            "916.780",
            0,
            -99
        ],
        [
            "916.804",
            0,
            -99
        ],
        [
            "916.828",
            1,
            -94
        ],
        [
            "916.852",
            0,
            -99
        ],
        [
            "916.876",
            0,
            -99
        ]
    ],
    "setFreq": 916.684,
    "usedDefault": false
}

But we still have a problem with the rest of the loop (note that mmtune spits out the grep help message):

Starting oref0-pump-loop at Sun 17 Jun 16:01:06 EDT 2018 with 11 second wait_for_silence:
Waiting up to 4 minutes for new BG: First loop: not waiting
Listening: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Sun 17 Jun 16:01:07 EDT 2018
Preflight fail. Retry 1 of preflight
Preflight fail. Listening: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Sun 17 Jun 16:01:08 EDT 2018
Retry 2 of preflight
Preflight fail. Listening: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Sun 17 Jun 16:01:08 EDT 2018
Retry 3 of preflight
Preflight fail. Couldn't preflight
oref0-pump-loop failed. pump_loop_completed more than 15m old; waiting for 27 s silence before mmtuning
Could not parse profile.json:  { [Error: ENOENT: no such file or directory, open '/root/myopenaps/settings/profile.json']
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/root/myopenaps/settings/profile.json' }
Could not parse edison-battery.json:  { [Error: ENOENT: no such file or directory, open '/root/myopenaps/monitor/edison-battery.json']
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/root/myopenaps/monitor/edison-battery.json' }
Could not parse suggested.json:  { [Error: ENOENT: no such file or directory, open '/root/myopenaps/enact/suggested.json']
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/root/myopenaps/enact/suggested.json' }
Listening: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Sun 17 Jun 16:01:17 EDT 2018
Listening for 27 s silence before mmtuning: Listening: .No interfering pump comms detected from other rigs (this is a good thing!)
Continuing oref0-pump-loop at Sun 17 Jun 16:01:18 EDT 2018
mmtune: Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
No wait required.
If pump and rig are close enough, this error usually self-resolves. Stand by for the next loop.
Unsuccessful oref0-pump-loop at Sun 17 Jun 16:01:27 EDT 2018

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 38 (36 by maintainers)

Most upvoted comments

I think all the issues within this issue have been resolved. Please open a new issue if there is a related issue on the latest 0.7.0-dev release candidate (in October 2019).

I’ve been using the misc-stuff branch for a couple days now, but only for a couple hours at a time at night because I ran into trouble with Logger and my current transmitter (https://github.com/xdrip-js/Logger/issues/79). My next cycle should be Tuesday morning and I’ll be switching to the transmitter that responds properly so I can run misc-stuff on the PiHAT device full-time.

That said - so far no issues with this branch over the past few days.

That’s the one! Once you do the update for Logger node -v reports v8.10.0. And yes, that’s the command I ran when I saw the version mismatch errors in the loop log.

@scottleibrand I have spare microSD cards lying around to continue to do clean installs with, if you want to commit that I can run another round to see if that installs the latest version properly.