Skip to content

Commit

Permalink
Merge pull request #29 from oskarpearson/adjust_frequency_ranges
Browse files Browse the repository at this point in the history
[adjust_frequency_ranges] Change frequency range
  • Loading branch information
oskarpearson committed May 21, 2016
2 parents dc2b9fd + 2863531 commit 6b7311e
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions mmeowlink/mmtune.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

class MMTune:
FREQ_RANGES = {
'US': { 'start': 916.5, 'end': 916.9, 'default': 916.630 },
'WW': { 'start': 867.5, 'end': 868.5, 'default': 868.328 }
'US': { 'start': 916.300, 'end': 916.900, 'default': 916.630 },
'WW': { 'start': 868.150, 'end': 868.750, 'default': 868.328 }
}

def __init__(self, link, pumpserial, radio_locale='US'):
Expand All @@ -24,28 +24,11 @@ def __init__(self, link, pumpserial, radio_locale='US'):
self.scan_range = self.FREQ_RANGES[self.radio_locale]

def run(self):

############################################################################
# Commented these out as they may be causing issues with certain pumps:
############################################################################
# self.link.update_register(SubgRfspyLink.REG_MDMCFG4, 0xa9)
#
# # Sometimes getting lower ber with 0x07 here (default is 0x03)
# self.link.update_register(SubgRfspyLink.REG_AGCCTRL2, 0x07)
#
# self.link.update_register(SubgRfspyLink.REG_AGCCTRL1, 0x40)
#
# # With rx bw > 101kzHZ, this should be 0xB6, otherwise 0x56
# self.link.update_register(SubgRfspyLink.REG_FREND1, 0x56)
#
# # default (0x91) seems to work best
# #self.link.update_register(SubgRfspyLink.REG_AGCCTRL0, 0x91)

#print "waking..."
self.wakeup()

#print "scanning..."
results = self.scan_over_freq(self.scan_range['start'], self.scan_range['end'], 20)
results = self.scan_over_freq(self.scan_range['start'], self.scan_range['end'], 25)
results_sorted = list(reversed(sorted(results, key=lambda x: x[1:])))

set_freq = self.scan_range['default']
Expand Down

0 comments on commit 6b7311e

Please sign in to comment.