forked from MattMills/radiocapture-rf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathov_scan.py
executable file
·111 lines (88 loc) · 3.27 KB
/
ov_scan.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/env python
# Copyright 2019,2020 Radiocapture LLC - Radiocapture.com
from edacs_control_demod import edacs_control_demod
from p25_control_demod import p25_control_demod
from moto_control_demod import moto_control_demod
from config import rc_config
import uuid
import logging
import logging.config
import json
from frontend_connector import frontend_connector
with open('config.logging.json', 'rt') as f:
config = json.load(f)
logging.config.dictConfig(config)
overseer_uuid = '%s' % uuid.uuid4()
site_uuid = '876c1a54-8183-4134-a41c-67a5b6121fcd'
config = rc_config()
types = ['p25_c4fm']
demods = []
for x in range(-20, 20):
offset = x*6250
if 'edacs_no_esk' in types:
edacs_thread_no_esk = edacs_control_demod({
'type': 'edacs',
'id': 'edacs_no_esk',
'symbol_rate': 9600.0,
'esk': False,
'channels': { 0:offset} ,
}, site_uuid, overseer_uuid)
edacs_thread_no_esk.start()
demods.append(edacs_thread_no_esk)
if 'edacs_esk' in types:
edacs_thread_esk = edacs_control_demod({
'type': 'edacs',
'id': 'edacs_esk',
'symbol_rate': 9600.0,
'esk': True,
'channels': { 0:offset} ,
}, site_uuid, overseer_uuid)
edacs_thread_esk.start()
demods.append(edacs_thread_esk)
if 'moto' in types:
moto_thread = moto_control_demod({
'type': 'moto',
'id': 'moto',
'channels': { 0:offset, 1:offset },
}, site_uuid, overseer_uuid)
moto_thread.start()
demods.append(moto_thread)
if 'p25_cqpsk' in types:
p25_thread_cqpsk = p25_control_demod({
'type': 'p25',
'id': 'cqpsk',
'modulation': 'CQPSK',
'default_control_channel': 0,
'channels': { 0: offset},
}, site_uuid, overseer_uuid)
p25_thread_cqpsk.start()
demods.append(p25_thread_cqpsk)
if 'p25_c4fm' in types:
p25_thread_c4fm = p25_control_demod({
'type': 'p25',
'id': 'c4fm',
'modulation': 'C4FM',
'default_control_channel': 0,
'channels': { 0: offset},
}, site_uuid, overseer_uuid)
p25_thread_c4fm.start()
demods.append(p25_thread_c4fm)
connector = frontend_connector()
with open('scan.output', 'w') as f:
pass
import time
import itertools
for mhz in itertools.chain(range(768, 775), range(850, 863)):
for x in (-5, -2.5, 0, 2.5):
offset = x*100000
connector.scan_mode_set_freq(int((mhz*1000000)+offset))
time.sleep(5)
for thread in demods:
if thread.is_locked == True:
if thread.system['type'] == 'p25':
detail = sid = '%s %s-%s %s-%s' % (thread.site_detail['Control Channel'], thread.site_detail['System ID'], thread.site_detail['WACN ID'], thread.site_detail['RF Sub-system ID'], thread.site_detail['Site ID'])
else:
detail = thread.site_detail
with open('scan.output', 'a') as f:
f.write('%s: System locked: Type: %s, detail: %s\n' % (((mhz*1000000)+offset+thread.control_channel), thread.system['type'], detail))
print 'Scan complete: %s Mhz' % mhz