diff --git a/scripts/advanced.php b/scripts/advanced.php index b91247b..cf5b608 100644 --- a/scripts/advanced.php +++ b/scripts/advanced.php @@ -168,6 +168,14 @@ if(isset($_GET['submit'])) { } } + if(isset($_GET["freqshift_reconnect_delay"]) && is_numeric($_GET['freqshift_reconnect_delay'])) { + $freqshift_reconnect_delay = $_GET["freqshift_reconnect_delay"]; + if(strcmp($freqshift_hi,$config['FREQSHIFT_RECONNECT_DELAY']) !== 0) { + $contents = preg_replace("/FREQSHIFT_RECONNECT_DELAY=.*/", "FREQSHIFT_RECONNECT_DELAY=$freqshift_reconnect_delay", $contents); + $contents2 = preg_replace("/FREQSHIFT_RECONNECT_DELAY=.*/", "FREQSHIFT_RECONNECT_DELAY=$freqshift_reconnect_delay", $contents2); + } + } + if(isset($_GET["full_disk"])) { $full_disk = $_GET["full_disk"]; if(strcmp($full_disk,$config['FULL_DISK']) !== 0) { @@ -530,6 +538,7 @@ foreach($formats as $format){
BirdNET-Pi PasswordThis password will protect your "Tools" page and "Live Audio" stream. +Do NOT use special characters. Accepted characters: [A-Z0-9a-z] show |
+ + +
Using sox: diff --git a/scripts/install_config.sh b/scripts/install_config.sh index 023c135..c2364de 100755 --- a/scripts/install_config.sh +++ b/scripts/install_config.sh @@ -169,6 +169,9 @@ FREQSHIFT_HI=6000 ## FREQSHIFT_LO FREQSHIFT_LO=3000 +## FREQSHIFT_RECONNECT_DELAY +FREQSHIFT_RECONNECT_DELAY=4000 + ## If the tool is sox, you have to define the pitch shift (amount of 100ths of semintone) ## FREQSHIFT_PITCH FREQSHIFT_PITCH=-1500 diff --git a/scripts/spectrogram.php b/scripts/spectrogram.php index 96b118e..7f34c4b 100644 --- a/scripts/spectrogram.php +++ b/scripts/spectrogram.php @@ -8,6 +8,12 @@ if (file_exists('./scripts/thisrun.txt')) { $config = parse_ini_file('./scripts/firstrun.ini'); } +if(!empty($config['FREQSHIFT_RECONNECT_DELAY']) && is_numeric($config['FREQSHIFT_RECONNECT_DELAY'])){ + $FREQSHIFT_RECONNECT_DELAY = ($config['FREQSHIFT_RECONNECT_DELAY']); +}else{ + $FREQSHIFT_RECONNECT_DELAY = 4000; +} + if(isset($_GET['ajax_csv'])) { $RECS_DIR = $config["RECS_DIR"]; @@ -323,6 +329,8 @@ function toggleFreqshift(state) { console.log("freqshift deactivated") } + freqShiftReconnectDelay = ; + var livestream_freqshift_spinner = document.getElementById('livestream_freqshift_spinner'); livestream_freqshift_spinner.style.display = "inline"; // Create the XMLHttpRequest object. @@ -349,7 +357,7 @@ function toggleFreqshift(state) { livestream_freqshift_spinner.style.display = "none"; }, - 2000 + freqShiftReconnectDelay ) } } diff --git a/scripts/update_birdnet_snippets.sh b/scripts/update_birdnet_snippets.sh index dcc58b2..f3cfff2 100755 --- a/scripts/update_birdnet_snippets.sh +++ b/scripts/update_birdnet_snippets.sh @@ -151,6 +151,9 @@ fi if ! grep ACTIVATE_FREQSHIFT_IN_LIVESTREAM /etc/birdnet/birdnet.conf &>/dev/null;then sudo -u$USER echo "ACTIVATE_FREQSHIFT_IN_LIVESTREAM=\"false\"" >> /etc/birdnet/birdnet.conf fi +if ! grep FREQSHIFT_RECONNECT_DELAY /etc/birdnet/birdnet.conf &>/dev/null;then + sudo -u$USER echo "FREQSHIFT_RECONNECT_DELAY=4000" >> /etc/birdnet/birdnet.conf +fi if ! grep HEARTBEAT_URL /etc/birdnet/birdnet.conf &>/dev/null;then sudo -u$USER echo "HEARTBEAT_URL=" >> /etc/birdnet/birdnet.conf fi