Exemplo n.º 1
0
# commands :
# stop
# config Threshold, gain, level
# tx [filename]
# tx ShortLFM
# tx LFM
# ref [filename]
# rx [samples] tmp/[filename]

for m in modems:
    try:
        reset('192.168.0.' + m)
    except:
        print("# Cannot connect to modem : " + m)
        continue
    runCMD('config ' + ' '.join(c[m]) + '\n', m)

    runCMD('ref tmp/ShortLFM', '147')
    runCMD('rx ' + str(Fs * 5) + ' tmp/rx_OFDM_Second', '147')

#for m in modems:
#try:
#reset('192.168.0.' + m)
#except:
#print("# Cannot connect to modem : " + m )
#continue
#runCMD('config ' + ' '.join(c[m]) + '\n',m)
#runCMD('tx tmp/ShortLFM',m)
#sleep(0.25)
#runCMD('tx tmp/LFM',m)
#sleep(1)
Exemplo n.º 2
0
# stop 
# config Threshold, gain, level
# tx [filename]
# tx ShortLFM
# tx LFM
# ref [filename]
# rx [samples] tmp/[filename]


for m in modems:
	try:
		reset('192.168.0.' + m)
	except:
		print("# Cannot connect to modem : " + m )
		continue
	runCMD('config ' + ' '.join(c[m]) + '\n',m)	
	runCMD('ref tmp/' + refFileName,m)
	#runCMD('rx ' + str(Fs*4) + ' tmp/rx_OFDM_Second',m)

while 1:
	nextFileId =  len([name for name in listdir('./tmp') if (path.isfile('./tmp/' + name) and rxFilename in './tmp/' + name)])
	print("# of file : " + str(nextFileId) )
	runCMD('rx ' + str(Fs*WinLen) + ' ./tmp/' + rxFilename + str(nextFileId),m)


#for m in modems:
	#try:
		#reset('192.168.0.' + m)
	#except:
		#print("# Cannot connect to modem : " + m )
		#continue
Exemplo n.º 3
0
def handler(signum, frame):
    print('./tx was changed')
    runCMD('stop', m)
    for n in os.listdir(FNAME):
        runCMD('tx ' + FNAME + '/' + n)
        os.remove(FNAME + '/' + n)
Exemplo n.º 4
0

if not path.exists(FNAME):
    makedirs(FNAME)

if not path.exists('./tmp'):
    makedirs('./tmp')

# signal.signal(signal.SIGIO, handler)
# fd = len(listdir(FNAME))
# fcntl.fcntl(fd, fcntl.F_SETSIG, 0)
# fcntl.fcntl(fd, fcntl.F_NOTIFY,fcntl.DN_MODIFY)
notify(FNAME, handler)

m = modems[0]
try:
    reset('192.168.0.' + m)
except:
    print("# Cannot connect to modem : " + m)
    exit()

runCMD('stop', m)
while 1:
    nextFileId = len([
        name for name in listdir('./tmp')
        if (path.isfile('./tmp/' + name) and rxFilename in './tmp/' + name)
    ])
    runCMD('config 1 0 0\n', m)
    runCMD('ref tmp/' + refFileName, m)
    runCMD('rx ' + str(Fs * 5) + ' ./tmp/' + rxFilename + str(nextFileId), m)
Exemplo n.º 5
0
############################

# commands : 
# stop 
# config Threshold, gain, level
# tx [filename]
# tx ShortLFM
# tx LFM
# ref [filename]
# rx [samples] tmp/[filename]


for m in modems:
	try:
		reset('192.168.0.' + m)
		runCMD('config ' + ' '.join(c[m]) + '\n',m)
		runCMD('ref tmp/ShortLFM','136')		
		for FileID in FileIDVec:
			runCMD('rx ' + str(Fs*20) + ' tmp/rx_LobsterSecond' + FileID,'136')
			print("# another reception ended " )

	except:
		print("# Cannot connect to modem : " + m )
		continue



#for m in modems:
	#try:
		#reset('192.168.0.' + m)
	#except:
Exemplo n.º 6
0
# commands :
# stop
# config Threshold, gain, level
# tx [filename]
# tx ShortLFM
# tx LFM
# ref [filename]
# rx [samples] tmp/[filename]

for m in modems:
    try:
        reset('192.168.0.' + m)
    except:
        print("# Cannot connect to modem : " + m)
        continue
    runCMD('config ' + ' '.join(c[m]) + '\n', m)

runCMD('ref tmp/ShortLFM', '137')
runCMD('rx ' + str(Fs * 2) + ' tmp/rx_OFDM', '137')
runCMD('tx tmp/Sig2Tx', '136')

#for m in modems:
#try:
#reset('192.168.0.' + m)
#except:
#print("# Cannot connect to modem : " + m )
#continue
#runCMD('config ' + ' '.join(c[m]) + '\n',m)
#runCMD('tx tmp/ShortLFM',m)
#sleep(0.25)
#runCMD('tx tmp/LFM',m)