For more info see: http://www.reddit.com/r/RTLSDR/comments/us3yo/rtlsdr_smartnet/ root@bt:~# cat gr-smartnet_bistromathv0.2.patch diff -urN gr-smartnet/Makefile.common gr-smartnet-dev/Makefile.common --- gr-smartnet/Makefile.common 2012-06-08 16:24:01.177020928 -0400 +++ gr-smartnet-dev/Makefile.common 2012-06-08 16:22:03.908439403 -0400 @@ -35,7 +35,8 @@ STD_DEFINES_AND_INCLUDES = \ $(DEFINES) \ -I$(GNURADIO_CORE_INCLUDEDIR) \ - -I$(GNURADIO_CORE_INCLUDEDIR)/swig + -I$(GNURADIO_CORE_INCLUDEDIR)/swig \ + -I/usr/local/include/gruel/swig # includes grincludedir = $(includedir)/gnuradio diff -urN gr-smartnet/src/lib/smartnet_crc.cc gr-smartnet-dev/src/lib/smartnet_crc.cc --- gr-smartnet/src/lib/smartnet_crc.cc 2012-06-08 16:24:01.197021024 -0400 +++ gr-smartnet-dev/src/lib/smartnet_crc.cc 2012-06-08 16:22:31.764577578 -0400 @@ -31,6 +31,7 @@ #include #include #include +#include #define VERBOSE 0 diff -urN gr-smartnet/src/lib/smartnet_deinterleave.cc gr-smartnet-dev/src/lib/smartnet_deinterleave.cc --- gr-smartnet/src/lib/smartnet_deinterleave.cc 2012-06-08 16:24:01.197021024 -0400 +++ gr-smartnet-dev/src/lib/smartnet_deinterleave.cc 2012-06-08 16:22:53.140683555 -0400 @@ -28,6 +28,7 @@ #include #include #include +#include #define VERBOSE 0 diff -urN gr-smartnet/src/python/fsk_demod.py gr-smartnet-dev/src/python/fsk_demod.py --- gr-smartnet/src/python/fsk_demod.py 2012-06-08 16:26:03.613628054 -0400 +++ gr-smartnet-dev/src/python/fsk_demod.py 2012-06-08 16:23:29.740865046 -0400 @@ -7,8 +7,7 @@ from gnuradio import gr, gru, blks2, digital, window from gnuradio import eng_notation from gnuradio.gr import firdes -#import gr_ais -from gnuradio import ais +import gr_ais from math import pi class fsk_demod(gr.hier_block2): diff -urN gr-smartnet/src/python/smartnet2decode.py gr-smartnet-dev/src/python/smartnet2decode.py --- gr-smartnet/src/python/smartnet2decode.py 2012-06-08 16:26:29.437756120 -0400 +++ gr-smartnet-dev/src/python/smartnet2decode.py 2012-06-08 16:23:38.356907765 -0400 @@ -10,8 +10,7 @@ from gnuradio import gr, gru, blks2, optfir, digital from gnuradio import audio from gnuradio import eng_notation -#from gnuradio import uhd -from osmosdr import * +from gnuradio import uhd from fsk_demod import fsk_demod from optparse import OptionParser from gnuradio.eng_option import eng_option @@ -21,8 +20,6 @@ import gnuradio.gr.gr_threading as _threading import csv -rtl_rate = 2.4e6 - class top_block_runner(_threading.Thread): def __init__(self, tb): _threading.Thread.__init__(self) @@ -44,7 +41,6 @@ self.rate = options.rate else: - ''' self.u = uhd.usrp_source(options.addr, io_type=uhd.io_type.COMPLEX_FLOAT32, num_channels=1) @@ -58,27 +54,20 @@ # Set the antenna if(options.antenna): self.u.set_antenna(options.antenna, 0) - ''' - self.u = source_c() - self.u.set_sample_rate(rtl_rate) - self.rate = rtl_rate self.centerfreq = options.centerfreq print "Tuning to: %fMHz" % (self.centerfreq - options.error) - -# if not(self.tune(options.centerfreq - options.error)): - if not(self.u.set_center_freq(options.centerfreq - options.error)): + if not(self.tune(options.centerfreq - options.error)): print "Failed to set initial frequency" - ''' + if options.gain is None: #set to halfway g = self.u.get_gain_range() options.gain = (g.start()+g.stop()) / 2.0 - ''' - self.u.set_gain_mode(0) + print "Setting gain to %i" % options.gain self.u.set_gain(options.gain) -# self.u.set_bandwidth(options.bandwidth) + self.u.set_bandwidth(options.bandwidth) print "Samples per second is %i" % self.rate @@ -227,7 +216,6 @@ groupflag = bool(groupflag) # print "Command is",command - print "Command ",hex(command), " address ",hex(address) if longtglist is not None and longtglist.get(str(lookupaddr), None) is not None: longname = longtglist[str(lookupaddr)] #the mask is to screen out extra status bits, which we can add in later (see the RadioReference.com wiki on SmartNet Type II) else: