Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import telnetlib
- import os
- import time
- HOST = "localhost"
- PORT = "7356"
- FREQ_MIN = 85
- FREQ_MAX = 1500
- tn = telnetlib.Telnet(HOST, PORT)
- def writeCommand(cmd):
- tn.write(('%s\n' % cmd).encode('ascii'))
- return tn.read_some().decode('ascii').strip();
- def setMorfeusFreq(freq):
- os.system("~/morfeus_tool_linux_x32 setFrequency " + str(freq))
- def trackFreq(freq):
- freq_hz = freq * 1000000
- setMorfeusFreq(freq_hz)
- writeCommand("F " + str(freq_hz))
- os.system("~/morfeus_tool_linux_x32 Generator")
- os.system("~/morfeus_tool_linux_x32 setCurrent 1")
- f = open("out.txt", "w+")
- for x in range(FREQ_MIN, FREQ_MAX):
- trackFreq(x)
- time.sleep(0.5)
- pwr = writeCommand('l')
- f.write(str(x) + ', ' + pwr + '\n')
Add Comment
Please, Sign In to add comment