openaps / openaps

deprecated repo, formerly tools for exploring DIY openaps, but no longer used in current modern OpenAPS builds. see https://openaps.readthedocs.io/en/latest/ for current build instructions
MIT License
469 stars 179 forks source link

Add new radio_locale parameter for Medtronic pumps #112

Closed oskarpearson closed 7 years ago

oskarpearson commented 7 years ago

Add support for the 'radio_locale' medtronic parameter.

This helps make using https://github.com/oskarpearson/mmeowlink/commit/3a8d8677497ad2217201b4f110083b6dbf89cd30 easier.

scottleibrand commented 7 years ago

What would be an example of the usage for this, so we can test it?

oskarpearson commented 7 years ago

@scottleibrand https://github.com/openaps/oref0/pull/276 uses it. Please let me know if you're happy with this structure.

This particular change will modify pump.ini to contain this:

[device "pump"]
serial = 123123
radio_locale = WW

mmeowlink will look for that parameter when doing mmtune etc as per https://github.com/oskarpearson/mmeowlink/commit/3a8d8677497ad2217201b4f110083b6dbf89cd30 (currently only in the dev branch - but having the value in the ini file won't break anything if it's not used)

scottleibrand commented 7 years ago

Cool. Might be easiest to go ahead and merge this for testing. Does anyone see any reason not to do that?

oskarpearson commented 7 years ago

I think that this can be merged. We could need to make additional changes, but from what I can tell it'll work as expected.

scottleibrand commented 7 years ago

Per https://gitter.im/nightscout/intend-to-bolus?at=5858a0f6c5a4e0233ba7961c it doesn't appear that openaps device add pump mmeowlink subg_rfspy /dev/spidev5.1 <serial> WW ever adds the radio_locale = WW line to the pump.ini. Any ideas why not?

PieterGit commented 7 years ago

@scottleibrand and @oskarpearson : i think pull request needs still to be applied to an openaps release to be able to remove the workaround in the current oref0-setup.sh (currently on my devww branch, but statement is also available in oref0 master and dev)

      # Hack to check if radio_locale has been set in pump.ini. This is a temporary workaround for https://github.com/oskarpearson/mmeowlink/issues/55
      # It will remove empty line at the end of pump.ini and then append radio_locale if it's not there yet
      # TODO: remove once https://github.com/openaps/openaps/pull/112 has been released in a openaps version
      grep -q radio_locale pump.ini ||  echo "$(< pump.ini)" > pump.ini ; echo "radio_locale=$radio_locale" >> pump.ini