rtlsdrblog

moRFeus Tracking Generator Python Script

May 31st, 2018
1,002
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. import sys
  2. import telnetlib
  3. import os
  4. import time
  5.  
  6. HOST = "localhost"
  7. PORT = "7356"
  8.  
  9. FREQ_MIN = 85
  10. FREQ_MAX = 1500
  11.  
  12. tn = telnetlib.Telnet(HOST, PORT)
  13.  
  14. def writeCommand(cmd):
  15.     tn.write(('%s\n' % cmd).encode('ascii'))
  16.     return tn.read_some().decode('ascii').strip();
  17.  
  18. def setMorfeusFreq(freq):
  19.     os.system("~/morfeus_tool_linux_x32 setFrequency " + str(freq))
  20.  
  21. def trackFreq(freq):
  22.     freq_hz = freq * 1000000
  23.     setMorfeusFreq(freq_hz)
  24.     writeCommand("F " + str(freq_hz))
  25.  
  26.  
  27. os.system("~/morfeus_tool_linux_x32 Generator")
  28. os.system("~/morfeus_tool_linux_x32 setCurrent 1")
  29.  
  30. f = open("out.txt", "w+")
  31.  
  32. for x in range(FREQ_MIN, FREQ_MAX):
  33.     trackFreq(x)
  34.     time.sleep(0.5)
  35.     pwr =  writeCommand('l')
  36.     f.write(str(x) + ', ' + pwr + '\n')
Add Comment
Please, Sign In to add comment