mirror of
https://github.com/smittix/intercept.git
synced 2026-05-22 15:54:49 -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}
|
||||
},
|
||||
'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},
|
||||
'DCS1800': {'start': 1805e6, 'end': 1880e6, 'arfcn_start': 512, 'arfcn_end': 885}
|
||||
},
|
||||
@@ -226,6 +228,7 @@ def start_scanner():
|
||||
data = request.get_json() or {}
|
||||
device_index = data.get('device', 0)
|
||||
region = data.get('region', 'Americas')
|
||||
selected_bands = data.get('bands', []) # Get user-selected bands
|
||||
|
||||
# Validate device index
|
||||
try:
|
||||
@@ -242,21 +245,24 @@ def start_scanner():
|
||||
'error_type': 'DEVICE_BUSY'
|
||||
}), 409
|
||||
|
||||
# Get frequency range for region
|
||||
bands = REGIONAL_BANDS.get(region, REGIONAL_BANDS['Americas'])
|
||||
# If no bands selected, use all bands for the region (backwards compatibility)
|
||||
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
|
||||
# Example: grgsm_scanner --args="rtl=0" -b GSM850 -b PCS1900
|
||||
# Example: grgsm_scanner --args="rtl=0" -b GSM900
|
||||
try:
|
||||
cmd = ['grgsm_scanner']
|
||||
|
||||
# Add device argument (--args for RTL-SDR device selection)
|
||||
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
|
||||
for band_name in bands.keys():
|
||||
# Normalize band name (EGSM900 -> GSM900)
|
||||
for band_name in selected_bands:
|
||||
# Normalize band name (EGSM900 -> GSM900, remove EGSM prefix)
|
||||
normalized_band = band_name.replace('EGSM', 'GSM')
|
||||
cmd.extend(['-b', normalized_band])
|
||||
|
||||
|
||||
@@ -1294,13 +1294,24 @@
|
||||
<div class="control-group">
|
||||
<span class="control-group-label">GSM SCANNER</span>
|
||||
<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="Europe">Europe</option>
|
||||
<option value="Europe" selected>Europe</option>
|
||||
<option value="Asia">Asia</option>
|
||||
</select>
|
||||
<button class="start-btn" id="startBtn" onclick="toggleScanner()">START</button>
|
||||
</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>
|
||||
</main>
|
||||
@@ -1329,6 +1340,24 @@
|
||||
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
|
||||
// ============================================
|
||||
@@ -1337,6 +1366,7 @@
|
||||
loadObserverLocation();
|
||||
initDeviceSelector();
|
||||
startUtcClock();
|
||||
updateBandSelector(); // Initialize band selector with default region (Europe)
|
||||
});
|
||||
|
||||
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
|
||||
// ============================================
|
||||
@@ -1432,12 +1506,18 @@
|
||||
const region = document.getElementById('scannerRegion').value;
|
||||
const lat = parseFloat(document.getElementById('obsLat').value);
|
||||
const lon = parseFloat(document.getElementById('obsLon').value);
|
||||
const selectedBands = getSelectedBands();
|
||||
|
||||
if (isNaN(lat) || isNaN(lon)) {
|
||||
alert('Please enter valid GPS coordinates');
|
||||
return;
|
||||
}
|
||||
|
||||
if (selectedBands.length === 0) {
|
||||
alert('Please select at least one band to scan');
|
||||
return;
|
||||
}
|
||||
|
||||
// Start backend scanner
|
||||
try {
|
||||
const response = await fetch('/gsm_spy/start', {
|
||||
@@ -1446,6 +1526,7 @@
|
||||
body: JSON.stringify({
|
||||
device: device,
|
||||
region: region,
|
||||
bands: selectedBands, // Send selected bands
|
||||
lat: lat,
|
||||
lon: lon
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user