Problem with comparison.
/Designs/Measuring_instruments/RMDS02C/SW/Host_controller/start.sh
0,0 → 1,7
ulimit -c unlimited
~/Bolidozor/frequency_log.py&
jackd -c system -p128 -m -dalsa -dhw:CODEC -r48000 -p4096 -n4 -m -C -i2&
sleep 3
~/Bolidozor/radio-observer -c ~/Bolidozor/uFlu/uFlu-R0.json&
sleep 3
 
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/Designs/Measuring_instruments/RMDS02C/SW/Host_controller/stop.sh
0,0 → 1,7
killall frequency_log.py
killall jackd
killall qjackctl
killall waterfall.py
killall whistle
killall radio-observer
 
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/Designs/Measuring_instruments/RMDS02C/SW/Host_controller/frequency_log.py
0,0 → 1,79
#!/usr/bin/python
#
# Sample of measuring and frequency correction with ACOUNTER02A
 
import time
import datetime
import sys
from pymlab import config
 
req_freq = 286.0788 # required local oscillator frequency in MHz.
 
#### Sensor Configuration ###########################################
 
cfg = config.Config(
i2c = {
"port": 1,
},
bus = [
{
"type": "i2chub",
"address": 0x70,
"children": [
{ "name":"counter", "type":"acount02", "channel": 2, },
{ "name":"clkgen", "type":"clkgen01", "channel": 5, },
],
},
],
)
cfg.initialize()
 
print "RMDS Station frequency management test software \r\n"
fcount = cfg.get_device("counter")
fgen = cfg.get_device("clkgen")
time.sleep(0.5)
frequency = fcount.get_freq()
rfreq = fgen.get_rfreq()
hsdiv = fgen.get_hs_div()
n1 = fgen.get_n1_div()
 
'''
# sample GPS configuration
fcount.conf_GPS(0,5) # length of the GPS configurtion sentence
fcount.conf_GPS(1,ord('a')) # the first byte of GPS configuration sentence
fcount.conf_GPS(2,ord('b')) # the second byte of GPS configyration sentence
fcount.conf_GPS(3,ord('c'))
fcount.conf_GPS(4,ord('d'))
fcount.conf_GPS(5,ord('e'))
'''
fcount.set_GPS() # set GPS configuration
 
#### Data Logging ###################################################
 
try:
with open("frequency.log", "a") as f:
while True:
now = datetime.datetime.now()
if (now.second == 15) or (now.second == 35) or (now.second == 55):
frequency = fcount.get_freq()
if (len(sys.argv) == 3):
regs = fgen.set_freq(frequency/1e6, float(req_freq))
now = datetime.datetime.now()
 
rfreq = fgen.get_rfreq()
hsdiv = fgen.get_hs_div()
n1 = fgen.get_n1_div()
fdco = (frequency/1e6) * hsdiv * n1
fxtal = fdco / rfreq
 
sys.stdout.write("frequency: " + str(frequency) + " Hz Time: " + str(now.second))
sys.stdout.write(" RFREQ: " + str(rfreq) + " HSDIV: " + str(hsdiv) + " N1: " + str(n1))
sys.stdout.write(" fdco: " + str(fdco) + " fxtal: " + str(fxtal) + "\r")
f.write("%d\t%s\t%.3f\n" % (time.time(), datetime.datetime.now().isoformat(), frequency))
 
sys.stdout.flush()
time.sleep(0.9)
except KeyboardInterrupt:
sys.stdout.write("\r\n")
sys.exit(0)
f.close()
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/Designs/Measuring_instruments/RMDS02C/SW/Host_controller/setSi570.py
0,0 → 1,56
#!/usr/bin/python
#
# Utility for setting frequency of Si570 without a frequency measurement.
# The factory calibration is used for changing the frequency.
# This utility reset the Si570 to factory default 10 MHz first and than set a new frequency.
#
# This utility use an USBI2C01A module.
# (c) MLAB 2014
 
import time
import datetime
import sys
from pymlab import config
 
import logging
logging.basicConfig(level=logging.DEBUG)
 
 
#### Script Arguments ###############################################
 
if (len(sys.argv) != 3):
sys.stderr.write("Invalid number of arguments.\n")
sys.stderr.write("Usage: %s PORT_ADDRESS/0 REQUIERED_MHz\n" % (sys.argv[0], ))
sys.exit(1)
 
port = eval(sys.argv[1])
#### Sensor Configuration ###########################################
 
cfg = config.Config(
i2c = {
"port": port,
},
bus = [
{
"type": "i2chub",
"address": 0x70,
"children": [
{ "name":"clkgen", "type":"clkgen01", "channel": 1, },
],
},
],
)
cfg.initialize()
 
fgen = cfg.get_device("clkgen")
sys.stdout.write("Frequency will be set to " + sys.argv[2] + " MHz.\r\n")
fgen.route()
time.sleep(3)
fgen.recall_nvm() # Reload settings for 10 MHz
time.sleep(3)
fgen = cfg.get_device("clkgen") # Reopen CP2112
fgen.set_freq(10., float(eval(sys.argv[2]))) # Set frequency
sys.stdout.write("Done.\r\n")
sys.stdout.flush()
sys.exit(0)
 
/Designs/Measuring_instruments/RMDS02C/SW/Host_controller/SDR_Record_jack.sh
0,0 → 1,8
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#arecord -v --use-strftime -d720 -f dat -t wav -c2 /home/kaklik/Flyover_Svakov_%Y%m%d%H%M%S.wav >> /home/kaklik/record.log
#arecord -v -f dat -t wav -c2 --max-file-time 3600 --use-strftime /mnt/Svakov/%Y/%m/%d/Radio_%Y%m%d%H%M%S.wav
recordfile=/media/Radio_zaloha___/Svakov_HG/$(date +Radio_HG_%Y%m%d%H%M%S).wav
#screen jack_capture -V -d 36 -c 2 -p alsa_in:capture* --filename $recordfile
#screen jack_capture -V -c 2 -p alsa_in:capture* --filename $recordfile
jack_capture -V -d 3605 -c 2 -p alsa_in:capture_1 -p alsa_in:capture_2 --filename $recordfile &
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/Designs/Measuring_instruments/RMDS02C/SW/Host_controller/SDR_record_alsa.sh
0,0 → 1,3
#!/bin/bash
#arecord -v --use-strftime -d720 -f dat -t wav -c2 /home/kaklik/Flyover_Svakov_%Y%m%d%H%M%S.wav >> /home/kaklik/record.log
arecord -v -D hw:1 -f dat -t wav -c2 --max-file-time 3600 --use-strftime /mnt/Svakov_HG/%Y/%m/%d/Radio_%Y%m%d%H%M%S.wav
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/Designs/Measuring_instruments/RMDS02C/SW/Host_controller/SDR_record.sh
0,0 → 1,2
#!/bin/bash
pasuspender -- arecord -D hw:1,0 -v --buffer-time=500000 --use-strftime -d600 -f dat -t wav -c2 /mnt/ISS_Praha_%Y%m%d%H%M%S.wav >> /home/kaklik/SDR_record.log
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/Designs/Measuring_instruments/RMDS02C/SW/Host_controller/SiliconLabs.rules
0,0 → 1,3
SUBSYSTEM=="usb", ATTRS{idVendor}=="10c4", MODE="0666"
SUBSYSTEM=="usb_device", ATTRS{idVendor}=="10c4", MODE="0666"
 
/Designs/Measuring_instruments/RMDS02C/SW/Host_controller/plot.gp
0,0 → 1,12
set terminal png size 800,640
 
set output "Frequency_time.png"
set xdata time
set timefmt "%s"
set format x "%H:%M:%S"
set key under
set xlabel "Time"
set ylabel "Freq deviation [Hz]"
f0=140000000
plot "temperature.log" using 1:($3-f0) with linespoints title "CLKGEN01B 140 MHz"