mirror of
https://github.com/smittix/intercept.git
synced 2026-05-23 00:04:50 -07:00
Adding more available bands for europe as testing fase
This commit is contained in:
@@ -34,6 +34,8 @@ REGIONAL_BANDS = {
|
|||||||
'PCS1900': {'start': 1930e6, 'end': 1990e6, 'arfcn_start': 512, 'arfcn_end': 810}
|
'PCS1900': {'start': 1930e6, 'end': 1990e6, 'arfcn_start': 512, 'arfcn_end': 810}
|
||||||
},
|
},
|
||||||
'Europe': {
|
'Europe': {
|
||||||
|
'GSM800': {'start': 832e6, 'end': 862e6, 'arfcn_start': 438, 'arfcn_end': 511}, # E-GSM800 downlink
|
||||||
|
'GSM850': {'start': 869e6, 'end': 894e6, 'arfcn_start': 128, 'arfcn_end': 251}, # Also used in some EU countries
|
||||||
'EGSM900': {'start': 925e6, 'end': 960e6, 'arfcn_start': 0, 'arfcn_end': 124},
|
'EGSM900': {'start': 925e6, 'end': 960e6, 'arfcn_start': 0, 'arfcn_end': 124},
|
||||||
'DCS1800': {'start': 1805e6, 'end': 1880e6, 'arfcn_start': 512, 'arfcn_end': 885}
|
'DCS1800': {'start': 1805e6, 'end': 1880e6, 'arfcn_start': 512, 'arfcn_end': 885}
|
||||||
},
|
},
|
||||||
@@ -226,6 +228,7 @@ def start_scanner():
|
|||||||
data = request.get_json() or {}
|
data = request.get_json() or {}
|
||||||
device_index = data.get('device', 0)
|
device_index = data.get('device', 0)
|
||||||
region = data.get('region', 'Americas')
|
region = data.get('region', 'Americas')
|
||||||
|
selected_bands = data.get('bands', []) # Get user-selected bands
|
||||||
|
|
||||||
# Validate device index
|
# Validate device index
|
||||||
try:
|
try:
|
||||||
@@ -242,21 +245,24 @@ def start_scanner():
|
|||||||
'error_type': 'DEVICE_BUSY'
|
'error_type': 'DEVICE_BUSY'
|
||||||
}), 409
|
}), 409
|
||||||
|
|
||||||
# Get frequency range for region
|
# If no bands selected, use all bands for the region (backwards compatibility)
|
||||||
bands = REGIONAL_BANDS.get(region, REGIONAL_BANDS['Americas'])
|
if not selected_bands:
|
||||||
|
region_bands = REGIONAL_BANDS.get(region, REGIONAL_BANDS['Americas'])
|
||||||
|
selected_bands = list(region_bands.keys())
|
||||||
|
logger.warning(f"No bands specified, using all bands for {region}: {selected_bands}")
|
||||||
|
|
||||||
# Build grgsm_scanner command
|
# Build grgsm_scanner command
|
||||||
# Example: grgsm_scanner --args="rtl=0" -b GSM850 -b PCS1900
|
# Example: grgsm_scanner --args="rtl=0" -b GSM900
|
||||||
try:
|
try:
|
||||||
cmd = ['grgsm_scanner']
|
cmd = ['grgsm_scanner']
|
||||||
|
|
||||||
# Add device argument (--args for RTL-SDR device selection)
|
# Add device argument (--args for RTL-SDR device selection)
|
||||||
cmd.extend(['--args', f'rtl={device_index}'])
|
cmd.extend(['--args', f'rtl={device_index}'])
|
||||||
|
|
||||||
# Add band arguments (grgsm_scanner uses band names, not frequencies)
|
# Add selected band arguments
|
||||||
# Map EGSM900 to GSM900 since that's what grgsm_scanner expects
|
# Map EGSM900 to GSM900 since that's what grgsm_scanner expects
|
||||||
for band_name in bands.keys():
|
for band_name in selected_bands:
|
||||||
# Normalize band name (EGSM900 -> GSM900)
|
# Normalize band name (EGSM900 -> GSM900, remove EGSM prefix)
|
||||||
normalized_band = band_name.replace('EGSM', 'GSM')
|
normalized_band = band_name.replace('EGSM', 'GSM')
|
||||||
cmd.extend(['-b', normalized_band])
|
cmd.extend(['-b', normalized_band])
|
||||||
|
|
||||||
|
|||||||
@@ -1294,13 +1294,24 @@
|
|||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<span class="control-group-label">GSM SCANNER</span>
|
<span class="control-group-label">GSM SCANNER</span>
|
||||||
<div class="control-group-items">
|
<div class="control-group-items">
|
||||||
<select id="scannerRegion" title="GSM frequency region">
|
<select id="scannerRegion" title="GSM frequency region" onchange="updateBandSelector()">
|
||||||
<option value="Americas">Americas</option>
|
<option value="Americas">Americas</option>
|
||||||
<option value="Europe">Europe</option>
|
<option value="Europe" selected>Europe</option>
|
||||||
<option value="Asia">Asia</option>
|
<option value="Asia">Asia</option>
|
||||||
</select>
|
</select>
|
||||||
<button class="start-btn" id="startBtn" onclick="toggleScanner()">START</button>
|
<button class="start-btn" id="startBtn" onclick="toggleScanner()">START</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Band Selector -->
|
||||||
|
<div style="margin-top: 8px; padding: 10px; background: rgba(255,255,255,0.02); border-radius: 4px; border: 1px solid rgba(255,255,255,0.05);">
|
||||||
|
<div style="font-size: 10px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 600;">BANDS TO SCAN:</div>
|
||||||
|
<div id="bandCheckboxes" style="display: flex; flex-direction: column; gap: 6px;">
|
||||||
|
<!-- Dynamically populated based on region -->
|
||||||
|
</div>
|
||||||
|
<div style="font-size: 9px; color: var(--text-dim); margin-top: 6px; font-style: italic;">
|
||||||
|
💡 Tip: Uncheck unused bands for faster scanning
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
@@ -1329,6 +1340,24 @@
|
|||||||
totalSignals: 0
|
totalSignals: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Band configurations by region
|
||||||
|
const BAND_CONFIG = {
|
||||||
|
'Europe': [
|
||||||
|
{ name: 'GSM900', label: 'GSM900 (925-960 MHz)', freq: '925-960 MHz', common: true, recommended: true },
|
||||||
|
{ name: 'GSM850', label: 'GSM850 (869-894 MHz)', freq: '869-894 MHz', common: true, recommended: true },
|
||||||
|
{ name: 'GSM800', label: 'GSM800 (832-862 MHz)', freq: '832-862 MHz', common: true, recommended: true },
|
||||||
|
{ name: 'DCS1800', label: 'DCS1800 (1805-1880 MHz)', freq: '1805-1880 MHz', common: false, recommended: false }
|
||||||
|
],
|
||||||
|
'Americas': [
|
||||||
|
{ name: 'GSM850', label: 'GSM850 (869-894 MHz)', freq: '869-894 MHz', common: true, recommended: true },
|
||||||
|
{ name: 'PCS1900', label: 'PCS1900 (1930-1990 MHz)', freq: '1930-1990 MHz', common: true, recommended: true }
|
||||||
|
],
|
||||||
|
'Asia': [
|
||||||
|
{ name: 'GSM900', label: 'GSM900 (925-960 MHz)', freq: '925-960 MHz', common: true, recommended: true },
|
||||||
|
{ name: 'DCS1800', label: 'DCS1800 (1805-1880 MHz)', freq: '1805-1880 MHz', common: true, recommended: true }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
// ============================================
|
// ============================================
|
||||||
// INITIALIZATION
|
// INITIALIZATION
|
||||||
// ============================================
|
// ============================================
|
||||||
@@ -1337,6 +1366,7 @@
|
|||||||
loadObserverLocation();
|
loadObserverLocation();
|
||||||
initDeviceSelector();
|
initDeviceSelector();
|
||||||
startUtcClock();
|
startUtcClock();
|
||||||
|
updateBandSelector(); // Initialize band selector with default region (Europe)
|
||||||
});
|
});
|
||||||
|
|
||||||
function initMap() {
|
function initMap() {
|
||||||
@@ -1416,6 +1446,50 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ============================================
|
||||||
|
// BAND SELECTOR
|
||||||
|
// ============================================
|
||||||
|
function updateBandSelector() {
|
||||||
|
const region = document.getElementById('scannerRegion').value;
|
||||||
|
const bands = BAND_CONFIG[region] || [];
|
||||||
|
const container = document.getElementById('bandCheckboxes');
|
||||||
|
|
||||||
|
container.innerHTML = '';
|
||||||
|
|
||||||
|
bands.forEach(band => {
|
||||||
|
const checkbox = document.createElement('label');
|
||||||
|
checkbox.style.cssText = 'display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 11px; color: var(--text-primary);';
|
||||||
|
|
||||||
|
const input = document.createElement('input');
|
||||||
|
input.type = 'checkbox';
|
||||||
|
input.value = band.name;
|
||||||
|
input.checked = band.recommended; // Recommended bands checked by default
|
||||||
|
input.style.cssText = 'cursor: pointer;';
|
||||||
|
|
||||||
|
const labelText = document.createElement('span');
|
||||||
|
labelText.textContent = band.label;
|
||||||
|
|
||||||
|
const badge = document.createElement('span');
|
||||||
|
if (band.common) {
|
||||||
|
badge.textContent = '⭐ PRIMARY';
|
||||||
|
badge.style.cssText = 'font-size: 8px; padding: 2px 6px; background: rgba(56, 193, 128, 0.2); color: #38c180; border-radius: 3px; font-weight: 600;';
|
||||||
|
} else {
|
||||||
|
badge.textContent = 'SECONDARY';
|
||||||
|
badge.style.cssText = 'font-size: 8px; padding: 2px 6px; background: rgba(159, 176, 199, 0.1); color: var(--text-dim); border-radius: 3px;';
|
||||||
|
}
|
||||||
|
|
||||||
|
checkbox.appendChild(input);
|
||||||
|
checkbox.appendChild(labelText);
|
||||||
|
checkbox.appendChild(badge);
|
||||||
|
container.appendChild(checkbox);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSelectedBands() {
|
||||||
|
const checkboxes = document.querySelectorAll('#bandCheckboxes input[type="checkbox"]:checked');
|
||||||
|
return Array.from(checkboxes).map(cb => cb.value);
|
||||||
|
}
|
||||||
|
|
||||||
// ============================================
|
// ============================================
|
||||||
// SCANNER CONTROL
|
// SCANNER CONTROL
|
||||||
// ============================================
|
// ============================================
|
||||||
@@ -1432,12 +1506,18 @@
|
|||||||
const region = document.getElementById('scannerRegion').value;
|
const region = document.getElementById('scannerRegion').value;
|
||||||
const lat = parseFloat(document.getElementById('obsLat').value);
|
const lat = parseFloat(document.getElementById('obsLat').value);
|
||||||
const lon = parseFloat(document.getElementById('obsLon').value);
|
const lon = parseFloat(document.getElementById('obsLon').value);
|
||||||
|
const selectedBands = getSelectedBands();
|
||||||
|
|
||||||
if (isNaN(lat) || isNaN(lon)) {
|
if (isNaN(lat) || isNaN(lon)) {
|
||||||
alert('Please enter valid GPS coordinates');
|
alert('Please enter valid GPS coordinates');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (selectedBands.length === 0) {
|
||||||
|
alert('Please select at least one band to scan');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Start backend scanner
|
// Start backend scanner
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/gsm_spy/start', {
|
const response = await fetch('/gsm_spy/start', {
|
||||||
@@ -1446,6 +1526,7 @@
|
|||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
device: device,
|
device: device,
|
||||||
region: region,
|
region: region,
|
||||||
|
bands: selectedBands, // Send selected bands
|
||||||
lat: lat,
|
lat: lat,
|
||||||
lon: lon
|
lon: lon
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user