Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate dev changes #33

Merged
merged 3 commits into from
May 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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