Você está na página 1de 43

17.03.

2015

RelatedPages
RTLSDR/GNURadio
701000MHzRadioArchive
11GHzInterferometer
SpiralAntenna

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

RTLSDRandGNU
RadiowithRealtek
RTL2832U[Elonics
E4000/RaphaelMicro
R820T]softwaredefined
radioreceivers.

PageSections
Intro(here)
Hardware
Tuners
retunespeed
frequencyrange
R280T2
R820T/T2IFFilter
R828D
gain
frequencyerror
DirectSampleMode
Noise/RFI
Clocks
BroadbandAntenna
Links/Datasheets
InstallingRTLSDRandGNURadio
RTLSDRApplicationsNotes
keenerd'sbranch
Multimode
Gqrx
SDR#
grfosphor
ADBS#
grairmodes
Dump1090
grairmodes
LTECellScanner
kalibratertl
simple_fm
simpleradioastronomy
RTLSDRScanner
DongleLogger
Pagers
GqrxonUbuntu10.04
LTEScanneronUbuntu10.04
GNURadioCompanion
odroidu3rtlsdr
StuffImade
WidebandScanningSpectrograms
11GHzInterferometer

Originallymeantfortelevisionreceptionthediscoveryofthedebug/rawmodewasperhapsfirstnoticed
byEricFryinMarchof2010andthenexpandeduponandimplementedbyAnttiPalosaariinFeb2012
whofoundthatthesedevicescanoutputunsigned8bitI/Qsamplesathighrates.Ornot.Whoknows?A
http://superkuh.com/rtlsdr.html

1/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

lotofpeopleotherpeoplehavehelpedbuilditupfromthere.
ForthebestinformationstopreadingthispagerightnowandgotothertlsdrwikiOsmoSDRbythe
Osmocompeoplewhocreated,
librtlsdrcontainsthemajorpartofthedriver
rtl_sdr,rtl_tcp,rtl_test,etccommandlinecapturetoolsandutilities
grosmosdrgnuradiocompatiblemodule
andabunchofotherstuff.
keenerdistheauthorofmanyotherrtl_*tools:rtl_fm,rtl_power(heatmap.py),rtl_adsbandcodechanges
acceptedintothemainline.
patchvonbraunistheauthorandmaintainerofthebuildgnuradioscriptthatmadeiteasyforme,and
multitudesofothers,togetstartedwithrtlsdrunderGNURadio.
rtlsdr.orghasaclearintroductionintroductiontoowhilertlsdr.comhasthelatestnews.
RF,DSP,andUSBdetails
ThedongleswithanE4000tunercanrangebetween542147MHz(inmyexperience)withagapover
11001250MHzingeneral.TheR820TandR820T2gofrom241760MHz(or~13to1850withaltered
RTL2832Udrivers).TheR820Tusea3.57MHzintermediatefrequency(IF)whiletheE4000suseaZero
IF.Forbothkindsthetunererroris~30+20PPM,relativelystableoncewarmedup,andstablefromday
todayforagivendongle.Alloftheantennainputsare75Ohmimpedance.Thedynamicrangeformost
donglesisaround45dB.Thehighestsafesamplerateis2.4MS/sbutinsomesituationsupto3.2MS/s
workswithoutUSBdroppingsamples(RTL2832Umightdroptheminternally).Becausethedevicesuse
complexsampling(I/Q)thesamplerateisequaltothebandwidthinsteadofjusthalfofit.Forthedata
transfermodeUSB2isrequired,1.1won'twork.AnttiPalosaari'smeasurementsshowtheR820Tuse
~300mAof5vUSBpowerwhiletheE4000devicesuseonly~170mA.YoucancuttheleadstotheLED
todropusage~10%.
Thertlsdrdonglesuseaphasedlockedloopbasedsynthesizertoproducethelocaloscillatorrequiredby
thequadraturemixer.Thequadraturemixerproducesacomplexbasebandoutputwherethesignalspans
frombandwidth/2to+bandwidth/2andbandwidthistheanalogbandwidthofthemixeroutputstages.
(Datasheets,generalref:QuadratureSignals:Complex,ButNotComplicatedbyRichardLyons)Thisis
complexsampled(IandQ)bytheADC.TheSigmaDeltaADCsamplesat28.8Mspsat1bitandthe
resultisresampledinsidetheRTL2832UtopresentwhateversamplerateisdesiredtothehostPC.This
resampledoutputcanbeupto3.2MS/sbut2.4MS/sisthemaxrecommendedtoavoidlosingsamples.
Checkthisredditthreadforcaveatsanddetails.TheactualoutputisinterleavedsoonebyteI,thenone
byteQwithnoheaderormetadata(timestamps).Thesamplesthemselvesareunsignedandyousubtract
127fromthemtogettheiractual{127,+127}value.You'llalmostcertainlynoticeastablespikearound
DC.It'sfromeitherthe1/fnoiseoftheelectronicsorifit'saZeroIFtuner(E4000)theLObeatingwith
itselfinthemixer.
Popularsoftware
Myfavoritewaytoexplorethespectrumisusingrtl_powertodoverywidebandmultidaysurveys.For
generaluseSDR#isprobablythebestapplicationbutbutsincetheDSPsourcewentclosedthere'sno
linuxavailability.GqrxismyfirstchoicebutithasGNURadiodependencies.LuckilythereareLinuxand
OSXnativebinariespackageswithalldependencies(ie,gnuradio)thesedays.multimodehasaveryfull
andconfigurableGUI(itworksgreatwithGPUaccelerateddisplayslikegrfosphor).Fordoingdiagnostic
andlowsignallevelworkLinradisfullfeaturedandfast.Forcommandlineandlowpowerdevicestry
keenerd'srtl_fm.
Thesesitesmaintainthebestlistofrtlsdrdevicesupportingapplications:
https://sdr.osmocom.org/trac/wiki/rtlsdr#KnownApps,
https://sdr.osmocom.org/trac/wiki/GrOsmoSDR#KnownApps,andlatelyhttp://www.rtlsdr.com/biglist
rtlsdrsupportedsoftware/
Assumingyou'reonlinux,butapplicableingeneral,donotusetheOSDVBdrivers.Thoseareforthe
DVBTmodeandnotthedebugmodethatoutputsrawsamples.Linux3.xkernelshouldcheckwith"$
lsmod|grepdvb_usb_rtl28xxu"andiffoundatleast"$sudomodproberdvb_usb_rtl28xxu"tounloadit.
Whilethesamplingbandwidthisonly2.4MHzthefrequencycanberetunedupto~40timesasecond.
Withfrequencyhoppingyoucansurveyverylargebandwidths.Seetholin'sannotated24hourrtl_power
spectrogram.Belowisazoomable37200*31008pixel5daylongspectrogramImadeusingrtl_power's
FFTmodeandheatmap.py.Itstartsveryfarzoomedout.Itmightloadabitslowtoo.(viewfullwindow)

http://superkuh.com/rtlsdr.html

2/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

Thispageismostlyjustnotestomyselfonhowtousertlsdr'scoreapplications,3rdpartystuffusing
librtlsdrandwrappersforit,andlotsonusingthegrosmosdrsourceinGNURadioandGNURadio
Companion.Thisisn'ta"blog",don'treaditsequentially,justsearchfortermsofinterestorusethetopics
menu.ForrealtimesupportonthesametopicstryFreenodeIRC's##rtlsdrandreddit'sr/rtlsdr.
IboughttwoE4000basedrtlsdr
usbdonglesfor$20eachin
early2012.Thenmanymonths
laterIboughttwomoreR820T
tunerbaseddonglesfor~$11
each.There'sphotosoftheE4ks
upatthetopofthepageandof
anR820Tbaseddongleinthe
"mini"formatofftotheleft
(mostminisdonothave
eepromsfordeviceID).Itand
theNewskyE4kdongleuptop
areMCX.Someofthecheaper
donglesoccasionallymiss
protectiondiodesbutthelast
threeI'veboughthavebeenfine.
Theantennaconnectoronthe
E4kezcapuptopisIEC1692,
BellingLee.Iusuallyreplaceit
withanFconnectororusea
PALMaletoFConnector
Female.FtoMCXfortheother
styledongles.Likenotedearlier
theseareall75Ohm.

Tuners
Onlythreetunersareverydesirableatthistime.TheElonicsE4000andtheRaphaelMicro
R820T/R820T2.IngeneraltheyareofequalperformancebutthestickswithR820Tchipsaremucheasier
tofind,cheaper(~$12USD),andtheyhaveasmallerDCspikeduetotheuseofanonzerointermediate
frequency.TheE4Kisbetterforhighend(>1.7GHz)whiletheR820Tcantunedownto24MHzwithout
anyhardwaremods.ThetunersthemselvesaresetupandretunedwithI2Ccommands.E4000tunersused
toretunetwiceasfastasR820Ttuners,butthiswasfixedinkeenerd'sexperimentalfastr820tbranch
whereR820TactuallytuneatinybitfasterthantheE4Ks.Thesechangeswerelateradoptedbythemain
rtlsdrandbothtookabout50msperretune(20hops/s).
Retunespeed

Butthatwastheolddayswhenrtlsdrsticksretunedrelativelyslowly.Astimepassedretuningspeedhas
beenincreasedbycleanupsincodeandspecificallykeenerd'schangessothetunerdoesn'twaitnearlyas
longfortheplltosettle.Morerecentlytejeez'smodmadetheretuningevenfasterbyupdatingallthe
changedregistersforaretuneinoner82xx_writeI2Ccall.Withthisdoneyoucanretuneatratesofupto
41(!)hopsperseconda~2ximprovementoverthenexistingdrivers.Sincethenalloftheseretuning
changeshavebeenincorporatedintothemainrtlsdr.
Furthermassivespeedupscanbehadatthecostofprettymuchallreliability.BynotwaitingforPLL
lockatallandalwaysleavingthei2crepeaterregisterenabledtejeezreportsretuningspeedsofupto300
jumpspersecondarepossible.
Tuningrange

AsofAug.2014ahandfulofpeoplehavefoundwaystoextendther820tfrequencyrangeaswell.
Initiallythoughttotopoutat1700MHZtheR820Tdriverhashasrewrittentotunefrom22to1870(!)
MHz.Whileeffortshavebeenmadetoextendthelowerrangeaswell,withthePLLseemingtolockdown
to8MHzinsomecases,thisrangeturnsouttobefullofimagesandrepeatsofthehigherfrequency
range.AlatereffortwiththeadditionofdrivertweakstotheRTL2832downconverterpushedthelowend
downto~15MHz.Thecodeisathttps://github.com/mutability/rtlsdr/.
AftertejeezworkedoutthenomodHFreceptionacouplepeoplehavenotedthatthetunerswithfc0013
receiveHFevenbetterthantheR820Tboarddesigns.Soifyouhaveoneofthoselayingaroundyou
mightwanttotryHFwithit.
Gainsettings

TheE4KhassettingsforLNA(5..+25dB),mixer(4or12dB)andtotalof6IFgainstageswithvarious
gainsallowingfor1dBstepsbetween3and57dB.ThesoftwareonlydealswithLNAandmixergain
andnotindependently.IFgaincanbesetthroughtheAPI.
R820TalsohasLNA,mixerandIFgainsettingstheexactstepsarenotknown.Thenumbersinthe
librarycodearethroughmeasuringthegainatafixedfrequency.Thatgave0..33dBfortheLNA,
0..16dBforthemixerand4.7..40.8dBfortheIFgain.Thecurrentlibrarydoesnotexposethese
settingsthroughanAPI,onlyLNAandmixeraresetthroughsomealgorithm.IFgainissettoafixed
value.
Frequencyerror

Allofthedongleshavesignificantfrequencyoffsetsfromrealitythatcanbemeasuredandcorrectedat
runtime.MyezcapwithE4000tunerhasafrequencyoffsetofabout~44Khzor~57PPMfromrealityas
determinedbycheckingagainstalocal751MhzLTEcellusingLTECellScanner.Here'saplotof
http://superkuh.com/rtlsdr.html

3/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

frequencyoffsetsinPPMoveraweek.Themajorcomponentofvariationintimeisambienttemperature.
WiththeR820TtunerdongleaftercorrectlyforIhavehasa~17KhzoffsetatGSMfrequenciesor35
ppmabsoluteafterapplyinga50ppminitialerrorcorrection.Whenusingkalibrateforthistheinitial
frequencyerrorisoftentoolargeandtheFCCHpeakmightbeoutsidethesampled200KHzbandwidth.
Thisrequirespassinganinitialppmerrorparameter(fromLTEscanner)e.Anothertoolforchecking
frequencycorrectionsiskeenerd'sversionofrtl_testwhichuses(Ithink)ntpandsystemclocktoestimate
itratherthancellphonebasestationbroadcasts.
AlsoverycoolistheMITHaystackpeopleswitchingtortlsdrdongles(pdf)fortheirSRTandVSRT
telescopedesigns,UseofDVBTRTL2832UdonglewithRafaelR820Ttuner(pdf).Thefirstofthese
characterizesthedriftoftheR820Tclockandgainovertimeaswellasacalibrationroutine.
R820T2variant

Irecently(06152014)foundoutfromprog(ofSDR#andairspy)thatthereareactuallytwodifferent
versionsoftheR820Ttuner.ThenormaloneandtheR820T2.TheT2hasdifferentintermediate
frequencyfiltersallowingforwiderIFbandwidthsandapparentlyslightlybettersensitivity(afewdB
lowernoisefloor?).ForrtlsdrdonglesthisdifferenceinIFfilterbandwidthusuallydoesn'tmattermuch
sinceallofthemarelargerthantheRTL2832U'sdebug/SDRmodebandwidthof~3MHz.Butthereare
certainsituationswherealargertunerbandwidthisadvantageous:suchaswhenusingJowett'sHFtuning
mod.AsofSept.2014someofthenewR820T2havebeenshowingupinTerratec"E4000upgrade"
modelsticks.Butdon'tcountonit.Iboughtonefromebayseller"smallpartsbigdifference"whichhada
photoshowinganR820T2anditwasjustanR820T.
R820T/2IFFilterSettings

InFeburary2015Leifsm5bsz(oflinrad)relasedamodifiedlibrtlsdrwithchangestothertlsdrR820T
tunercodetoallowforfinergrainedcontroloverIFfiltersettings.
TheIFfilterwhichactuallyisalowpassfilterandahighpassfiltercanbesetforabandwidthof300
kHz.Dynamicrangeincreasesbysomethinglike30dBforthesecondnextchannel400kHzaway.Itis
alsopossibletogetsomemoreimprovementbychangingthegaindistribution.
Followingthisgat3way'spatchedgrosmosdrandVasili_ru'sSDR#driverwerereleased.gat3waymade
theIFfilterwidthvariablefromwithingqrxbypresentingitasagainvalue.Vasili'srtlsdrSDR#driver
alsomovestheSDR#decimationnormallyappliedduringdemodulationtothefrontoftheIQstream.This
givesbetterdynamicrangeforthevisualFFTbutdemodulatedqualityisnotchanged.Sofarthisisall
experimentalbutexpectittobebroughtmainlineonbothsidessoon.
keenerd'sexperimentalbranchautomaticallysetIFfilterwidthbasedonsampleratebuthadnotexposed
themasmanuallysetvalues.
R828Dvariant

Inlate2013AstrometraDVBT2dongleswiththeR828Dtuner(pic)pairedRTL2832Uhavebegunto
appear(2).TheDVBT2stuffisdonebyaseparatePanasonicchiponthesameI2Cbus.merbananwrote
asetofpatches,rtlastrometa,forlibrtlsdrhasbettersupportthesetuners.Theperformancehasn'tbeen
characterizedbutitatleastworksforbroadcastwideFMviaSDR.steve|m'spreliminarytestingsuggests
badperformanceintheformofthecrystalfortheDVBT2demodulatorleakingfixedspurs25dBabove
noisefloorintheIFatapproximately196and820KHz.Hewasabletomitigatethesewiththehardware
modofremovingthecrystalfortheDVBT2chip(ref).OfficialsupportwasaddedtothertlsdronNov
5thwhiletestingsupportwasaddedonNov4th.
E4000datasheet

20120822:TheE4000tunerdatasheethasbeenreleasedintothewild.ElonicsE4000LowPower
CMOSMultiBandTunnerDatasheet.pdf,but...
"AlltheonesthataredocumentedintheDSare'explained'inthedriverheaderfile...Andtherest,the
datasheetcallthem"Ctrl2:Write0x20there"andnomoredetails"
R820Toriginal,support,etc

20120907:ExperimentalsupportfordongleswiththeRafaelMicroR820Ttunerthatstartedappearing
inMayhasbeenaddedtortlsdrsourcebasebystevem.Thesetunerscover24MHzto1766MHz.They
alsodon'thavetheDCspikecausedbytheI/Qimbalancesincetheyuseadifferent,nonzero,IF.Onthe
otherhand,theymighthaveimagealiasingduetobeingsuperheterodinereceivers.Seestevem'stuner
comparisons.On20120920theR820Tdatasheetwasleakedtotheultracheapsdrmailinglist.The
officialrangeis421002Mhzwitha3.5dBnoisefigure.On20121004myorderarrived.I'mlikingthis
tunerverymuchsinceitactuallyworkswell,lockingdownto24Mhzorso*without*directsampling
mode.Here'saroughgnuplotspectralmapof24to1700Mhzover3daysImadewithsomecustomperl
andpythonscripts.Don'tjudgether820tonthequalityofthatgraph,itisjusttoshowtherange.Youcan
seewhatIthinkiseitherfrontendmixerfiltersnotattenuatingenoughoractualintermodulationasRFI.I
doalmostnoprocessingofthesignal(ie,noIQcorrection),don'tclearthebufferbetweensamples(LSB
probablybad),anduseahackywaytodisplaytimeseriesdataingluplot.RealSDRsoftwarelikeSDR#
showsthemtobeequalorbetterinqualitytoE4ks.
stevemdidgainmeasurementtestswithafewdonglesusingsomeequipmenthehadtotransmitaGSM
FCCHpeak,"whichisapuretone."ThisincludestheE4000andR820Ttuners.Inadditionhemeasured
themixer,IFandLNAfortheR820T.

HighFrequency(030Mhz)DirectSamplingMod
SteveMarkgrafofOsmocomhascreatedanexperimentalsoftwareandhardwaremodificationtoreceive
0~30Mhz(*)byusingthe28.8MHzRTL2832UADCsforRFsamplingandaliasingtodotheconversion.
http://superkuh.com/rtlsdr.html

4/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

InpracticeyouonlygetDC14.4MHzinthefirst
Nyquistzonebuttheuppercouldbehadbyusinga
14.4MHzto28.8MHzbandpassfilter.Inthe
stereotypicalezcapboardsyoucantestthisby
connectinganappropriatelylongwireantennatothe
rightsideofcapacitor17(onEzTV6681.1,atleast)
thatgoestopin1oftheRTL2832U.That'stheoneby
thedotonthechipsurface.Apparentlyevenpressinga
wetfingerontothecapacitorcanpickupstrongAM
stations.Thisbypassesstaticprotectionamongotherthingssothere'sachanceofdestroyingyourdongle.
Forgrosmosdrtheparameterdirect_samp=1ordirect_samp=2givesyouthetwoIortwoQinputs.
Nohardwarechange,softwaremoddirectsampling
Ithasrecentlybecomepossibletousedirectsamplingwithnohardwaremodificationsatall.Itisstillvery
experimentalandperformanceisbad.InOct2012Anonofishonther/rtlsdrsubreddithaddiscoveredthe
PLLwouldlockforasmall~3686.6MHz3730MHzrangefaroutsidethenormaltuningrangeand
thereseemedtobesignalsthere.InJanuary2014##rtlsdrIRCchannelusertejeezfiguredoutthis
bypassedthetuner(mixerleakage)andimplementedasetofregistersettings(R820TIFfrequency,IF
filterbandwidths,r82xx_write_reg_mask(priv,0x12,val,0x08)replacedwith
r82xx_write_reg_mask(priv,0x12,val|0x10,0x18))thatwouldexploitthistoenableHFreception.Shortly
thereafterkeenerdassembledeverythingintoarelativelyeasytousepatchset.
IfyouwanttogiveHFlisteningatrywithnoriskkeenerdhasaddedthesechangesrtl_fmandrtl_power
inhisexperimentalrtlsdrrepository.Tousethenomodemodewithrtl_toolsappendtheargument,"E
nomod".Tousethenomoddirectsamplinginsomethingthatusesgrosmosdr,likegqrxorGRC
flowgraphs,addthefollowingtothethe"devicestring"parameters:ie"direct_samp=3".PlugyourHF
antennaintothenormalconnector,nohardwaremodsneeded.

Differentialinput

I'vebeentoldmypinnumberingdoesn'tcorrespondtothedatasheets,sotakethatwithsalt.Therelative
positionsarecorrectregardlessofthenumbering.
Sincethenthedirectsamplingbranchhasbeenintegratedintomainandanumberofpeoplehavealso
donebalunstufftousebothRTL2832UADCinputs(usuallythetwoI)indirectsamplingmode.Dekar
hasapageshowinghowtouseanADSLtransformertogeneratesignalfortheADCsdifferentialinput
usingpin1(+I)and2(I)ontheRTL2832.mikighasausefulpdfschematicwithpartnumbersforusing
widebandtransformersortoroidsforwindingyourown.Here'saseriesofpostsfrombh5ea20tbshowing
howtouseaFT3743ferritecore.AndanotherexamplefromIW6OVDFernando.PY4ZBZaswell.The
ADChasadifferential/balancedinputsothisisdonemainlyfortheunbalanced>balancedconversion.
ButtheADCinputpinsalsohaveaDCoffsetsoyoucan'tjustconnectonetoGNDforthat.Impedance
matchingcanbedoneaswellbuttheimpedanceisn'tknown.~200Ohmsseemsreasonableandis
mentionedinsomeofthetunerdatasheets.4:1balunsthatareusedforcabletvmightalsowork,
dependingontheimpedanceofyourantenna.
TomBerger(K1TRB)usedmultiplecorematerialswithtrifilarwireandperformedtestsusinghisN2PK
virtualnetworkanalyzeronMay19th(2013).
http://superkuh.com/rtlsdr.html

5/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

Hamslovetype43ferrite,butforalmosteveryapplication,thereisabetterchoice.ForbroadbandHF
transformersSteward35Tisgenerallyabetterchoice.Therefore,Iwoundacoupletransformersand
didthecomparison.Type43and35TTransformerMaterialCompared
FormytestswithdirectsamplingmodeIorderedacouplewidebandtransformersfromcoilcraft.The
PWB2ALBandPWB4ALBtobespecific.IsampledthePWB4ALBforfreeandordered4ofthe
PWB2ALBfor~$10shipped.BothseemtoworkfinethoughIhavenomeansofcomparativetesting.
Ifyou'reparticularlyinterestedinHFworkthenanupconverterwouldbebetterthantheHFmod.Withthe
modtherewillbealiases(*)foranyfrequencyover14.4Mhz(1/2the28.8clockrate).Soyou'dwanta14
MHzlowpassforthelowendora1428MHzbandpassforthehighend.Andprobablyotherlittle
idiosyncracies.Alotofpeoplechosetojustuseanupconverterinstead.KF7LEwroteupshortsummaries
comparing16popularupconverters.

Noise,shielding,cables,andwhyisthatFM
signalthere?!
Whenyouseesomethingweird,likecommercialFM
broadcastsat27MHz,whatyouareseeingincomplete
filteringofmixingproducts.It'stheharmonicsofthe
squarewavedrivingthemixerscombinedwith
insufficientrffilteringtosuppresstheresponse.Youcan
tellifitisalocaloscillatormixerharmonicleakageby
sweepingthefrequencyandseeinghowfasttheghost
signalmovesrelativetothislookforlinearrelationships
(ie,2xthespeed,1/4thespeed).Sometimeslocalsignals
canbepowerful(ie,pagers)orcloseenoughtomakethe
preamplifierbehavenonlinearlyresultingin
intermodulation.ForthiskindofRFIturningdownthe
gainhelps.
Thetunersallhaveacertainamountofintrinsicnoisetoo.keenerdhaddonetestswithanR820Trtlsdr
terminatedtoaresistorinsideofametalbox.Forthesetestsrtl_powergainwassettomax(49.6dB)anda
frequencysweepwasdonethroughtheentiretunerrange,r820tBackgroundNoise.The28.8MHzspikes
fromtheclockfrequencycanbeseenamongotherabberations.
Butnoteverythingisaghostfromhardwaredesignproblems.Dependingonyourcomputersetupand
localelectronicstherecouldbealotof"realnoise"LCDmonitorsareacommonculpritforVHFnoise
spikesdistributedacrosswideranges.Itisbesttoshieldandputferritesoneverythingifyoucan.
TosolvethecommercialFMmixingproblemsanFMtrapcanbeused.Commercialonesworkfine
typically.ButfornoncommercialFMRFIlikeemergencyservicesandpagerscustomfiltersmustbe
madeorordered.tejeezsharedhisdesignonIRC.Ithastheuniquefeatureofnotalsowipingout
harmonicsoftheFMband:fmnotch.jpgfmnotch_schematic.png.Thismeansyoucanuseitandstilldo
widebandfrequencyhopping(unlike,say,a1/4thwavecoaxialstub).Formoreinformationonthis
generaltypeofcoaxialcablenotchfiltercheckoutEdLoranger'swriteuponVHFNotchfilters(photo).
Formypowerful461MHzRFIthatcanbereceivedwithoutanantennaIuseacustom3cavitynotchfilter
fromParElectronics.
Acinonyxdescribesonewaytodoingthisusingasinglestripofaluminumtapecombinedwithaspringto
connectittothedongleground.AkosCzermannatthesdrformarinersblogmadeasomewhatconfusing
butdefinitelyempiricalcomparisonofnoiselevelscomparedtodifferenthardwaremodslike
disconnectingtheUSBgroundfromthertlsdrground.Quiteafewpeoplehavehadsuccesswiththatand
scotchtapearoundtheUSBconnectorworkstotestit.
SomeothersbondtheenclosuretoboththeantennaandtheUSBshieldandthisworksreliablyandwell.
Martinfromg8jnj.netfindsthemosteffectivemodtoreduceUSBandDCconverternoiseisshieldingthe
antennainputareawithmetalsolderedtothepcbground,"Thenoiseseemstobecoupleddirectlybetween
componentsonthetopsideofthePCB."Youcanfinditifyouscrollabouthalfwaydownthepagelinked.
AdditionalnoisecomesfromtheswitchingpowersupplyintheRTL2832Uthatrunsat1.024MHz.This
dropsthesupplied3.3vdowntothe1.2vneededforinternaluse.ttrftechhassuccessfullydisconnected
thisswitchingsupplyreplaceditwith3diodestodropthe5vlinedownto~1.2v.Intheexamplelinked
abovettrftechusespowerformthefarsideoftheboardbuttheeeprom'spowerrailwouldalsowork.This
decreasesspursinHFsignificantly.Itwillincreasepowerusagethoughsomethingtowatchoutforwhen
R820Tdonglesstartoutat~300mAapiece.
Laidukas's"ModsandperformanceofR820T2basedRTLSDRreceivercoversreplacingallthepower
railswithexternallinearregulators,increasingtheamountofbypasscapacitanceonpowerlines,adding
extrachipfilteringfortheUSB5vline,cuttingofftheIRreceiverpartofthePCB,wiringinaTCXO
28.8MHzoscillator,creatingashieldwithkaptontapeandcopperfoilsolderedextensivelytothePCB
ground,andanewheavymetalcaseandconnectors.
ToreducesignallossoverlongdistancesandgetawayfromcomputerRFIIliketorunlongUSB*active*
extensioncablewithhubsattheendandferritesaddedinsteadofcoaxialcable.AroundthisUSBcableI
clipon5or6ferritesateachend.Activeextension/repeaterUSB2cablesofupto25minlengthcanbe
used.

UsingExternalClocksandcoherentsamplingingeneral...
Multiplecoherentdongles

ThemostexcitingdevelopmentinrtlsdrthathashappenedrecentlyareJuhaVierinen'sdiscussgnuradio
mailinglistandblogpostsaboutasimpleandinexpensivemethodtodistributetheclocksignalfromone
dongletomultipleothersforcoherentoperation.
http://superkuh.com/rtlsdr.html

6/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

"Irecentlycameupwithatrivialhacktobuildareceiverwithmultiplecoherentchannelsusingthe
RTLdongles.Idothisbasicallybyunsolderingthequartzclockontheslaveunitsandcabletheclock
fromthemasterRTLdongletotheinputofthebufferamplifier(Xtal_in)intheslaveunits(I'veattached
somepictures)."
SinceI'veseenalotofpeopleasking,thedonglesheusedwereNewskyTV28Tv2w/R820Ttuners.
$16dualchannelcoherentdigitalreceiver
Passiveradarwith$16dualcoherentchannelrtlsdrdonglereceiver
BenSilverwoodlaterreplicatedthistechniquewithhis"LowcostRTLSDRpassivemultistaticDAB
radar."implementationinmatlab.Theyoutubevideodescriptionhaslinkstophotosofthesetup.
Also,there'saJapanesesellerwithhighprecisionSMD28.8MHzcrystals.Andanebaysellerwithhigh
precision28.8MHzoscillatorsforaround~$30shipped.
ThingsagainbecameexcitinginJuneof2014.Goingbeyondsimpleclocksharingandit'smaxof3
dongles,YO3IIUputupagreatpostonhowtomakea4+dongleRTL2832ubasedcoherentmultichannel
receiverusingaCDCLVC1310EVMdevboardfromTIforclockdistribution.Hispostshowstheresults
ofagnuradioblockhecodedthatdoesallthecorrelationmathtoalignthesamplesfromeachreceiver
(whichareoutofstepduetothewayUSBworks).
steve|m'sexperimentswerethefirstIheardaboutbackin2011.Heusedhis13MHzcellphoneclockasa
referenceforaPLLtogenerate28.8MHz.Hesaidheused1vpeaktopeak.Healsorelateditwaspossible
tonotevenusethePLLandjustthe13MHzclockifw/E4000tunersifyoudon'tcareaboutsamplerate
offset.

<steve|m>notreally,justapictureandashortclip:http://stevem.de/projects/rtlsdr/osmoc
<steve|m>amotorolaC139
TheGreenBayPublicPacketRadioguyshavewrittenupaninterestingarticleonusing14.4MHz
temperaturecontrolledcrystaloscillatorssentthroughapassive(twodiode)frequencydoublerfollowed
bycrystalfiltersmadeoutoftheoldrtlsdrclockcrystalstoprovidealowPPMerrorclockforrtlsdr
devices.SincetheirmirrorwasmissingimagesIcutthemoutoftheZinepdfandmadeamirrorhere.
IfirstheardabouttheGBPPRarticlefrompatchvonbraunwhoimplementedoneandperformedtests
whichhepostedaboutontheSocietyforAmateurRadioAstronomylist.Itturnsoutthatevenwithagood
distributedclockthe2xR820trtlsdrdonglesstillhavelargephaseerrorforsomereason,see:Phase
coherenceexperimentswithRTLSDRdonglesandthephotopost:ProgresstowardsusingRTLSDR
donglesforinterferometry.
AlexPahahasalsodoneclockdistributionbutunliketheothersheusedE4000tunerbasedreceiversfor
hisdualcoherentreceiver.HealsoseemstobeusingonlyhalftheI/Qpairs.ThispostisinRussian.
PLLDitheringandyou.

OntheclockcoherenceysideMicheleBavaro'shasexplored,tweaked,andreplaced,librtlsdr'spllsetting
code,intermediatefrequency,andPLLditheringsettings,suchthatthemath,andresults,workoutcleaner.
UsingthismodifieddriverhewasabletominimizefrequencysettingerrorsandimprovehisGPScarrier
followingcode.Thisiswrittenupwithcodeexamplesathisblogin,GNSScarrierphase,RTLSDR,and
fractionalPLLs(thenecessaryevil).Withoutditheringyoucanonlytunetoincrementsof439.45Hz.
Withdithering,youcantunetoaproximatelyanything.
http://superkuh.com/rtlsdr.html

7/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

tejeezfromthe##rtlsdrIRCrelatesthatthiscanbedoneinr82xx_set_pllbychanging
r82xx_write_reg_mask(priv,0x12,val,0x08)tor82xx_write_reg_mask(priv,0x12,val|0x10,0x18).This
hasbeenimplementedasanoptioninrtl_sdr,'N',inkeenerd'sexperimentalbranch.
Misc

IntheabsenceofanyusefulinformationabouttheRTL2832Uclockhere'ssomeinformationaboutthe
R820T'sclocksystem.
Crystalparallelcapacitorsarerecommendedwhenadefaultcrystalfrequencyof16MHzis
implemented.PleasecontactRafaelMicroapplicationengineeringforcrystalparallelcapacitorsusing
othercrystalfrequencies.Forcostsensitiveproject,theR820Tcansharecrystalwithbackend
demodulatorsorbasebandICstoreducecomponentcount.Therecommendedreferencedesignfor
crystalloadingcapacitorsandsharecrystalisshownasbelow.

BroadbandAntenna

WhenIwanttodosomescanningthattakesadvantageofthetuner'sverywiderangesIusefourtypesof
antenna:discone,spiral,dualplanardisks,andhorns.Discone,dualplanardisk,andarchimedianspiral
antennacanomnidirectionallycoveralmostthefullrangeoftheE4000tunerbutthingsgetabittoolarge
togoallthewaytothe24MhzoftheR820T.Youcanrefertotheseperatespiralantennapagefor
constructionandtechnicaldetails.TobuildmydisconeIfollowedRoklobsta'sD.I.Y.Disconefor
RTLSDR.Withjustadisconeandrtl_powerit'spossibletoseelotsofLEOsatellitecarrierfrequencies
doppleracrossthespectrum.

http://superkuh.com/rtlsdr.html

8/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

Togetanideaofhowmuchyoucanseewithadisconehere'sadirectorywhereIproduce
~2to4daylong~70to1000MHzrange25KHzresolution45k*10kpixelspectrograms.
Theyeachhaveajavascriptzoomableinterfacetoloadsmalltilesprogressively.An
example.Withjustadisconeandrtl_powerit'spossibletoseelotsofLEOsatellitecarrier
frequenciesdoppleracrossthespectrum.
Butwithabandspecifichelixinaconereflector(helicone)manymoresatellitescanbepickedup.The
previousisalinktoazoomablespectrogramof~2daysofthe16161626MHzsatellitebandthatIridium
satellitesuse.NoLNAwasused.There'splentyofRFI/EMIeventhrougha1GHzhighpassbutthe
satellitedopplerpassesareclearlythereinnumbersifyouzoominfarenough.
Whenusingsuchbroadbandantenna,orevenabandspecifichelix,itispossibletopickuppowerfulout
ofbandsignalsduetooverloadingorincompletemixerfiltering.It'simportanttoidentifyany
extraordinarilypowerfultransmittersnearbyeandfilterthemout.InmycaseIhavea50wtransmitterat
461MHzacrossthestreetalwaysgoingfullpower.Iboughtacustomtuned3cavitynotchfilterfrom
PARElectronics.Thislimitstheupperfrequencyrangeto1GHzbutdoesatleastsolvetheRFIproblem.
Usuallythespectraaremuchcleanerwhenusingdirectionalandresonantantennainsteadofwideband
omnidirectionals.Butmanydirectionalantennalikehelixandlogperiodicdipoleshaveverylargeoutof
bandsidebandsonlowfrequenciesnotinthedesignedrange.

PageSections
Intro
Hardware
MyInterferometer
Links/Datasheets
(here)
InstallingRTLSDR
andGNURadio
RTLSDR
ApplicationsNotes
Pagers
GqrxonUbuntu
10.04
LTEScanneron
Ubuntu10.04
DongleLogger
GNURadio
Companion
Clocks
BroadbandAntenna

RTLSDRLinks

Chipsetdocs,GNURadio,DSP,andAntennaLinks
RTL2832UDownconversionNotes(pdf)
RTL2832URegisterNotes(pdf)
RafaelMicroR820Ttunerdatasheet(pdf)
ElonicsE4000LowPowerCMOSMultiBandTunerDatasheet(pdf)
ElonicsE4000referenceschematic(pdf)
E4000BenefitsofDigitalTuneArchitecture(pdf)
GNURadioWiki
http://lists.gnu.org/pipermail/discussgnuradio/
gnuradio'shttps://www.cgran.org/browser/projects
oz9aec'sGRCExamples
https://github.com/csete/gnuradiogrcexamples/tree/master/receiver
R820TDAB+driver(related)
balint256'sGNURadiotutorialvideos
firebyte'spostonr/GNURadio
RadiowareDocumentationGNURadiotutorials
GNURadiosuggestedreading
CSUN/EAFBSoftwareDefinedRadio(SDR)SeniorProject
TheScientistandEngineer'sGuidetoDigitalSignalProcessing
FundamentalsofWirelessCommunication
TutorialsinCommunicationsEngineering
SoftwareRadioforExperimenterswithGNURadio,OctaveandPython
AntennaTheory
AT&TArchives:SimiliaritiesofWaveBehaviorimpedanceexplained

rtlsdrwiki
osmocom
Knownapplications
rtlsdrwikiosmocom
rtlsdr.orgwiki
r/rtlsdrredditgroup
UltraCheapSDRgooglegroup
RTLSDRyahoogroup
AB9IL'srtl2832softwaredefinedradiooverview

Warning:I'mlearningasIgoalong.Thereareerrors.Refertotheproperdocumentationand
originalsourcesfirst.

GNURadio*and*RTLSDRSetup
Youdon'tneedGNURadiotousethertlsdrdonglesinsdrmode,buttherearemanyusefulappsthat
dependonit.patchvonbraunhasmadesettingupandcompilingGNURadioandRTLSDRwithallthe
rightoptionsverysimpleonUbuntuandFedora.Itautomatesgrabbingthelatestofeverythingfromgit
andcompiling.ItwillalsouninstallanypackagesprovidingGNURadioalreadyinstalledfirst.Simply
run,http://www.sbrac.org/files/buildgnuradio,andit'llautomatedownloadingandcompilingof
prequisites,libraries,correctgitbranches,udevsettings,andmore.IhadnoproblemsusingUbuntu10.04,
12.04,or14.04.Thesedays(2015)pybombsisslowlytakingoverforbuildgnuradiobutfornowthis
worksbest.
Ifyou'rethinkingabouttryingthisinavirtualmachine:don't.Ifyoudogetitpartiallyworkingit'llstill
suck.
Asanaside:Ifyou'reanOSXuserthenyoucanusetheMacPortsversionofGNURadio(includinggqrx,
etc)maintainedbyMichaelDickens.
mkdirgnuradio
cdgnuradio
wgethttp://www.sbrac.org/files/buildgnuradio
chmoda+xbuildgnuradio
./buildgnuradioverbose#defaultislatest3.7
*or*
http://superkuh.com/rtlsdr.html

9/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

./buildgnuradiooverbose#installold3.6.5.1
Install3.7.Mostgnuradioprojectshavebeenportedtoitasdefault.Onlyafewoldthingswillrequire3.6.
An(re)installlookslikethis.Itmightbeusefultosavethelogoutputforfuturereference.Thentestit.The
testoutputbelowisfromaveryoldversionofrtl_testwithanE4Kdongle.Newerversions,andR820T
tunerswilloutputslightlydifferenttext.
rtl_testt
Found1device(s):
0:ezcapUSB2.0DVBT/DAB/FMdongle
Usingdevice0:ezcapUSB2.0DVBT/DAB/FMdongle
FoundElonicsE4000tuner
BenchmarkingE4000PLL...
[E4K]PLLnotlocked!
[E4K]PLLnotlocked!
[E4K]PLLnotlocked!
[E4K]PLLnotlocked!
E4Krange:52to2210MHz
E4KLbandgap:1106to1247MHz
OnceGNURadioisinstalledthe"KnownApps"listatthertlsdrwikiisagoodplacetostart.Tryrunning
athirdpartyreceiver,apythonfileorstartupGNURadioCompanion(gnuradiocompanion)andloadthe
GRCflowcharts.Ifyou'rehaving"Failedtoopenrtlsdrdevice#0"errorsmakesuresomethinglike
/etc/udev/rules.d/15rtlsdr.rulesexistsandyou'verebooted.
Updating

Whenupdatingyoucanjustrepeattheinstallinstructionswhichissimplebutlong.Theadvantageto
repeatingthefullprocessismainlyiftherearemajorchangesinthegrosmosdraswellasrtlsdr.It'lldo
thingslikeldconfigforyou.
./buildgnuradioegnuradio_build
Justcompile/installingrtlsdr

Ifyoudon'thavethepatienceforafullrecompileandtherehaven'tbeenmajorgnuradioorgrosmosdr
changesit'smuchfasterjusttorecompilertlsdrbyitself.Theinstructionstodosoareattheosmosdr
page.It'llonlytakeafewminutesevenonslowmachines.Onceyouhavethelatestgitcloneitislikemost
cmakeprojects:
gitclonegit://git.osmocom.org/rtlsdr.git
cdrtlsdrmkdirbuildcdbuildcmake../makesudomakeinstallsudoldconfig

rtlsdrsupportingreceivers,associatedtools
keenerd'srtlsdrbranch
Thisexperimentalbranchcontainsanumberofusefullowprocessingpowerutilities,
expansionsoftheoriginalrtltools,andimprovementstotheR820Tdriverretuningspeed.A
lotofthemhavealreadybeenmergedintothelibrtlsdrmasterbutrtl_fmandrtl_powerfixes,
featuresandbugsappearherefirst.rtl_fmisforscanning,listening,anddecoding(andnot
justFM),rtl_adbsforplanewatchingwithanexternaladsbviewer,rtl_eepromforchecking
and*setting*serialnumbersandrelateddataifyourdonglehasaneeprom.Andasof2013
0920,rtl_power,atotalpowerfrequencyscanner.Thesetoolsareverygoodforslow
machinesorwhenyouwanttodocommandlineautomation.Justbuilditliketheosmocom
rtlsdrpagedoesforthevanillainstall.Usetheseontheraspberrypi.
gitclonehttps://github.com/keenerd/rtlsdr.git
gitclonehttps://github.com/keenerd/rtlsdrmisc
cdrtlsdrmkdirbuildcdbuildcmake../makecdsrc
Mostpeopleusertl_powerforsmallertotalbandwidths(<200MHz)andhigherspectral
resolutionusingthedefaultFFTmode.Thisisvisualizedwithkeenerd'sheatmap.pyandcan
resultinsomereallyimpressiveplotswhendonewith~25%cropmode.Justrefertotheh
"help"inrtl_powerforinstruction.Thereisalsoanrtl_powerguideatkeenerd'swebsite.
ForRMSaveragepowermode,whichkicksinautomaticallyforFFTbinsizes1MHzand
larger,Idovisualizationoftheresulting.csvfilewithgnuplot.Becausetheentirebandwidth
issummedandsavedasonevaluethethedataratetodisk,andspectrogramdimensionsare
muchlowerthanFFTmode.
Examplegnuplotvisualization,annotated,andthegnuplotformat,andcolourpalettesusedto
generatethem.
Ifyoudoalargenumberoffrequencyhops,(hundreds)thenthetimeaddsup.Onmytwo
computerstheR820Ttunerdonglesaverageabout55millisecondsperretuneandsample
cycle.Isometimeshavedonglesthat'llfailtolockpllandgointoaloop.Theeparameter
setsatimelimitforarun.Combiningthistimelimitwithabashwhileloopresultsinpretty
lowdowntimewithresiliancetortlsdrandUSBfailures.

#0.055seconds*((172424)MHz/(1MHz))=93.5seconds="i".
whiletruedo./rtl_powerf24M:1724M:1Mi94g20.7p30e1h>>20131202_tota
Tocombinetheresultsfrommultipledonglesjustcatthefilestogether.Butongnuplotsend
http://superkuh.com/rtlsdr.html

10/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

eachnew.csvfilenamerequiresyoutomanuallyeditthegnuplotformat.Additionallyyou
needtosettheoutputspectrogramfilenameandapixelwidth.Ifindfor1000Mhz@1MHz
thatapproximately1000pxper100MBoffilesizeisrequiredtocoverallgaps.
gnuplotgnuplotformatrmsmode.txt
Andthatpopsoutapng.
Forrtl_fmstuffrefertokeenerd'ssite'sRtl_fmGuide.
patchvonbraun(MarcusLeech)'smultimode:
AM,FM,USB,LSB,WFM.TVFM,PALFM.Verynice,easytouse(screenshots:main,
scanning).Ithasanautomatedscanningandspectralzoomfeatureswithcallbackstoclickon
thespectrogramorpanoramatotunetothefrequencyofinterest.There'satoggleforactive
gaincontroltoo.Thewaytogetitis,
svncohttps://www.cgran.org/svn/projects/multimode
theninsteadofusingGRC,justrunthemultimode.pyasis.
makeinstall
pythonmultimode.py
Ifyourunitoutsideofthesvncreateddirectoryyoumightneedtoappend~/binto
pythonpathtofindthehelperscript.Ifyouusedbuildgnuradioit'lltellyouwhatthisisatthe
endoftheinstall.
Alternatelysetitinyour~/.bashrc.Ifyoudothebelowmakesuretoreloadintheterminalby
"source~/.bashrc")
PYTHONPATH=/usr/local/lib/python2.6/distpackages:~/bin
exportPYTHONPATH
Whensettingthesamplerateitisroundeddowntoamultipleof200Kspssothedecimation
mathworksout.
pythonmultimode.pysrate=2.4M#usenormalmodewith2.4MHzbandwidth
./multimode.pydevinfo="rtl=0,direct_samp=1"#usedirectsamplemode
pythonmultimode.pyhelp
Ifyouhaveoverrunslike"OOOOoo..."thentryreducingthesamplerateorpausingthe
waterfallorspectrumdisplays.
"Theaudiosubsystemuses'a'astheidentifier,andUHDuses'u'.WithRTLSDR,it'llissue
'O'whenitexperiencesanoverrun.Whichmeansthatyourmachineisn'tkeepingupwith
thedatastream.Sometimesbufferinghelps,butonlyifyourmachineisrightontheedgeof
workingproperly.Ifitreallycan't,onaverage"keepup",noamountofbufferingwill
help."
Ifyouhaveoverrunslike"aUaUaUaUa"orjust"aaa"thentheaudiosystemisaskingfor
samplesatahigherratethantheDSPflowcanprovide(44vs48Khz,etc).Use"aplayl"toget
alistofthedevicesonyoursystem.
aplayl
Thehw:X,Ycomesfromthismappingofyourhardwareinthiscase,Xisthecardnumber,
whileYisthedevicenumber.Oryoucanuse"pulse"forpulseaudio.Tryspecifying,
pythonmultimode.pyahwhw:0,0
gqrx:
WrittenbyAlexandruCseteOZ9AEC"gqrxisanexperimentalAM,FMandSSBsoftware
definedreceiver".Theoriginalversiondidnothavelibrtlsdrsupportsochangesweremadeby
anumberofotherstoaddit.AcoupleweekslaterCseteaddedgrosmosdrsupporttothe
original.DekarestablishedanonpulseaudioportofgqrxforMacOSX.GNURadio3.7has
recentlybeenreleasedanditisnotexactlybackwardscompatible.patchvonbraun'sbuild
gnuradio.shpulls3.6.53.7.xbydefault.
AsofAugust9th2013Gqrx2.2.0hasbeenreleased.Thisupgradedversioncannowbe
installedasbinarieswithallofit'sdependenciesprepackagedonbothUbuntulinux(a
customPPA,no10.04packages)andMacOSX!ThatincludesalltheGNURadiostuff.So
thisisanallinonealternativetobuildingGNURadiofromsource.
Ithinkthisperson'sguideisbetterthanmine.
gitclonehttps://github.com/csete/gqrx.git
cdgqrx
#onUbuntu/Debian,sudoaptgetinstallqtcreator,ifyoudon'thaveit.
qtcreatorgqrx.pro
#pressthebuildbutton(thehammer)
#oravoidqtcreatoranddoitmanually.ifyouhaveqt5too,use"qmakeqt4"
qmake
make
rtlsdrw/GqrxonN900phones
xesprovidesprecompiledpackagesofGqrxandtheGNURadiodependenciesfor
N900linuxcellphones.
SDR#:
Writtenbyprog(Youssef)forWindows.Itisprobablythebestgeneralsoftwareforrtlsdr
http://superkuh.com/rtlsdr.html

11/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

devicesintermsofperformance.Itisupdatedveryoftenaswell.Atthertlsdr.orgwikithereis
aguidetorunningtheoriginalC#versionunderlinuxwithmonobutthatonlyworksforold
versions.Insteadlookatryan_turner'sexampleinstallathttp://pastebin.com/tgYwRBQt(local
mirror).Monoisalittleslow,butifyourestrictthesamplerateitworksfine.It'sprobablythe
easiestprogramtouseandithasthebestDSPandfeaturesfordealingwiththequirksofthe
rtlsdrdongles.Asof20121007italsohasGUItogglesforthedirectsamplingmodetolisten
to<30Mhzsignals.In0.25MS/smodeitcanevenrunonmyold1.8GhzP4laptop.
AsofJuly2014therehavebeenmany,manyupdatestoSDR#sinceIlastuseditonlinux.
Thebelowinstructionsmaynolongerapply.Ihearthatthissetofinstructionsandpatchthat
BzztPloinkof##rtlsdrputtogetherwillworkthough.
TocompileitonUbuntu10or12consultKJ4EHDryan_turner's
http://pastebin.com/tgYwRBQt.Don'texecutethisbecauseitisold.The"Release"dir
hardcodedinisnow"Debug".
sudoaptgetinstallsubversiongitmonocompletelibportaudio2monodevelopicoutils
svncheckouthttps://subversion.assembla.com/svn/sdrsharp/
cdsdrsharp/trunk
yulian'scommenttippedmeoffthatSDRSharp.slnhastobeeditedforolderversionsofmono
(likefromUbuntu12.04).OpenitandchangeMicrosoftVisualStudioSolutionFile,Format
Version12.00to11.00andVisualStudio2012to2010anditwillcompile.

mdtoolbuildc:ReleaseSDRSharp.sln
cdRelease
lns/usr/local/lib/librtlsdr.solibrtlsdr.dll
lns/usr/lib/x86_64linuxgnu/libportaudio.so.2libportaudio.so

#modifyconfig
sedi'/SDRSharp.SoftRock.SoftRockIO,SDRSharp.SoftRock/d'SDRSharp.exe.config
sedi'/SDRSharp.FUNcube.FunCubeIO,SDRSharp.FUNcube/d'SDRSharp.exe.config
sedi'/SDRSharp.FUNcubeProPlus.FunCubeProPlusIO,SDRSharp.FUNcubeProPlus/d'SDRSharp.e
sedi'/SDRSharp.RTLTCP.RtlTcpIO,SDRSharp.RTLTCP/d'SDRSharp.exe.config
sedi'/SDRSharp.SDRIQ.SdrIqIO,SDRSharp.SDRIQ/d'SDRSharp.exe.config
sedi's/<!<addkey="RTLSDR\/USB"value="SDRSharp.RTLSDR.RtlSdrIO,SDRSharp.RTLSD
ADBS#isanothereasytouseapplicationbyprog,butspecificallyforplottingaviation
transponderslikegrairmodesdoes.Thedistributedbinariesalsorunsunderlinuxwithmono
(ornativeinwindows)andoutputvirtualradarcompatibledataon127.0.0.1:47806.Ifyour
antennaconditioniscrappy,tryusingfilter=1.
grfosphor:
grfosphorisanamazinglyfastandinformationdensespectrogramandwaterfallvisualization
usingOpenCLhardwareacceleration.ItsurpassestheWxwidgetelementsinperformance,
andsousability,byfar.Withthisvisualizationyoucaneasilyskipthrough1GHzofspectrum
veryquicklyandactuallynoticetransientsignalsastheypass.Rightnowitisnotvery
configurable,justarrowkeysforscale.Butexpectthistobethepreferredvisualizationblock
inthefuture.IhavewrittenupanbarebonesguidetoinstallinggrfosphoronUbuntu12.04.
grairmodes:
AdecoderofaviationtransponderModeSincludingadsbreportsnear1090Mhz.Itcanbe
coupledtosoftwaretoshowplanepositionsinnearrealtime(ex:VirtualRadar).Thisworks
undermonoonUbuntu12.04butnot10.04.OriginallywrittenbyNickFoster(bistromath)
andadaptedtortlsdrdevicesfirstbySteveMarkgraf(stevem),bistromathlateraddedrtlsdr
support.Here'sanexampleofbasicdecodingdonewiththestockantennaontheearlyversion
bystevem.Nowdaysit'sbettertousebistromaths'.
AsofJuly23,2013therewasamajorupdatetograirmodeswhichnowincludesanice
googlemapsoverlayandworksongnuradio3.7branchonly.
gitclonehttps://github.com/bistromath/grairmodes.git
Here'sanexampleofinstallprocessandfirstrunlookslike.
#dstandsforrtlsdrdongle,locationis"North,East"
uhd_modes.pydlocation"45,90"
TousewithvirtualradaroutputaddthebelowPswitch.Thenopenupvirtualradarwith
monoandgototools>options>basestationandputintheIPofthecomputerrunning
uhd_modes.TherearenotmanycompatibleplanesintheUSAsofarsoevenifyouareseeing
lotsofModeSbroadcastinuhd_modesyoumightnotseeanythinginvirtualradar.
Sometimesmyserverisrunningatsuperkuh.com:81/VirtualRadar/GoogleMap.htm.
uhd_modes.pydlocation"45,90"P
monoVirtualRadar.exe
Dump1090:
Dump1090isaModeSdecoderspecificallydesignedforRTLSDRdevices.
Antirezs'ADSBprogramisreallyslick.ItdoesnotdependonGNURadio,hasanumberof
interactivemodes,anditevenoptionallyrunsit'sownHTTPserverwithgooglemapsoverlay
ofdiscoveredplanesnovirtualradarneeded.ItusesverylittleCPUandhasimpressiveerror
correction.Thisisyourbestchoicetoplaywithplanetrackingquickly.
#runcliinteractivelyandcreateagooglemapsserveronlocalhostport8080
./dump1090aggressiveinteractivenethttpport8080
http://superkuh.com/rtlsdr.html

12/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

#submitplanedatatoatrackingserver
./dump1090aggressiveraw|socatuTCP4:sdrsharp.com:47806
linrad:
Aguideonhowtouselinradwithrtlsdr,andamodificationtothethelibrtlsdre4000tuner
codetodisabledigitalactivegain!redditthread
"ItriedvariousbitsblindlyandfoundasettingthateliminatestheAGCintheRTL2832
chip.Thatisasignificantpartoftheperformanceimprovement."
Asof20120707thisfeaturewasaddedtothemain(librtlsdr)driveraswell.
LTECellScannerandLTETracker:
"ThisisanLTEcellsearcherthatscansasetofdownlinkfrequenciesandreportsanyLTE
cellsthatwereidentified.AcellisconsideredidentifiediftheMIBcanbedecodedand
passestheCRCcheck."
"LTETrackerisaprogramthatcontinuouslysearchersforLTEcellsonaparticular
frequencyandthentracks,inrealtime,allfoundcells.WiththeadditionofaGPSreceiver,
thisprogramcanbeusedtoobtainbasiccellularcoveragemaps."
TheauthorhadonlytesteditonUbuntu12.04butwithsomefrustratingworkreplacing
cmakefilesandcompilingdependenciesImadeitworkon10.04.Scannerisveryusefulto
getyourdongle'sfrequencyoffsetreliablyandTrackerisverypretty.
kalibratertl:
"Kalibrate,orkal,canscanforGSMbasestationsinagivenfrequencybandandcanuse
thoseGSMbasestationstocalculatethelocaloscillatorfrequencyoffset."
ThecodewaswrittenbyJoshuaLackeyandmadertlsdraccessiblebystevem.Thereisalsoa
windowsbuildmadebyHoernchen.Whenyou'reusingthistofindyourfrequencyerrorit's
importanttousetheeoptiontospecifyintialerror.270kofbandwidthisusedforGSM
receptionandiftheerrorofthedongleistoolargetheFCCHpeakisoutsidetherange.I
compiledsomeinstallprocessandexampleusagenotes.
SimpleFM(Stereo)Receiver
simple_fm_rcvalsobypatchvonbraunisthebestsoundingandtuningcommercialFM
softwareinmyopinion.Hereleasedamajorupdatetohisgnuradiocreationattheendof
October.
svncohttps://www.cgran.org/svn/projects/simple_fm_rcv
cdsimple_fm_rcv/
cdtrunk
lessREADME
make
makeinstall
##it'llinstallto~/bin/,soIuse~/superkuh/binbelow
setPYTHONPATH=/usr/local/lib/python2.6/distpackages:/home/superkuh/bin
#runthepythonscript
pythonsimple_fm_rcv.py
#oreditit
gnuradiocompanionsimple_fm_rcv.grc
myDongleLogger:
Iwrotethesescriptsdoautomaticgenerationof1Dspectrograms,perfrequencytimeseries
plotsoftotalpower,and2Dspectralmapsoverarbitraryfrequencyrangesusingmultiple
donglesatonce.ThereisalmostnoDSPdoneanditisverysimplebutthewideband
spectrogramsandtimeseriescanbeinformativeandfunregardless.Itusesgnuplotfor
graphicsgeneration.Obsolete.Usertl_powerinstead.
Youcanseeatypicalgalleryoutputat,http://erewhon.superkuh.com/gnuradio/live/butmore
usefularethegnuplotspectrogramsitcanmake.
simple_ra:simpleradioastronomy
Asimple,GRCbasedtoolforsmallscaleradioastronomy,providingbothTotalPower
andSpectralmodes.Ithasagraphicalstripchartdisplay,andastandardFFTdisplay.It
alsorecordsbothtotalpowerandspectraldatausinganexternalCprogramthatrecords
thedataalongwithtimestampsbasedontheLocalMeanSiderealTime.
Thisisanotherincredibletoolbypatchvonbraun.Itdoesalltheheavyliftingofintegration
overtimeandsignalprocessingtogetanaccuratemeasurementofabsolutepowerovera
range.Withithehasmanagedtopickoutthetransitofthemilkywayattheneutralhydrogen
frequencyusingrtlsdrsticksandapairofyagiantenna.Thelogfileformatistextandfairly
easytoparsewithgnuplotbutitcomeswith'process_simple_tpdat'forcuttingitintothebits
youwantandmakingtotalpowerorspectralcomponentgraphs.It'llmakeadirectorycalled
"simple_ra_data"inyourhomebydefault.Don'tforgettosetthedevidtortlotherwise
gnuradiowon'tfindthegrosmosdrsourceandit'llsubstituteagaussiannoisesource.
svncohttps://www.cgran.org/svn/projects/grra_blocks
cmake.makesudomakeinstallsudoldconfig
svncohttps://www.cgran.org/svn/projects/simple_ra
cdsimple_racdtrunk
make
makeinstall
http://superkuh.com/rtlsdr.html

13/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

#UsingasingleE4ktuner
./simple_radevidrtl=0,offset_tune=1longitude45
#UsingaseconddonglewithR820Ttuner
./simple_radevidrtllongitude45
#Usedirectsamplemode@1.25MHz,logoncepersecond,setlongitude
./simple_radevidrtl=0,direct_samp=1freq1.25e6longitude90lrate1
#generatemultidayaveragedgnuplotsusingsiderealtime
process_simple_tpdat02:00:002.0t"11GHzTest"f11ghz.png~/simple_ra_data/tp201
./simple_rah(README)
Asof~Jul5th2013therehavebeenbigchangestoGNURadioandasaresult,simple_ra.It
nowdependsonexternalpackagesfromCGRAN.
Here'swhatIsuggestyoudo:pullandrunthelatestbuildgnuradio.pullgrra_blocksof
CGRAN,andbuild/installthat.pulllatestsimple_rafromCGRAN,andbuildandinstall
that.
RTLSDRScanner
EartoEarOakmadethiswidebandtotalpowerscannerthatgenerates1Dspectrumplotsover
anytunablerangeswitharbitraryintegrationtimes.ItcanupdateamatplotlibpythonplotGUI
inrealtimeandhastheabilitytooutputcvsvaluesaswellasaninternalformat.It'svery
usefulforfindingwhat'sbroadcastinginyourareaquickly.Usingit'scsvoutputandgnuplotI
visualizedascanfrom541100MHz.
Ifyouwanttousethedataingnuplotyouhavetosortitandmakesuretheheaderis
commentedout.
sortn541100_500ms.csv>sorted_541100_500ms.csv
Herearesomeexamplegnuplotformatsforthedata.
YoucancommentouttheheadermanuallybutIinsteadprefixedahashtothelogwriting
behavioratline786,
handle.write("#Frequency(MHz),Level(dB)\n")
Pagerstuff
ThomasSailer'smultimon,"LinuxRadioTransmissionDecoder"whichIuseto(tryto)decode
pagertransmissionsaround930Mhz.AndmorerecentlyDekar'smultimonNG,aforkwithimproved
errorcorrection,moresupportedmodes,and*nix/osx/windowssupport.DekaralsosuppliedaGRC
receiverforpagerstodecodepagertransmissionsinrealtimeusingfifos.zaryahasmade
rtl_flex.py,agnuradiobasedflexdecoderforpagers.Itcanbeusedtodecodedutchp2000
messages,forexample.Thisfillsagapinmultimonngpagersupport.
DongleLogger:mypyrtlsdrlibbasedspectrogramandsignalstrengthlogandplotter

Purpose:
Obsolete.Usertl_powerinstead.Automaticgenerationofandhtmlgallerycreationofwideband
spectrogramsusingmultiplertlsdrdonglestodivideupthespectrum.Italsoproducesnarrowbandtotal
charts,andothervisualizations.

(notlive):http://erewhon.superkuh.com/gnuradio/live/clickthespectrogramsfor
timeseriesplot
Thesescriptscausethertlsdrdongletojumpfromfrequencytofrequencyasfastastheycanandtakevery
roughtotalpowermeasurement.Thisdataisstoredinhumanreadablelogsandlaterturnedintowideband
spectrogramsbycallinggnuplot.Inordertofurtherincreasecoverageofanygivenspectrumrange
multipleinstancesofthescriptcanberunatonceinthesamedirectoryaddingtothesamelogs.Their
combinedoutputwillberepresentedinthespectrogram.
Details:
Idon'tknowmuchpythonbutthepythonwrapperforlibrtlsdrpyrtlsdrwasabiteasiertoworkwiththan
gnuradiowhenIwantedtodosimplethingswithoutaneedforprecisionoraccuracy.Actualyreceivers
withprocessingcouldbemadewithittoo,butnotbyme.Thisisthegistofwhatitdoes,
http://superkuh.com/rtlsdr.html

14/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

power=10*math.log10(scan[freq])=scan=self.scan(sdr,freq)=capture=sdr.read_samples(
Thepyrtlsdrlibrarycanbedownloadedby,
gitclonehttps://github.com/roger/pyrtlsdr.git
Ihaveusedthe"test.py"matplotlibgraphicalspectrogramgeneratorthatcamewithpyrtlsdrasaseedfrom
whichtoconglomeratemyownprogramforspectrumobservationandlogging.SinceIamnotverygood
withpythonIhadtopullalotofthelogicoutintoaperlscript.Soeverythingismodular.Asofnowthe
pythonscriptgeneratesthespectrogrampngsandrecordssignalstrength(andmetadata)infrequency
namedlogs.Itispassedlotsofarguments.
Theseargumentscanbemadehoweveryouwant,butIwroteaperlscripttoautomateitalongwithafew
otherusefulthings.Itcangenerateasimplehtmlgalleryofthemostrecentfullspectralmapand
spectrogramswitheachlinkedtothelogofpastsignallevels.Oritcanadditionallygenerategnuplottime
seriespngs(example)andlinkthoseinteadoftherawlogs.ItalsocallsLTECellScannerandparsesout
thefrequencyoffsetforpassingtographfreq.pyforcorrection.Inolongerhaveitrunningbecauseofthe
processorusagespikeswhichinterruptdailytasks.InthepastI'dhaversyncupdatingthepublicmirror
withabigpipeevery~40minutes.
Modifyingpyrltsdr

Asitispyrtlsdrdoesnothavetheget/setfunctionsforfrequencycorrectionevenifIsentthePPMcorrect
fromtheperlscript.Sincethehooks(?)werealreadyinlibrtlsdr.py(line6066)butjustnotpythonizedin
rtlsdr.pytheywereeasytoaddtothelibrary.Thesechangesarerequiredtousefrequencycorrectionand
maketheintvariable"err_ppm"available.IhaveprobablyshownthatIdon'tknowanythingaboutpython
withthisdescription.
Iforkedroger'spyrtlsdrongithubandaddedthemthereforrevieworuse,
https://github.com/superkuh/pyrtlsdr/commit/ffba3611cf0071dee7e1efec5c1a582e1e344c61.Iapologize
forclutteringupthepyrtlsdrnamespacewithsuchtrivialchangesbutI'mnewtothisandgithubdoesn't
allowforprivaterepositories.
Whatyoushouldbeusinginstead.

rtl_powerwasrecently(20130820)releasedbykeenerd.Itdoesmostofwhatmyscriptsdo,except
muchbetter,faster,andeasier.Ihighlyrecommendyoutryitfirst.
RTLSDRScannerbyEarToEarOakisawesomeforgenerating1Dwidebandspectrograms.
EnochZembecowiczmadeapolishedandusefulsdrloggingtool
Panteltje'srtl_sdr_scanisanothertoollikeRTLSDRScannerfor1Dtotalpowerscans.Itisagood
referenceforusinglibrtlsdrwithC.
Ifyouareseriousaboutmeasuringtotalpoweroverone2.5Mhzrangethensimple_ra,orsimple
radioastronomy,isbest.
tholinfrom##rtlsdrhasmodifiedlibrtlsdr(?)sothatitdoesn'twaitnearlyaslongfortheplltosettle.
Itcanretuneatratesofupto~1.6hopspersecond.That'sa30ximprovementinspeedovernormal
forallrtlsdrappsusinglibrtlsdr.Thewidebandwidthspectrogramshehascreatedwithrtl_power
andthismodificationlookamazing.Checkthemoutandgrabacopyofthemodifiedrtlsdrsource
fromhiswebsite.

Download
fastversion:seebelow
dongleloggerfaster.tar.gzallneededfilesincludingpyrtlsdr
radioscan_faster.plpyrltsdrusingscriptfrequencysettingandincrimenting,sampling,and
logging.
graphfreqs_faster5.pyoptionpassing,logparsing,plotmaking,frequencycorrections
wrapper,htmlimagegallerygeneration
graphfreqs_gnuplot.pylegacyfunctions
slowversion:
graphfreqs.pypyrltsdrusingscriptsampling,andlogging
radioscan.plmanagesgraphfreqs,parseslogs,makesplots,getsfrequencycorrections,generates
gallery

Thefasterversion
Speedups,InlineCusbreset,andavoidingdonglereinitialization...(lessoptions)
cliswitches/options

dev1

::rtlsdrdeviceID(usetopickdongle)
g30

::gain
s

::intervalbetweencenterfrequencies
r2400000

::samplerate
d2/path/here
::pathtothedirectorytoputlogs,plots,gallery
c751

::LTCCellscannerfrequencyoffsetcorrection,takesfreqinMhzofb
w

::turnonwebgallerygeneration
p

::turnongnuplottimeserieschartsforeveryfreq(don'tusetomaxi
m

::generatefullrangespectrogramusingall.log(thisisthemostusef
mr"521108,12481400,19002200"
::setoffrequencyrangestoplotasaanotherspectro
Thesetwoscriptsdofastscanswithinpythonfromxtoyfrequency.Enableditwithfastandmakesureto
http://superkuh.com/rtlsdr.html

15/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

setstartandstopfrequencywithf1andf2.Donotuseflistwiththisoption.

$whiletruedoperlradioscan_faster.pld2/tmp/fasterf125f21700fastg30r240000
Runninggraphfreqinnonbatchfastmode25to1700Mhzat1.2Mhzspacings.
Spectrogramsandtextoutputdisabled.
UsingLTECellScannertofindfrequencyoffsetfrom751Mhzstation...FoundRafaelMicroR820T
44kfrequencyoffset.Correcting58PPM.
Generatingspectralmap.
python./graphfreqs_faster.py4000000024000003058/tmp/faster1700000000
FoundRafaelMicroR820Ttuner
...(repeatmany,manytimes)
Thisisanexampleoutput"spectralmap"(aspectrogramwithasillyname).

Thisexampleoutputaboveshowstheoverloadingeffectsofusingawidebanddisconethatpicksupoff
bandnoise.Eachcolumnismadeupofsmallsquarescoloredbyintensityofthesignal.Sincethescripts
startatthelowfrequencyandsweeptohighthereisasmalltimedelaybetweenthebottomandtop(seeit
moreclearlyzoomedin).Andthisisrepresentedastheslantoftherow.Sometimesstrongsignalswill
swampoutothersresultingindiscontinuitiesdisplayingassmalldarkverticalbands.
Orfast(fast)scanasmallerrangewithsmallerrange(f1,f2:2480Mhz),withsmallersamplerate(r:
250Khz)atsmallerintervals(s:400Khzsteps)withagainof~30.Onlyoutputalargespectrogramofall
frequenciestothedirectoryspecifiedwithd2asspectralmap.png.Thisexampledoesnotusefrequency
offsetcorrect(c)forevenfasterspeeds.

whiletruedoperlradioscan_faster.pld2/home/superkuh/radio/20120202_R820T_Discone_lowfr
Runninggraphfreqinnonbatchfastmode24to80Mhzat0.4Mhzspacings.
Spectrogramsandtextoutputdisabled.
Generatingspectralmap.

python./graphfreqs_faster5.py24000000250000300/home/superkuh/radio/20120202_R820T_Disco
FoundRafaelMicroR820Ttuner
Exactsamplerateis:250000.000414Hz
Combiningmultiplertlsdrdevicesforgreaterspeed
Full

http://superkuh.com/rtlsdr.html

16/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

Zoom

Bysplittingupthespectrumintomultiplesmallerslicesandgivingthemtomultipledonglesthetime
requiredforonescanpasscanbegreatlyimproved.Theabovespectrogramismadewith2dongles,one
forthelowerhalfandonefortheupper.Itisfromryannathanswhoalsocontributedthecodeforfor
specifyingdeviceID.Thisisassimpleasrunningthescripttwicebutgivingeachinstanceadifferent"
dev"argumenttospecifydeviceID.Youcanrunasmanyrtlsdrdeviceswithmyscriptsasyouwish(upto
theUSBandCPUlimits).Iftheyareusingthesamedirectory(d2)theirlogdatawillbecombined
automagicallyforbettercoverage.

whiletruedoperlradioscan_faster.pld2/home/superkuh/radio/20130609_multidonglef125
...
FoundRafaelMicroR820Ttuner

whiletruedoperlradioscan_faster.pld2/home/superkuh/radio/20130609_multidonglef1525
...
FoundElonicsE4000tuner
Outliersignalsskewingyourcolormapscale?

SometimesIgetcorruptsamplesthatshowasignallevelof+60dB.Theseskewthescaleoftheoutput
spectrograms.IfInoticethattheyhaveoccurredduringalongrunI'llusegreptofindthemandremove
themmanually.Ireplacethesignallevelwiththelevelofthepreviousnoncorruptsample.Inthefuture
I'llbuildthiskindofoutlierremovalintothescripts,orsanitycheckbeforewritingthem.
greprinP"(3|4|5|6)\d+\.\d+"*.log
AlltheincrementalimprovementsinspeedI'vemadeaboveareokaybutnotveryeasytomaintainwith
multiplescripttypes(bash/perl/python).I'mslowlyputtingtogetheranInlineCbasedperlwrapperfor
exposinglibrtlsdr'sfunctionswithinaperlscripttowritethisasastandaloneinperl.Thisisslowwork
becauseI'veneverdoneanythinglikeitbefore.
rtlsdrperlaperlwrapperforlibrtlsdr

Ionlyhavethemostbasicofbasicsfleshedoutrightnow,buthere'ssomeexamplecode.Iwouldhave
neverachievedeventhissimpletaskifnotforthehelpIreceivedfrommuckeronFreenode's#perl.
#!/usr/bin/perl
useInlineC=>DATA=>LIBS=>'L/usr/local/lib/lrtlsdrlusb'
usewarnings
usestrict
my$fuckingtest=get_device_name(0)
print"Devicename:$fuckingtest\n"
my$fuckingtest2=get_device_count()
print"#Devices:$fuckingtest2\n"
__END__
__C__
constchar*rtlsdr_get_device_name(uint32_tindex)
char*get_device_name(intcount){

char*res=rtlsdr_get_device_name(count)

returnres
}
uint32_trtlsdr_get_device_count(void)
intget_device_count(){

inthem=rtlsdr_get_device_count()

returnhem
}
Olderversion
graphfreqs.py

Youhavetohavethemodifiedpyrtlsdrwiththeget/setfunctionsforfrequencycorrection.LTECell
Scannershouldalsobeinstalledsothe"CellSearch"binaryisavailable.Thendownloadthetwoscripts
aboveandputtheminthesamedirectory.Forlargebandwidthssampledthisfeature,ppmerrorcorrection,
hasanunnoticablysmalleffectbutIwantedtoadditanyway.
Tocallthespectrogram/loggeneratorbyitselffor431.2Mhzat2.4MS/swithagainof30andfrequency
correctionof58PPMuseitlike,
pythongraphfreqs.py43120000024000003058
I'vedisabledthematplotlib(python)perfrequencyspectrogramplotsforfrequenciesover1Ghzbecause
there'snotmuchgoingonupthere.Also,thexaxisticksandlabelsbecomeinaccurateforsomereason.
Logsandformat

Thesignalstrengthlogs,namedbyfrequency(e.g.53200000.log),useunixtimeandarecommaseperated
http://superkuh.com/rtlsdr.html

17/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

withnewlinesaftereachentry.Inorderofcolumnsitis:unixtime,relativesignallevel,gainindB,PPM
correction.
1345667680.28,34.65,29,57
1345667955.59,34.67,29,57
1345668004.37,34.55,29,57
1345668110.06,33.88,29,57
Italsogeneratesalogfilewithallfrequenciesforusewithgnuplot,all.log.Thisfilehasunixtimefirst,
thenfrequency,thengainandppmerror.
1347532002.55200000014.8429.058
1347532004.885320000017.8429.058
1347532007.045440000017.9829.058
1347532009.045560000019.7829.058
1347532011.025680000024.0429.058
1347532012.985800000026.2129.058
1347532014.925920000025.1029.058
radioscan.pl

Theradioscan.plscriptisusedtoautomatecallinggraphfreqsinarbitrarysteps.Togenerateplotsand
signalstrengthfor52Mhzto1108Mhzwithagainof30,samplerateof2.4MS/s,andanintervalbetween
centerfrequenciesof1.2Mhz,callitlike,
$perlradioscan.plflist"521108,12482200"g30r2400000s1.2
cliswitches/options

flist"521108,12482200"::setsoffrequencyrangestoscan.
g30

::gain
s

::intervalbetweencenterfrequencies
r2400000

::samplerate
d1/path/here
::pathtowherethescriptsareifnowpwd
d2/path/here
::pathtothedirectorytoputlogs,plots,gallery
c751

::LTCCellscannerfrequencyoffsetcorrection,takesfreqinMhzofb
w

::turnonwebgallerygeneration
p

::turnongnuplottimeserieschartsforeveryfreq
m

::generatefullrangespectralmapusingall.log
mr"521108,12481400,19002200"
::setoffrequencyrangestoplotasaanotherspectra
BecauseIcanusethedefaultdirectoriesIkeepitrunninglikethebelow,butanyoneelseshouldmakesure
tosetd2.

$whiletruedoperlradioscan.plflist"521108,12482200"g30r2400000s1.2wc751

Runningpyrtlgraphfreqbatchjob52to1108Mhzat1.2Mhzspacings.
UsingLTECellScannertofindfrequencyoffsetfrom751Mhzstation...FoundElonicsE4000tune
42.6kfrequencyoffset.Correcting56PPM.
Generatingspectralmap.
Generatinganotherspectralmapoveronly521108.
python./graphfreqs_offset.py5200000024000003056
FoundElonicsE4000tuner
python./graphfreqs_offset.py5320000024000003056
FoundElonicsE4000tuner
python./graphfreqs_offset.py5440000024000003056
FoundElonicsE4000tuner
...
python./graphfreqs_gnuplot.py31600000024000003056
FoundElonicsE4000tuner
Donglefroze,resetingit'sUSBdevice...
ResettingUSBdevice/dev/bus/usb/001/017
Resetsuccessful
python./graphfreqs_gnuplot.py31720000024000003056
FoundElonicsE4000tuner
..
Generatingpage,movingimages.
startingrsync...
Tuner/USBfreezesolutionwithunplugging
edit:asofJan5th2013,librtlsdrhasaddedsoftresetfunctionality

Sincegraphfreqs.py'sinitializingandcallingofrtlsdrhappenssofrequentlytherearesometimesfreezes.
TofixthesetheUSBdevicehastobereset.InthepastIwouldaccomplishthisbyunandrepluggingthe
cordmanually.ButthatmeantlotsofdowntimewhenIwasawayorsleeping.So,I'veaddedinasmallC
programtotheperlscriptusingInline::Cthatexposesafunction,resetusb().Itisusediftheevalloop
aroundthegraphfreqscalltakesmorethan10seconds.ThismeansyouneedInline::Ctorunthisscript.
TolookattheoriginalCversionwithagoodexplanationofhowtouseitclickhere.
subdonglefrozen{

my$usbreset

my@devices=split("\n",`lsusb`)

foreachmy$line(@devices){
http://superkuh.com/rtlsdr.html

18/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

}}}

if($line=~/\w+\s(\d+)\s\w+\s(\d+):.+RealtekSemiconductorCorp\./){

$usbreset="/dev/bus/usb/$1/$2"

resetusb($usbreset)

__END__
__C__
#include<stdio.h>
#include<unistd.h>
#include<fcntl.h>
#include<errno.h>
#include<sys/ioctl.h>
#include<linux/usbdevice_fs.h>
intresetusb(char*dongleaddress)
{

constchar*filename

intfd

intrc

filename=dongleaddress

fd=open(filename,O_WRONLY)

if(fd<0){

perror("Erroropeningoutputfile")

return1

printf("ResettingUSBdevice%s\n",filename)

rc=ioctl(fd,USBDEVFS_RESET,0)

if(rc<0){

perror("Errorinioctl")

return1

printf("Resetsuccessful\n")

close(fd)

return0
}
Myrtlsdrreceiver+w/gnuradioimplementationofthe11GHz
VSRTsolarinterferometer
AsfarasIunderstandit,theVSRTdesignisasubsetofintensity
interferometerthatusesthefrequencyerrorbetweenmultiple11
GHzsatelliteTV"lownoisedownconverterblock"(LNBF)clocks
tocreateabeatfrequencyinthetotalpowerintegrated.Iam
basicallycopyingtheMITHaystackVerySmallRadioTelescope
(VSRT)butreplacingthediscretecomponentintegratorandUSB
videoinputdevicewithanrtlsdrdongle.Theideaistospendas

PageSections
Intro(here)
Implementation
Software
GRCFlowgraphs
Scripts
ComputerPointing
Reference
littleonhardwareas
possible.
WithmodernLNBF
theerrorbetween
samemodelpartsis
about30ppmwhich
resultsinbeat
frequenciesof~100
KHzatthe10GHz
ofthemixers.With
thiskindoffrontend
therearenonullsbut
thefringe
modulationcanstill
bereadoutas
variationsincountof
histogrambinsthat
containthebeat
frequency(inthe
totalpowerfft).This
intensity
measurementproxy
tracesoutthethe
envelopeofthe
fringesandvariesas
asincfunctionof
distancebetween
antenna.Knowing
thisandthedistance
cangiveyouhigh
angulardiameterand
position
measurementsof
verybrightradio
sources.

$752x18"satellitedishesw/mountsshipped
$102xKuLNFB(PLL321S2,~30ppmerror,RDA3560w/27Mhzxtal.)
http://superkuh.com/rtlsdr.html

19/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

$10rtlsdrreceiver(r820tore4k,~30ppmerror)
$10powercombiner(cheaperonesworktoo)
$5coaxialpowerinjector(LPI2200)
$20coaxialpowersupply(LPI188PS)+diodes
$20100ftRG6quadshield+Fconnectors
$130TwoDishPositionMotors(HH90)
$60DVBSPCIcard(Skystar2,DiSEqC1.2)
$10DiSEqC1.2switch
$80PVC,metalstock,drillbits
Historicalandothercontext.

ForadetailedmathematicalexplanationofVSRTseeMITHaystack'sVSRTIntroduction.Thereisalsoa
threadontheSocietyforAmateurRadioAstronomerslistdiscussingtheVSRTdesign.Themoregeneral
conceptofintensityinterferometry,whereyoucorrelatetotalpowerinsteadoffrequency,wasoriginally
developedbyHanburyBrown&Twiss.RogerJennisonwasaroundtoo."TheEarlyYearsofRadio
Astronomy:ReflectionsFiftyYearsafterJanskysDiscovery"byWTSullivan(2005)isanexcellent
sourceaboutHanburyBrownandTwiss'ssideofit.Thechapter"TheInventionandEarlyDevlopmentof
TheIntensityInterferometer"(pdf)isfascinating.Alsosee"TheDevelopmentofMichelsonandIntensity
LongBaselineInterferometry"(pdf).Itcoversnotonlythetechnicalconceptsbutalsohistoricalcontext,
detailedhandsonimplementations,andotherpersonalanectdotes.AndcheckoutJennison'sbook"Radio
Astronomy"(1966))asheinventedtheprocessofphaseclosurewhichusesathirdantennasignal
combinedmathematicallytorecoversomeofthemissingphaseinformation.Arrangedinatriangleof
projectedbaselinesthephaseerrorscauseequalbutoppositephaseshiftsinajoiningbaselines,canceling
outinthe"closurephase".TheMITHaystackgroupsmanagedtoresolveindividualsunspotsgroups
movingacrossthesolardiskusingwiththetechniquewiththeVSRTs.

"An

interferometerisaninstrumentthatcombinestwosignals(normallyfromtwodetectors)inamanner
thatthesignalsinterferetoproducearesultantsignal.Theresultantsignalisusuallythevectorsumof
thetwosignals,butinsomecasesitistheproductorsomeothermix.Thetraditionalinterferometer,
usuallystudiedandanalyzedinphysicscourses,combinesthetwosignalsinawaythatbothamplitude
andphaseinformationareused.Byvaryingthepositionsofthetwodetectors,itispossibletosynthesize
aneffectiveaperturethatisequivalenttotheseparationofthedetectorsandtoreconstructthe
impingingwavefront,thusprovidingsignificantinformationabouttheextentandstructureofthesignal
source.Thetraditionalphasesensitiveinterferometerrequiresretentionofthesignalphaseateach
detectorthephasesensitiveinterferometrytechniquewillnotbediscussedindetailhere."
"Aspecialcaseoftheinterferometeristheintensityinterferometer,whichperformsanintensity
correlationofsignalsfromthetwodetectors.Althoughintheintensityinterferometerthephase
informationfromthetwoantennasisdiscarded,thecorrelationofthetwosignalsremainsuseful.
Aperturesynthesisisnotpractical,butsomeimportantsourcecharacteristicsmaybedetermined."

IthinktheVSRTisaspecialcaseofintensityinteferometeriswhereyoudon'ttrytoalignsamplesby
timeafterrecording.Insteadyoujustlookforthebaselinedistancesincpatternintotalpoweratthebeat
frequencyoftheunsynchronizedclocks.

Implementationsofar.
SofarI'veonlydoneitwithmanualpointingscrewedtoaboard.Theinterferometrycorrelationisdone
withasatellitetvmarketstriplinepowercombinerattheintermediatefrequency(IF,~9501950MHz)and
thenanrtlsdrdongleisusedtomeasurethetotalpowerofa2.4MHzbandwidthoftheintermediate
frequencyrange.Iuseagnuradiocompanionflowgraphtotakethetotalpowerandthendoafourier
transformofthetotalpower.Inthisfouriertransformthefringesshowupasamodulationofthecountin
theFFTbinswhichcorrespondtothedifferenceinfrequencybetweenthetwodownconverters.Inmycase
thisisabout~100KHz.
IntheHaystackVSRTmemosalinedropamplifier,ortwo,aresometimesputbehindtherespective
LNBFIFcoaxoutputsorthepowercombiner.Withthertlsdrdongleandrelativeshort(<10m)baselines
ofRG6thisisn'trequired.
TheGUIallowsforsettingtheexact2.4MHzbandwidthoftheIFrangetosampleandthetotalpower
FFTbinbandpasstowhereandwhattheLNBFbeatfrequencyis.Thefilenameisautogeneratedtothe
format,
http://superkuh.com/rtlsdr.html

20/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

prefix+datetime.now().strftime("%Y.%m.%d.%H.%M.%S")+".log"
Thetimeembeddedinthefilenameislaterusedbyaperlscript,vsrt_log_timeplot.pl,whichconvertsand
metadatatagsthebinaryrecordstognuplotuseabletextcsvformatformakingPNGplots.

Download
totalpowermodes(tpmodes.grc)
vsrt_log_timeplot.pl

Whoelsehelped
Iconsulted
with

patchvonbraunalotforthesoftware/gnuradioside.HegavemeanexampleofhowtousetheWXGUI
StripchartandIwouldnothaveguessedIneededtosquarethevaluesfromthebeatfrequencybinsafter
thefirstsquaringfortakingtotalpower.HemadeagenericsimulatorfordualfreerunningclocksLNBF
intensityinterferometers.Youdon'tevenneedtohaveanrtlsdrdevicetorunitonlyanuptodateinstall
ofgnuradio.Itisaneasywaytounderstandhowtodointerferometrywithoutadistributedclocksignal.
patchvonbraun's:simulatedintensityinterferometer.grc

Physical
Withthissetupona1meterbaselineandaintermediatetuningfrequencyof1.6GHzIF(10700MHz+
(1600MHz950MHz)=11350MHz)themainbeamwidthwouldbeabout70*(c/11GHz)/1m),or1.9
degrees.Thisdoesnotresolvethesolardisk(~0.5deg)duringdriftscans.Ihavebeentoldthatthe
magnitudegoesdowninaSINCpatternasyouwidenthebaselineandapproachresolvingthesourcebutI
willnotresolvethesuninitially.IntheVSRTMemos"DevelopmentofasolarimagingarrayofVery
SmallRadioTelescopes"acomputationallycomplexwaytoresolveindividualactionregionsisdonewith
a3rddishproviding"phaseclosure"inthearrayonaslantednorthsouthbaselineinadditiontothe
existingeastwestbaseline.ItrytopointmydishessothattheEarthispassingthesunthroughthebeamat
~12:09pm(noon)eachday.Toaidinpointingacrossofreflectivealuminumtapeisappliedcenterofthe
dish.ThiscreatesacrossoflightontheLNBFfeedwhenitisinthedishfocalplaneandthedishis
pointedatthesun.Thepicturebelowisfromlaterintheday,theoneoftheleftshowsthesundriftingout
ofthebeamasitsets.ImademyLNBFholdersoutofsmallpiecesofwoodcompressionfitinthedish
arm.TherearegroovesfortheRG6coaxtofitgroundoutwitharotarytool.ThePVCcollarshaveslots
cutinthebackwithscrewsgoingintothewoodtosettheangle.

http://superkuh.com/rtlsdr.html

21/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

Thescreenshotshowsashortrunnearsunsetonanotherwisecloudyday.Thediscontinuitiesareme
runningoutsideandmanuallyrepointingthedishes.Butitdoeshighlighthowthebeatfrequencyofthe2
LNBFvariesastheywarmupwhenturnedon.Itstartsdownat~90KHzbutwithin10minutesitrisesto
~115KHz.Afteritreachesequilibriumthevariationis~+1KHz.Icouldchangetheexisting80120
KHzbandpasstoa110120KHzbandpassandhavebettersensitivity.Butthatbandwidthissomething
thathastobefoundempiricallywitheachLNBFpairandsetmanuallywithintheGUIfornow.
patchvonbraunsaiditwasfeasibletoidentifythefrequencybinswiththemostcountsandthattherewas
anexamplewithinthesimpla_racode,
"Youcouldevenhavealittlehelperfunction,basedonavectorprobe,thatfindsyourbinrange,and
tunesthefilterappropriately."
Thebelowcloseupofindoortestingshowinghoweverythingisconnectedonthertlsdrsideshowingthe
powerinjector,e4kbasedrtlsdr(wrappedinaluminumtape),andthestriplinebasedsatellitepower
combinerforcorrelation.Thetworg6quadshieldcoaxiallinesgoingfromthepowercombinertotheku
bandLNBFareasclosetothesamelengthasIcouldtrimthem.Iusea1amp18vpowersupplyand
coaxialpowerinjectortosupplypowertotheLNBandanyamplifiers.Thisvoltagecontrolslinear
polarization(horiztonal/vertical)anditcanbechangedbyputtingafew1amp1N4007inserieswiththe
powerlinetodropthevoltage.

http://superkuh.com/rtlsdr.html

22/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

Accessoryscripts.
tpmodes.grcproducesbinarylogsthatareprettysimple.ThecountoftheLNBFbeatfrequencybinsin
thebandpassaresavedasfloatsrepresentedas4pairsofhexadecimal.Whentheintegrationtimeissetto
thedefault1secondthenone4bytedatapointiswrittentothelogevery0.5seconds.Ihighlyrecommend
notchangingthisfornow.Thereisnometadataorpadding.Here'sascreenshotofarunusingtheutility
"bless",

Inordertoconvertthebinarylogsof4byterecordsintosomethinggnuplotcanparseIuseasimpleperl
script,
#!/usr/bin/perl
usewarnings
usestrict
my$data='/home/superkuh/vsrt_2013.06.13.12.26.47.log'
my$bytelength=4
my$format="f"#floats(littleendian)
my$num_records
if($ARGV[0]){

$data=$ARGV[0]
}else{

print"youneedtopassthelogfilepathasanargument."

exit
}

http://superkuh.com/rtlsdr.html

23/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

open(LOG,"$data")ordie"Can'topenlog.\n$!"
binmode(LOG)
my$i=0
until(eof(LOG)){

my$record

my$decimal

read(LOG,$record,$bytelength)==$bytelength

ordie"shortread\n"

$decimal=unpack($format,$record)

printf("$i,\t$decimal\n",$decimal)

$i++
}
NowIhavethefilenamewhichgivesthetimethegnuradiocompaniongrcfilestartedrunning.Thisisnot
thetimeIhittherecordbuttonandstartedlogging.Theoffsetisasecondortwo.Ignoringthat,itis
possibletousethestarttimeencodedinthelogfilenametofigureoutwhenaparticularmeasurementwas
taken.TodothatIhavetoknowtheintervalbetweenentriessavedtothebinarylog.

$date&&lsl/home/superkuh/vsrt_2013.06.14.12.03.00.log&&sleep60&&date&&lsl/home/
FriJun1413:05:24CDT2013
rwrr1superkuhsuperkuh296442013061413:05/home/superkuh/vsrt_2013.06.14.12.03.00.l
FriJun1413:06:24CDT2013
rwrr1superkuhsuperkuh301242013061413:06/home/superkuh/vsrt_2013.06.14.12.03.00.l
((3012429644)/4)/60=2

$date&&lsl/home/superkuh/vsrt_null.log&&sleep60&&date&&lsl/home/superkuh/vsrt_n
rwrr1superkuhsuperkuh82013061413:44/home/superkuh/vsrt_null.log
FriJun1413:45:36CDT2013
rwrr1superkuhsuperkuh4882013061413:45/home/superkuh/vsrt_null.log
((4888)/4)/60=2
Toknowwhattimealogrecordcorrespondsto,takethetimefromthefilenameandthenadd0.5seconds
*theindexofthe4byteentryinthebinarylog.Thisshouldbepossibletowriteintotheuntilloopsoit
outputstimeinsteadofjustindex$i.Thebelowexampleisahackyversionofmylogparserthatdoesjust
this.Here'sanexampleoutput.
#!/usr/bin/perl
useDateTime
usewarnings
usestrict

#UTCEpoch
#BeatFreqBins
1371229380.0, 1.38292284646013e06
1371229380.5, 1.37606230055098e06
1371229381.0, 1.374015937472e06
1371229381.5, 1.366425294691e06
#Thesimplestpossiblegnuplotplotusingthisprogram'soutput.
1371229382.0, 1.35845414206415e06
#./vsrt_log_timeplot.pl/home/superkuh/vsrt_2013.06.14.12.03.00.log>whee2.log
1371229382.5, 1.36476899115223e06
#gnuplot>plot"./whee2.log"using1:2title"VSRTTest"withlines
1371229383.0, 1.36480070977996e06
1371229383.5, 1.36444589315943e06
my$data='/home/superkuh/vsrt_2013.06.13.12.26.47.log'
1371229384.0, 1.35775212584122e06
my$bytelength=4
1371229384.5, 1.36395499339415e06
#my$format="V"#oops,notthisunsigned32bit(littleendian)
1371229385.0, 1.35322613914468e06
my$format="f"#float
1371229385.5, 1.36412847950851e06
my$num_records
1371229386.0, 1.36531491534697e06
1371229386.5, 1.3664910056832e06
if($ARGV[0]){
1371229387.0, 1.36144888074341e06

$data=$ARGV[0]
1371229387.5, 1.35596496875223e06
}else{
1371229388.0, 1.35830066483322e06

print"youneedtopassthelogfilepathasanargument."
1371229388.5, 1.3654090480486e06

exit
1371229389.0, 1.358990175504e06
}
1371229389.5, 1.37098015784431e06
1371229390.0, 1.387945303577e06
my$dt#declaredatetimevariableglobally
1371229390.5, 1.38286770834384e06
extracttime($data)#$dtnowhasdateobject.
1371229391.0, 1.36734763600543e06
1371229391.5, 1.36036248932214e06
open(LOG,"$data")ordie"Can'topenlog.\n$!"
...
binmode(LOG)
my$i=0
until(eof(LOG)){

my$record

my$decimal

read(LOG,$record,$bytelength)==$bytelength

ordie"shortread\n"

http://superkuh.com/rtlsdr.html

$decimal=unpack($format,$record)

#Thisisastupid/fragilewaytodealwithdatetime
#nothavingenoughprecision.Itonlyworksifthe
#recordtorecordintervalisalways0.5seconds.
my$recordtime=$dt>epoch()
if(0==$i%2){

printf("$recordtime.0,\t$decimal\n",$decimal)
}else{

printf("$recordtime.5,\t$decimal\n",$decimal)
}

$dt>add(nanoseconds=>500000000)
24/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

$i++

subextracttime{

my$timestring=shift

#/home/superkuh/vsrt_2013.06.13.12.26.47.log

$timestring=~/(\d{4}\.\d{2}\.\d{2})\.(\d\d\.\d\d\.\d\d)/

my$year_month_day=$1

my$time=$2

my($year,$month,$day)=split(/\./,$year_month_day)
$time=~s/\./:/g
my($hour,$minute,$second)=split(/:/,$time)

$dt=DateTime>new(

year=>$year,

month=>$month,

day=>$day,

hour=>$hour,

minute=>$minute,

second=>$second,

time_zone=>'America/Chicago',
)

$dt>set_time_zone('UTC')
return1

NowIjusthavetomakeupagoodgnuplotformatandintegratethecallsintotheperlscript.

Computercontrolledpointing,mechanicalandsoftware
differences

Manuallyrepositioningthedishesswampsoutthesignalofinterestasthetargetleavesthebeamwidth.For
anydecentmeasurementsIneedcomputercontrolledpointing.ThismeanstheHaystackideaoftwo
coupledDiseqc1.2compatiblemotorpositionersmountedoneontheother.Intheirdesignbothdishesare
mountedonasinglePVCtubehookedtooneofthepositionerswithametalextension.Mysatellitedish
mountscan'trotateliketheirssoI'llhavetomodifythisdesignabit.Theyuseaserialrelayto"push"the
buttonsonaphysicalDiseqc1.2motorcontrollerremote.Thatseemedabitconvolutedtome.Iboughta
SkyStar2DVBSpcicardandunderlinuxsendrawDiseqccommandsoutbycallingxdipowhich
accessesthelinuxDVBinterface.IthasbothaGUIandcliinterface.Unfortunatelyxdipocannotsend
throughDiseqcswitches.Ihadtoaddmanualmotorcommandstotunes2whichdidsupportswitchesbut
notmanualmotorcommands.Thisversionwhichsupportsmanualsteppingmodeisavailableat
https://github.com/superkuh/tunes2stepping.
AnotheralternativeDiseqcmotorcontrollerIdidn'tpersuewouldbeusinga192KHzUSBsoundcardand
theDiSEqCAudioGeneratorsoftwarefromJurasProjects.Thedocumentationforthehardwaresideof
theaudiogeneratoris404now,butJurasrespondedtoanemailofminewiththeschematicsattached.
SincethebentmotorshaftsthatcamewillmymotorslookedreallydifficulttodrillthroughIthoughtI'd
usestraighthexholedshaftstomakeeverythingmechanicallysimpler.Ifound
http://www.reidsupply.com/sku/HHS18/andorderedacouple.Unfortunatelymymeasurementsofthe
dishmotorshaftflattoflatesizewereoff.TheReidhexholedshaftholeisjustatinybittoolarge.This
waseasilyfixedbywrappingacoupleturnsofmaskingtapearoundtheshafttoincreasethediameter.
http://superkuh.com/rtlsdr.html

25/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

Thisisoftenhowfishingrodhandlesaremade.Ialso
encounteredthisconstructiontechniqueonJarrod
Kinsey'sCO2laserpages.
Thehardestpartofallthisisdrillingan8mmhole
preciselynormaltothecurvedoutsidesurfaceofthehex
holeshaft.Thefirststepistoflattentheareawithahand
file.Thistookmeabout10minutes.Ihadpreviously
orderedandreceivedtwocarbidedrillbits,onesmallto
subdrilltheintialholeandthenone8mmforthefinal
hole.Adrillpressandsmallvicearequiredtoactually
drilltheholes.Andeventhenit'sreallytricky.Myfirst
twoattemptsresultedinholesnotquitenormaltothe
surfaceofthehexflat.Icouldonlyuserollortaperpins
tosecuretheshaft.LuckilyIbought2xshaftsjustincase.
Ialsohadtodrill4additional8mmholesinthe2x
satellitedishmotormountstomakeholesforlevel
mountinginsteadofatatilt.TheVRSTguysgotlucky
withtheirsatmotormountshavingalongslot.
ThediameterofeasilyavailablePVCisslightlytosmall
forthedishmountingclamp.Thisisremediedlikethe
motorshaftsbywrappingwidemaskingtapetosizeand
optionallyepoxycoating/sandingit.

ThedishmotorsusedintheVSRTprojectwereStabHH90.Thesehavecomedownincostsincethe
VSRTmemoswerewrittenandarestillwidelyavailable.
065
StabHH90dishpointingmotor#1
065 StabHH90dishpointingmotor#2
$130total
InordertocontrolthesemotorsasystemtosendDISEqC1.2commandsisneeded.Thefirstoptionwould
betofaithfullyreplicatetheVSRTimplementation.Theydoitinaratherroundaboutwaybutatleastitis
testedandknowntoworkwiththeirsoftware.Unfortunatelythespecifichardwareusedhasbecomerare,
ismostlyshippedfromoverseas,orisexpensive.
045
045
080
000

STABMP01PositionerControl#1
STABMP01PositionerControl#2
WTSSRMSerialportSolidStateRelay
VSRTJavasoftware(windows)

030
020
020

Two5"x9"x0.125"thicksteelplates
Two15"x1"x0.125"thickaluminumcounterweightarms
Shippingforthemetalparts.

MychosenmethodofHH90motorcontrolisasingleDVBScardunderlinuxwithDVBAPI5.xw/my
modifiedtunes2andoptionallyxdipo.ThiscanbecombinedwithaDiSEqCswitchtoscaletocontrolof
multiplemotorsrelativelycheaply.Idosunaltazpositioncalculationbyusingasmallpysolarpython
script.Ihavenotyetcompletedthescriptstoturnaltazpositionsofthesunatmylocationintomotorstep
commands.HopefullyIcanusesomeoftheUSALfuctionsintunes2forthat.
066
010
000

Skystar2HDpcicard
DiSEqCswitch
tunes2andxdipoDVBcontrolsoftware(linux)

020
010
020

.753"HexHoledSleeve
5"widemaskingtape
Two15"x1"x0.125"aluminumcounterweightarms

BothrequirePVCpipe,toolslikedrills,8mmdrillbitsandsmallersubdrillbit,handsaws,files,and
potentiallyawelder(thoughliberalJBWeldwouldprobablywork).

Diseqcswitchesproblemsandsolutions.
ItturnsoutthatxdipoalonecannotdealwithmotorsbehindDiseqcswitches.Thismeansitcanonly
controloneDiseqcmotoratonce.Controllingtwowouldrequire2xSkystar2pcicards.Luckilythereare
http://superkuh.com/rtlsdr.html

26/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

otheroptions.CrazyCat'stunes2supportsDiseqcswitchesandaddressing.Itnormallyonlyprovidesfor
motorcommandsusingtheUSALsystemwhichisn'ttoohelpful.ButIwasabletomodifythecodeto
supportmanualmotorpositioncommandswhileretainingtheswitchsupport.xdipocouldstillbeusedin
theorybycallingtunes2tosettheDiseqcswitchtotheappropriateport/motorandthencallingxdipoas
normal.Butitiseasiertojustusethemodifiedtunes2foreverything.
Thisguttedversionoftunes2formanualmotorcommandsisavailableat:
https://github.com/superkuh/tunes2stepping
ThefunctionsIaddedarebasicallyjustlookuparrayswithDiseqcbuscommandsfordifferentstepsinthe
clockwiseorcounterclockwisedirections.InDiseqcthepacketshave4sections.CheckouttheDiseqc
BusFunctionalSpecification(pdf)forabetterexplanationwithmoredetail.

Thefirst,"Framing"byterepresentifthecommandisfromthereceiverordiseqcdeviceandwetherit
needsareply.Formytablethesearealljust"EO"whichmeansit'sapacketfromthereceiverwithno
responserequired.MostcommandsareEObutitgoesuptoE7.
Thesecond,"Address"specifieswhichtypesofDiseqcdevicesshouldlisten(ex:LNB,switch,motor,
polarizer).Formotorsthisis"32"
Thethirdis"Command".Thisisahugelistofvaluesofwhichonly"68"and"69"arerelevant.Theyare
"DriveMotorEast"and"DriveMotorWest"respectively.The"Command"byteisonlyrelevanttotheir
specificdevicesspecifiedviathe"Address"byte.
Theremainingbytesofthepacketare"Data"andhowthey'reinterpreteddependsonthe"Command"
bytesspecifyingaspecifictypeofcommand.Formotormovementtherearethreeoptions."00"makesthe
motorturnuntilaDiseqcstopcommandissent.Thesecondmodeispositivevaluesforthebytes,"01"to
"7F".Theyrepresentanamountoftimetoturnthemotor.Orbyspecifyingnegativebytevalues"80"to
"FF"themotorisrotatedanumberofsteps.ThislastisbestanddetailedinthePositionerApplication
Note(pdf)withanexcerptbelow,
Thenumberofstepstomakeisgivenbytheadditionalcountneededtomaketheparameterbytereach
zero(oroverflowtozeroifthebyteisconsideredasunsigned).Thusthebyte'FF'(hexadecimal)
requestsonlyonestep,'FE'twosteps,andforexample'F9'requests7steps.
Withmymotorseachstepcorrespondstoabout0.1deg.UsingthisinformationImadeupatableof
Diseqcpacketsforeachrotationdirection.
structdvb_diseqc_master_cmdstep_east[]=
{

{{0xe0,0x31,0x68,0xFF,0x00,0x00},4},//DriveMotorWest1step

{{0xe0,0x31,0x68,0xFE,0x00,0x00},4},//DriveMotorWest2step

{{0xe0,0x31,0x68,0xFD,0x00,0x00},4},//DriveMotorWest3step

{{0xe0,0x31,0x68,0xFC,0x00,0x00},4},//DriveMotorWest4step

{{0xe0,0x31,0x68,0xFB,0x00,0x00},4},//DriveMotorWest5step

{{0xe0,0x31,0x68,0xF6,0x00,0x00},4},//DriveMotorWest10step

{{0xe0,0x31,0x68,0xEC,0x00,0x00},4},//DriveMotorWest20step

{{0xe0,0x31,0x68,0xE2,0x00,0x00},4},//DriveMotorWest30step

{{0xe0,0x31,0x68,0xD8,0x00,0x00},4},//DriveMotorWest40step

{{0xe0,0x31,0x68,0xCE,0x00,0x00},4},//DriveMotorWest50step

{{0xe0,0x31,0x68,0x9C,0x00,0x00},4}//DriveMotorWest100step
}
structdvb_diseqc_master_cmdstep_west[]=
{

{{0xe0,0x31,0x69,0xFF,0x00,0x00},4},//DriveMotorWest1step

{{0xe0,0x31,0x69,0xFE,0x00,0x00},4},//DriveMotorWest2step

{{0xe0,0x31,0x69,0xFD,0x00,0x00},4},//DriveMotorWest3step

{{0xe0,0x31,0x69,0xFC,0x00,0x00},4},//DriveMotorWest4step

{{0xe0,0x31,0x69,0xFB,0x00,0x00},4},//DriveMotorWest5step

{{0xe0,0x31,0x69,0xF6,0x00,0x00},4},//DriveMotorWest10step

{{0xe0,0x31,0x69,0xEC,0x00,0x00},4},//DriveMotorWest20step

{{0xe0,0x31,0x69,0xE2,0x00,0x00},4},//DriveMotorWest30step

{{0xe0,0x31,0x69,0xD8,0x00,0x00},4},//DriveMotorWest40step

{{0xe0,0x31,0x69,0xCE,0x00,0x00},4},//DriveMotorWest50step

{{0xe0,0x31,0x69,0x9C,0x00,0x00},4}//DriveMotorWest100step
}
ForaddressingspecificportsoftheDiseqcswitchtunes2'snormalfunctionsareused.Theyarecalled
beforethemotorpositioncommandsaresent.Usageofthemodifiedtunes2isprettysimple.Theonly
differencesaretwonewcliswitchesandnotneedingtogiveittuningparameters.
stepeast
stepwest
Theyeachtakeanyvaluefrom0to10like,
./tunes2stepwest0committed1
Thiswouldcausethesatellitedishmotoronport1oftheDiseqcswitchtostep1positioncounter
clockwise.Tosendthesamecommandofstepping1positioncounterclockwisetotheothermotor,
./tunes2stepwest0committed2
http://superkuh.com/rtlsdr.html

27/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

Thesteppingargumentvalues0through10aremappedonafairlyarbitrarysetofactualsteps.Thisresults
fromjustdoingarrayindexlookupsintheabovepackettables,
0>1
1>2
2>3
3>4
4>5
5>10
6>20
7>30
8>40
9>50
10>100
http://www.satnigmo.com/2254/howtoconfigureempcentauridiseqcswitches/
Calculatingsolarpositionandusingthattodecidehowmanystepstostepperaxis
Figuringoutwherethesunisintheskyintermsofanaltazformatismadesimplebypysolar.Figuring
outhowtoturnthatpositionintosequencesofstepsonthemotorsismuch,muchharder.
#!/usr/bin/envpython
importPysolar
importdatetime
d=datetime.datetime.utcnow()
lat=40.0
long=90.0
sol_alt=Pysolar.GetAltitude(lat,long,d)
sol_long=Pysolar.GetAzimuth(lat,long,d)
printsol_alt
printsol_long
Thesevaluesarerelativetothepysolarreferenceframewhichisgivenbytheirdiagram,

$./solpos.py
41.4925424732
35.8472087363

Mysetupispointeddirectlysouth.SoforthisexampletimethatmeansIneedto
calculatethenumberofstepsrequiredtoturnthe(top)altitudemotor41.5up
fromlevelandthe(bottom)azimuthmotor35.8degreestotheleft(east).

DecodingPagerDatawithmultimonand/orgnuradioreceivers

Thehardestpartofthisisfiguringoutwhatkindofpagersystemyouhave.Ispentalongtimetryingto
http://superkuh.com/rtlsdr.html

28/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

decodethelocalFLEXpagersystemwithdecodersthatdidnotsupportit.
WrittenbyThomasSailer,HB9JNX/AE4WA,multimon(multimon.tar.bz2)supportsdecodingalarge
numberofpagermodulations.FLEXisnotoneofthem.ScrolldownforFLEX.
OnJune29th2012dekartoldmeabouthisupdatedforkofmultimon,multimonNG,withbettererror
correctionandmoremodulationssupported.Asofrightthisinstantthoseon64bitlinuxshouldjustusethe
existingmakefileand*not*qmakeorqtcreatortocompileit.Forthewindowsusers(oranyonewanting
moreinfo)there'saprecompiledversionandblogpost.Makesuretodisableallthedemodulatorsyou
don'tneed.IthinkespeciallyZVEIisquitespammy.Thisandthisiswhatpocsagsoundslikeifyou're
wondering.
WhenIoriginallystartedplayingandwrotethistherewereonlyacoupleoptionsforrtlsdrreceiverstouse
withthemultimondecoder.Iusedpatchvonbraun'smultimodetosave.wavsanddekar'spagerexample
GRCImodifiedforOsmoSDRsourceslinkedbelowforraw,realtimedecoding.Lately(asoflate
2012/13)alargenumberofreceivershavebeenreleasedthatdon'tdependonGNURadio.rtl_fmisone
andthere'sanexampleusagebelow.
realtimedecodingrtl_fm

rtl_fmf930.353e6g100s22050l310|multimontrawaPOCSAG512aPOCSAG1200aPOC
realtimedecodingw/dekar'spager_fifo
Dekar'smultimonNG,aforkwithimprovederrorcorrection,moresupportedmodes,and
*nix/osx/windowssupport.Inthescreenshotsbelowthesignalisnotpocsag.Ithoughtitmightbezwei
butnowI'mnotsosureit'sevenpagerdata.TestsamplesofpocsagthatDekarlinksonhisblogdecode
justfine.

pager_fifo_web.grc
mkfifo/tmp/pager_fifo.raw
./multimonNGtraw/tmp/pager_fifo.raw
gnuradiocompanionpager_fifo_web.grc
Inordertodecodethepagerdatainrealtimeyoushoulduseafirstinfirstoutfile(fifo).Dekar's
pager_fifoisdesignedtodothatbutyou'llneedtosetthecorrectfilepathsfortheFileSinkyourself.In
thecopydownloadableheretheFileSink'spathissetto"/tmp/pager_fifo.raw".Youshouldbeabletorun
itwithouteditingonceyou'vemadethatfifo.Makesuretostartmultimonreadingthefifobeforeyou
beginGRCandexecutethereceiver.

http://superkuh.com/rtlsdr.html

29/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

Inmypersonalcopyofdekar'spager_fifothefileandaudiosinksareenabledwhilethewaterfall,wav,
andothersinksaredisabled.Toenablethedisabled(grey)blockselectthemandpress'e'('dtodisable).
Theaudiosinkissettopulseaudio("pulse").

FLEXPagers
UnfortunatelyitturnedoutmylocalpagerswereallusingFLEX,andsonotsupportedbyanyofthe
abovesoftware.Buttheproceduresmightstillbeusefulforsomeone.DecodingFLEXcanbedonewith
thesoftwarePDW,butitiswindowsonly.InGNURadiothereisadditionallygrpager,whichissupposed
tosupportflex,butmanyimplementationscriptsforitareGNURadio3.6.5orolderandgettingstuffto
workwith3.7requiresnamespacechanges.mothran'sflex_hackrfisoneofthese.Sincethertlsdrreceivers
canbutshouldn'tdo3.125MS/s,likeflex_hackrfofuhd_flux,whattheyusenativelyforthebandwidth,
andsodecimation,andprettymucheverythingelsehavetoberewrittentoo.I'veattemptedtostartthis
andyoucanseeacopyhere.
AcoupledaysafterIwrotetheaboveparagraphzaryacameon##rtlsdronfreenodeandmentionedhis
rtlsdrsupprtingFLEXdecoderwrittenmonthsbefore.Itiseasytouseandworksgreat!Thisscriptrunsat
a250KS/ssamplerateanddecodes12.5KHzchannelonly.Internallyitusesgnuradio'soptfirtogenerate
lowpasstapsthatwidetousewitihafrequencyxlatingFIRfilter.Itthenpassesthattogrpager's
flex_demod.
later:argilo(ClaytonSmith)hasalsoputtogetheranosmosdrsourcebasedgr.pagerflexdecoderforhis
GNURadiotutorialseries.
Thebelowoutputisheavilycensoredandeditedtoavoiddisclosingorreproducingsensitiveinformation
butitgivesyouanideaofthetypeofmessages.
gitclonehttps://github.com/zarya/sdr
cdsdr/receivers/flex/
./rtl_flex_noX.pyf929.56Mrxgain=37.2
linuxGNUC++version4.6.3Boost_104800UHD_003.005.004149gc357a16e
Nodatabasesupport
grosmosdrv0.1.033g8facbbcc(0.1.1git)gnuradio3.7.2git123g0ded5889
builtinsourcetypes:filefcdrtlrtl_tcpuhdhackrfnetsdr
Usingdevice#0GenericRTL2832USN:77771111153705700
FoundRafaelMicroR820Ttuner
Exactsamplerateis:250000.000414Hz

Settinggainto20.700000(from[0.000000,49.600000])
UsingVolkmachine:avx_64_mmx_orc
0929.560|55|SPN|2900
0929.560|5555555|ALN|osoftJDBCtype4driverforMSSQLServer2005:FreePoolSize=24[03
0929.560|555|ALN|MSN020helloMessagefromNOCPCB.129
http://superkuh.com/rtlsdr.html

30/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

0929.560|5555555|ALN|Task:3322391Net:0Pressman:REDACTED,REDACTEDClickheretoview
0929.560|555555555|ALN|4.Q!T.(RS(7+*#~A!lu+3L:REDACTED:YSGO>TJL*qN>][WOA"$(0?"$8QB,33*d
0929.560|5555555|ALN|From:REDACTED@REDACTED.comSubject:REDACTEDscheduledreport:"05:00
0929.560|5555555|ALN|re|7291W190thSt|FDo/scallinga2ndalarmforastructurefire,
0929.560|5555555|ALN|Fr/m:7th.Floor.REDACTEDREDACTED:+BloodCulturesG+coccifromyes
0929.560|5555555|SPN|766087U4105[[[
0929.560|5555555|ALN|REDACTED,REDACTED91052FYI:Notifiedbylabstoolsamplecameback
Itriedforoverayearbeforesuccessfullydecodinglocalpagersignals.NowthatIhaveIthinkitisabad
idea.Thereisfarmuchtoomuchprivateinformationincleartext.Idon'tplantotryagain.
(old)gqrxinstallnotes

Readthisperson'sguideinstead.
WhenIwrotethisuptheoriginalversionbycsetedidn'tsupportthehardwareyetbutmathis_,phirsch,
Hoernchen,andperhapsothersI'vemissedfrom##rtlsdronfreenodehadaddedlibrtlsdrsupporttogqrx
theirreposarestilllistedbycommentedout.Thesedayscsetehasaddedinrtlsdrsupportsoyoucanuse
hisoriginalrepository.
[anerroroccurredwhileprocessingthedirective]
gitclonehttps://github.com/csete/gqrx.git
cdgqrx
#onUbuntu,sudoaptgetinstallqtcreator,ifyoudon'thaveit.
qtcreatorgqrx.pro
#pressthebuildbutton(thehammer)
#Avoidqtcreatordoingitmanually.
qmake
make
./gqrx
UsewithUbuntu10.04anddistroswitholdQt<4.7
Youwillalmostcertainlynotgetthiserror.But,someonemight,soI'mleavingitheretobeindexed.
Ifyou'relikemeandrunanolderdistributionthenyourQtlibrarieswillbeoutofdateandlackafunction
requiredforgeneratingthenameofthefilestobesavedwhenrecording.

/home/superkuh/app_installs/gnuradio/gqrx/gqrx/qtgui/dockaudio.cpp:100:error:currentDateTime
InitiallyIthoughtitwasaqtcreatorthingsoItriedtogetmoreinformationbydoingitmanually,
qmake
make
g++cpipeO2I/usr/local/include/gnuradioI/usr/local/includeI/usr/local/include
I/usr/local/include/gnuradioD_REENTRANTD_REENTRANTI/usr/include/libusb1.0WallW
D_REENTRANTDQT_NO_DEBUGDQT_NO_DEBUG_OUTPUTDVERSION="\"0.0\""
DQT_NO_DEBUGDQT_GUI_LIBDQT_CORE_LIBDQT_SHAREDI/usr/share/qt4/mkspecs/linux
g++I.I/usr/include/qt4/QtCoreI/usr/include/qt4/QtGuiI/usr/include/qt4I.I.odockaudio.o
qtgui/dockaudio.cpp
qtgui/dockaudio.cpp:InmemberfunctionvoidDockAudio::on_audioRecButton_clicked(bool):
qtgui/dockaudio.cpp:100:error:currentDateTimeUtcisnotamemberofQDateTime
make:***[dockaudio.o]Error1
Togetittocompileonthesesystemsyou'llhavetodothebelow.(edit:Thislittlechangeisnowadded
intophirsch's.)
http://superkuh.com/rtlsdr.html

31/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

Ubuntu10.04hasoldQtlibsandgqrxusesafunctioncallnotinthem.So,whileIwaswaitingforQt4.74
tocompileIdecidedtotryahack.Iremovedthatfunctioncallwithastaticstringoftext.[edit]Ilater
foundcomparablefunctionsforQt4.6andolder.
Ifyouareusingqtcreatorlikethedocssuggestyoucandoubleclickontheerrorandgototheline.Ifnot,
itwasin./Sources/qtgui/dockaudio.cppreplace,
voidDockAudio::on_audioRecButton_clicked(boolchecked)
{
if(checked){
//FIXME:optiontouselocaltime
lastAudio=QDateTime::currentDateTimeUtc().toString("gqrxyyyyMMddhhmmss.'wav'")
Withsomethinglikethis.

voidDockAudio::on_audioRecButton_clicked(boolchecked)
{
if(checked){
//FIXME:optiontouselocaltime
//usefunctionscompatiblewitholderversionsofQt.
lastAudio=QDateTime::currentDateTime().toUTC().toString("gqrxyyyyMMddhhmmss.'wav'")
Andit'llcompileandruncorrectlyonmyspecificmachine.
CompilingLTECellScannerandLTETrackeronUbuntu10.04
Beforestartingmakesuretohaveafortrancompiler,FFTW,BLAS,andLAPACKlibrariesinstalledfrom
therepositories.

sudoaptgetinstallautomakeautoconflibtoollibfftw33libfftw3devgfortranlibblas3gflibb
Ifyou'reusing12.04justfollowtheinstructionsonthegithubpageandeverythingistrivial.For10.04
(lucid)usersthetheinitialhurdleiscmake.LTECellScannerrequirescmake2.8.8andUbuntu10.04only
has2.8thefindingofBLASandLAPACKlibrarieswillfaillike,
CMakeErroratCMakeLists.txt:1(CMAKE_MINIMUM_REQUIRED):
CMake2.8.4orhigherisrequired.Youarerunningversion2.8.0.
UntilyouopenCMakeList.txtandchangetheversionnumberonfirstlineto2.8.0.Afterfixingthatthe
BLASandLAPACKissuescomein,
cmake..
FoundITPP:/usr/lib64/libitpp.so
CMakeErrorat/usr/share/cmake2.8/Modules/FindBLAS.cmake:45(message):
FindBLASisFortranonlysoFortranmustbeenabled.
CallStack(mostrecentcallfirst):
CMakeLists.txt:29(FIND_PACKAGE)
YoucanseemyinstallationnotesbeforeIfigureditout.TofixitIsearchedforpeoplecomplainingof
similarproblemsonotherprojectsandthenreplacedmy*system*fileswiththeirs,FindBLAS.cmake.

sudocp/usr/share/cmake2.8/Modules/FindBLAS.cmake/usr/share/cmake2.8/Modules/FindBLAS.cmake
sudocpFindBLAS.cmake/usr/share/cmake2.8/Modules/
LAPACKwillalsofailthisway.Iusedthisarbitraycmakefile,
http://code.google.com/p/qmcpack/source/browse/trunk/CMake/FindLapack.cmake?r=5383.Andthisisa
localbackupincasethatdisappears.

sudocp/usr/share/cmake2.8/Modules/FindLAPACK.cmake/usr/share/cmake2.8/Modules/FindLAPACK.c
sudoFindLAPACK.cmake/usr/share/cmake2.8/Modules/FindLAPACK.cmake
AfterfixingthecmakeissuescompileandinstallthelatestIT++(ITPP4.2).Makesuretocompletely
removetheoldITPP4.0.7librariesfromtheUbunturepository.WhenLTECellscannercompilesyoucan
gobackandrestorethe.bakcmakefiles.Therateofscanisabout0.1Mhzper10seconds.
./CellSearchvs751e6e751e6
LTECellSearchv0.1.0(release)beginning
Searchfrequency:751MHz
PPM:100
correction:1
FoundElonicsE4000tuner
WaitingforAGCtoconverge...
Examiningcenterfrequency751MHz...
Capturinglivedata
CalculatingPSScorrelations
Searchingforandexaminingcorrelationpeaks...
Detectedacell!
cellID:414
RXpowerlevel:17.0733dB
residualfrequencyoffset:43592.8Hz
Detectedacell!
cellID:415
RXpowerlevel:20.8041dB
residualfrequencyoffset:43592.3Hz
Detectedacell!
http://superkuh.com/rtlsdr.html

32/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

cellID:209
RXpowerlevel:28.8524dB
residualfrequencyoffset:43581.2Hz
Detectedthefollowingcells:
C:CPtypeP:PHICHdurationPR:PHICHresourcetype
CIDfcfoffRXPWRCnRBPPRCrystalCorrectionFactor
414751M43.6k17.1N50None1.0000580496943698439
415751M43.6k20.8N50None1.0000580490797574829
209751M43.6k28.9N50None1.0000580342133056355
Bothpositiveandnegativefrequencyoffsetshappen,butrarelyinthesamedongle.
LTETrackerIhaven'tusedasmuchyet(recentlyreleased)butitisincludedinthegithubrepository
clonedinitiallyandshouldbecompiledaswellifyoudidtheabove.Checkouttheauthorssiteforvideos
ofit'susesinceanasciipasteofthencurseslikeinterfacewouldn'ttellyoumuch.But...thestartlookslike
this,
./LTETrackerf751e6
LTETrackerv1.0.0(release)beginning
Searchfrequency:751MHz
PPM:120
correction:1
FoundRafaelMicroR820Ttuner
Calibratinglocaloscillator.
Calibrationsucceeded!
Residualfrequencyoffset:48937.5Hz
Newcorrectionfactor:0.99993484110674779597
Searcherprocesshasbeenlaunched.
SlightlyalteredGNURadioCompanionflowcharts
"TheGUIstuffinGnuRadiowasratheranafterthought.Nobodyreallyexpectedthatyou'duseitto
buildactualapplications,butratherjustuseitasawayofmaking"testjigs"foryoursignalflows."
ThissectionismynotesonhowImadebasicexampleswork,andhowIeditedthoseexamplesinvery
simpleandoftenbrokenways.Also,sincegqrx,multimode,andotherintergratedreceiverscameoutI
don'tseeanyneedtoupdatetheseasthingschange.Mostofthisisveryold.
Whiletherearelinkstotheoriginalsinthesummaries,thesedescriptionsareoftheversionsmodifiedby
meusuallyjustsamplerateandGUIstuff.WhilethesamplerateortunerwidthIsetmaybesomelarge
number,it'llbecomeobviouswhatthelimitsofeachotherasyouscanaboutandseethesignalfoldingor
mirroring.Usingsampleratesabove2.4MS/swithrtlsdrisnotrecommended.It*does*create
aliasesallover.Ifyou'reusingGNURadio3.7don'tevenbothertryingwithany.grcfileshostedhere.
FM:
patchvonbraun'ssimple(stereo)fmreceiverhardersetup,bestreception,bestsound,2.048MS/s,
+600Khzfinetune
lindi'sfmreceivereasysetup,goodreception,goodsound,3.2MS/s,+600Khzfinetune
superkuh'soffsetfmreceivereasysetup,okayreception,okaysound,2.8MS/s,+900Khztune,
+50Khzfine.
2h20'sbeginnerfm(mono)receivereasytounderstand,easysetup,okaysound,2.8MS/s,nofine
tune
SSB:
OZ9AEC'sSSBReceiverSSBrxandrecordtodisk,seperateplaybackscript.1MS/s,+1kfine
tune.
Tips
Ifitcomeswithapythonfile,trythatfirstbeforegeneratingonefromtheGRCfile.Whentuning,make
suretohitenteragainifitdoesn'tworkthefirsttimeortunestothewrongfrequency.Alwayshitautoscale
tostart,andforFFTdisplaystryusingthe"average"settings.Ihavesetallaudiosinksto"pulse"
(pulseaudio)insteadofsay,"hw:0,0"(ALSA).Youmighthavetochangethat.Togetalistofhardwareuse
"aplayl".That'llshowthevariouscardsanddevices.Usetheformat,"hw:X,Y"where
"hw:CARD=X,DEV=Y".Someflowchartshavevariablesforit,othersputitdirectlyintheAudioSink
element.Ifyouhearsomethinginterestingyoucantrycomparingittoindentifiedsamplesfrom
http://www.kb9ukd.com/digital/orhttp://hfradio.org.uk/html/digital_modes.html.orthewindows
program,SignalsAnalyzer.Checkhttp://www.radioreference.com/or
http://wireless2.fcc.gov/UlsApp/UlsSearch/searchAdvanced.jsptoseewhat'sintheUSAareaatagiven
frequency.
MultipleDongles

Therearetwowaystospecifytheuseofmultipledongles.Thefirst,correct,wayistosetthe"Num
Channels"intheOsmoSDRSourceblockto"2"andthenspecifythedeviceIDsin"DeviceArguments"
like,"rtl=0rtl=1".Eachspecifieddeviceisseperatewithaspacefromthepreviousone.
ThenotsocorrectbutstillworkingwayistousemultipleOsmoSDRSourceblockswith"NumChannels"
setto"1"andeachwithit'srespective"DeviceArguments"fieldsetto"rtl=0"or"rtl=1",orsoon.
TheOsmoSDRSourceblockhasextensivehelpfilesatthebottomofit'spropertiesifyouscrolldown.
Editing

http://superkuh.com/rtlsdr.html

33/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

Toenableablock,selectitandpress'e'.Todisableablockselectitandpress'd'.Whendisabledblocks
willappeardarkergray.
Ifyouopena.grcfileanditlookslikethereareblocksmissing(rederrorhighlightsandnoconnections
betweenthem)thenitislikelythenameoftheblockchangedduringsomeGNURadioupdate.Ifyour
installismorethanamonthortwooldthisoftenhappens.UpdateGNURadio.
It'seasiertotypein1e6than1000000sousescientificnotationwhenyoucaninvariablefields.Ifyou
doubleclickonanelementinaflowchartitusuallyincludesahelpful"Documentation:"ofmostthe
variablestobesetatthebottom.TheGUIelementgridpositionisasetoftwopairsofnumbers:"y,x,a,b"
wherethefirstpair"y,x,"isposition(yrow,xcolumn)and"a,b"isthespanofthebox.IfyouenteraGrid
Positionanditoverlapswithanotherelementit'llturnredandreporttheerrorandwheretheoriginisof
theelementitoverlapswith.

UsetheGridPosition(row,column,rowspan,columnspan)topositionthegraphicalelementin
Thetabeffectisdonewithnotebooks.

ForRTL2832Sourcetheminimumsamplerateis~800KS/s,it'sgrbaz(?)andgenerallynotupdated.Use
OsmoSDRsource.It'sunder"OsmoSDR",not"Sources"ontherightpanel).Ithasa1MS/sminimum
samplerate.It'snotrecommendedtousesampleratesabove2.4M.
InolderversionsofgrosmosdrandrtlsdrIthinkautomagicgaincontrol(AGC)wasonallthetimeso
youdidn'thavetosetthegainexplicitlyinthesourceinGRC.Newversionsrequirethatandalsorequire
settingthechan0.freqtosomething.
Thedonglesseemtohavenoiseattheir0Hzcenterfrequencysothebestperformanceisfromselectinga
band100200Khzoffsetfromthecenter(dependingonsignaltype).patchvonbraun'ssimple_fm_rcvisa
greatexampleofthat.
patchvonbraun'ssimple_fm_rcv
(thissummaryisoutdated)ThebestsoundingsoftwareI'vefoundforlisteningtoFMispatchvonbraun's
SimpleFM(Stereo)Receiver.Idon'tthinkitisverysimpleitincludesmanyadvancedFMspecific
featureslikeextractionofthe19k(pilot)tonenexttosomecommercialFMbroadcasts.ItusedtodoRDS,
Ihear,andolderversionscheckedintoCGRANstillhaveit,butitisremovedforsimplicitlyinthis
version.
svncohttps://www.cgran.org/svn/projects/simple_fm_rcv
cdsimple_fm_rcv/
cdtrunk
lessREADME
make
makeinstall
##it'llinstallto~/bin/,soIuse~/superkuh/binbelow
setPYTHONPATH=/usr/local/lib/python2.6/distpackages:/home/superkuh/bin
#runthepythonscript
pythonsimple_fm_rcv.py
#oreditit
gnuradiocompanionsimple_fm_rcv.grc
lindi'sFMreceiver
Original:http://lindi.iki.fi/lindi/gnuradio/rtl2832cfilelindifm.grc,thiswasanexamplepostedto##rtlsdr
bylindi.Itusedafilesourcewhichwasdecodedtowavandsavedtodisk.Seeninthescreenshotabove.

http://superkuh.com/rtlsdr.html

34/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

Modified:http://superkuh.com/rtl2832cfilelindifm_edit.grc,hadafrontendGUIandanincreased
samplerate.Rightnowtherateoftheaudiofilessavedoutis...notveryuseful.Butitsoundsfine.Seen
below.
3.2MS/sfieldofview,tune+900Khz

http://superkuh.com/rtlsdr.html

35/43

17.03.2015

http://superkuh.com/rtlsdr.html

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

36/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

2h20'ssimplefmreceiver
2.8MS/sfieldofview,nofinetuning.
2h20madeavailable,withthoroughexplaination,abarebonesFM(mono)receivertolearnhowtouse
GNURadio.ThiswasthefirstoneImanagedtogettowork.Becausetheoriginalh202'susesthe
RTL2832SourceandnottheOsmoSDRSourceyoumightexperiencetunercrashesifyouscantoo
quickly.Makesuretoun/repluginthedongleafterthese.It'sbestjusttoenterthefrequencyasanumber.
[BeawarethissectionofthispagewaswrittenmanymonthsagowhenrtlsdrwasdifferentandIhadlittle
ideaofwhatIwasdoing.xzerohassincemanuallyaddedsignalseekingtothisexample.]
Myeditof2h20'ssimplereceiverdoesnotaddmuch,butIdidreplacetheRTL2832sourcewithan
OsmoSDRsourcetoavoidtunercrashes.Ialsoincreasedthesamplerateto2.8MS/s(toseemore
spectrum)andthenincreasedthedecimationinthefilterfrom4to8tocompensatesoeverythingstill
decodes/soundsright.Ialsoremovethesuperfluousthrottleblock.
Modified2h20'sMonoFMReceiver(.grc)

http://superkuh.com/rtlsdr.html

37/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

myoffsettuning+recordingexample
2.8MS/sfieldofview,+900Khztuning,+50Khzfine.
Thistakespartsfromabunchoftheotherexamplereceiversandrepurposestheminpresumablyincorrect
butseeminglyworkingways.Itisabasicexampleofhowtooffsetthetuner200khzawayfromthecenter
toavoidthenoisethere.Istartedwith2h20'ssimpletuner'sGUIframeworkandremovedalmostallofthe
content.Icopied,withinaccuratetrialanderrorchangesofsamplerateandfilteroffset,sectionsofthe
offsettuningandotheradvancedbitsfromsimple_fm_rcvandwfm_rx.grc.Thetuneristuned+200Khz.
Thefreq_xlatingfilteristuned+200Khz.Thethebandpassfilterisspecifiedinavariable,
firdes.complex_band_pass(1.0,1.024e6,95e3,95e3,45e3,firdes.WIN_HAMMING,6.76)
Thenetresultisthatthefrequencyofinterestcomesoutofthetuner200KhzbelowDC,andthe
freq_xlater"liftsitup"by200Khz,andthenit'sbandpassed.
Ialsoblindlycopied
theRFpowerdisplay,a
toggleforsavingthe
audiofilesouttodisk,
anda+900khztuning
sliderfromother
receivers.Iaddeda
second'fine'tune
+50Khz.Thisisdone
bysettingthe
frequencyofthe
XlatingFIRfilterto,
freq_offset+fine+finer
wherefreq_offsetisthe
frequencyoffsetfromcenter(200Khzinthiscase),fineistheIDofawxguisliderforregulartuning,and
fineristhesameforfinetuning.Inorderforthefrequencydisplaytoshowthepropervalueitwas
correspondinglysettoavariableIDcur_freq,
frequencyfinefiner

http://superkuh.com/rtlsdr.html

38/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

Ialsomadethecurrentfrequencydisplayaeditabletextfieldsoyoucantune,copy,andpaste.Thereare
goodexamplesofhownotebookpositioningworksandincludessimplescriptingexamplesforthefile
field.Thisflowchartissimpleenoughtolearnfrombutincludesmanyelementspulledoutofthevery
complexsimple_fm_rcvfrompatchvonbraun.WithouthisexplanationoftheoffsetprocessIwouldn't
havefigureditout.AllblocksarelayedoutbytypeandGUIelementsinthesameorderastheyappear
whenrun.ThisshouldhelpyoufigureoutGridandNotebookpositioning.
Thesoundisonly"okay".Ithinkthesignalisbeingclippedoffattheedgesalittlebit.Iamnotsureifitis
requiredtoinstallpatchvonbraun'ssimple_fm_rcvtousethis,Idousesomeofhiscustomfilterstuff.
Usage
UsetheWaterfallforscanningthroughchannels.Oncelocated,lookattheoffsetfrom0onthebottom
display.Usethattosetthetuning(andfine)sliderandwiggleittillyougetthesignalcrossingthebandin
the"SecondFilter"topdisplay.SwitchtoFFTviewandlookatthebottom"FirstFilter"display,use
tuningandfinetuningtocenterthepeakonthe"FirstFilter"display.Ortheotherwayaround.It's
personalpreference.Ignorethenoiseyouseeathigherfrequencies(900Mhz)at+0.2Mhzbaseband.
Althoughsometimesitgetsfoldedindependingontuning.
superkuh'sFMw/offsettuning,finetuning,andrecording(.grc)

http://superkuh.com/rtlsdr.html

39/43

17.03.2015

http://superkuh.com/rtlsdr.html

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

40/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

SSBReceiveranddataRecorder
CreatedbyAlexandruCseteOZ9AECthenotessay,"SimpleSSBreceiverprototype".Thiscomesfrom
theGNURadioGRCexamplesrepositoryoverathttps://github.com/csete/gnuradiogrc
examples/tree/master/receiver
gitclonehttps://github.com/csete/gnuradiogrcexamples.git
Ichangedthewayitsavessamplesforthesisterdecoderprogrambyaddingautomaticgenerationoffile
namesandanon/offtickboxtoggleforrecording.Youmightwanttochangethedefaultdirectoryby
editingthevariable"prefix".Thekeywas
"/dev/null"ifrecord==Falseelsecapture_file
intheFileSink'file'field.IalsochangedtheGUIsoitwaseasiertofindsignals.Usethesaved.binfiles
withssb_rx_playtohear.Jumpingaroundinfrequencyisalotsmootherwhenreadingfromdiskinstead
ofthedongle.
ModifiedOZ9AECSSBReceiver(.grc)
ssb_rx_play(.grc)

http://superkuh.com/rtlsdr.html

41/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

Howtousertlsdrandhackrfona*fresh*odroidu3withubuntu

#rtlsdronodroidu3
sudo/usr/local/bin/rootutility.sh#resizepartitionfirst
sudoaptgetupdate
sudoaptgetupgrade
sudoaptgetfdistupgrade
#atthispointyou'llgetakernelthatwon'tworkwithlotsofmodules(likeNFS)
#userootutility.shagaintoupdatethekernelandit'llwork.
sudo/usr/local/bin/rootutility.sh
#Installtherequiredprogramsandlibs
sudoaptgetinstallgitcmakelibusb1.00libusb1.00dev
#Forsomereasonlibusb.hdidn'tgetinstalledsoIdiditmanually
sudoaptgetinstallunp#tounpackthe.deb
aptgetdownloadlibusb1.00dev
unpdata.tar.xz
unplibusb1.00dev_2%3a1.0.171ubuntu2_armhf.deb
sudocp./usr/include/libusb1.0/libusb.h/usr/include/libusb1.0/libusb.h
#ThenIcouldstartcompilationofrtlsdr
gitclonegit://git.osmocom.org/rtlsdr.git
cdrtlsdr/
http://superkuh.com/rtlsdr.html

42/43

17.03.2015

rtlsdrandGNURadiow/RealtekRTL2832U,E4000andR820T

mkdirbuild
cdbuild
#Thelibdirisforodroidu3weirdness.The_FILE_OFFSET_BITSisforwriting>2GBfileswitho
cmake../DCMAKE_INSTALL_PREFIX=/usrDINSTALL_UDEV_RULES=ONDLIB_DIR=/usr/lib/armlinuxgnue
make
sudomakeinstall
sudosu
ldconfig

#hackrfoneonodroidu3,doallthenonrtlsdrstuffabovethen,
gitclonegit://github.com/mossmann/hackrf.git
cdhackrf/host
mkdirbuild
cdbuild
#Thelibdirisforodroidu3weirdness.The_FILE_OFFSET_BITSisforwriting>2GBfileswitho
cmake../DINSTALL_UDEV_RULES=ONDLIB_DIR=/usr/lib/armlinuxgnueabihfD_FILE_OFFSET_BITS=64
make
sudomakeinstall
sudosu
ldconfig

http://superkuh.com/rtlsdr.html

43/43

Você também pode gostar