mirror of https://github.com/OpenIPC/firmware.git
[no ci] Update wifibroadcast-ng (#1730)
parent
0822a26212
commit
1adb8b8f5d
|
@ -1,12 +1,14 @@
|
||||||
wireless:
|
wireless:
|
||||||
txpower: 1
|
txpower: 1
|
||||||
channel: 161
|
channel: 161
|
||||||
mode: HT20
|
width: HT20
|
||||||
broadcast:
|
broadcast:
|
||||||
wfb_index: 2
|
mcs_index: 2
|
||||||
tun_index: 1
|
tun_index: 1
|
||||||
fec_k: 8
|
fec_k: 8
|
||||||
fec_n: 12
|
fec_n: 12
|
||||||
|
stbc: 0
|
||||||
|
ldpc: 0
|
||||||
link_id: 7669206
|
link_id: 7669206
|
||||||
telemetry:
|
telemetry:
|
||||||
router: msposd
|
router: msposd
|
||||||
|
|
|
@ -55,25 +55,25 @@ load_modules() {
|
||||||
|
|
||||||
load_interface() {
|
load_interface() {
|
||||||
iw "$wfb_dev" set monitor none
|
iw "$wfb_dev" set monitor none
|
||||||
iw "$wfb_dev" set channel "$channel" "$mode"
|
iw "$wfb_dev" set channel "$channel" "$width"
|
||||||
iw reg set 00
|
iw reg set 00
|
||||||
|
|
||||||
[ "$driver" = "88XXau" ] && wfb_pwr=$((txpower * -100)) || wfb_pwr=$((txpower * 50))
|
[ "$driver" = "88XXau" ] && wfb_power=$((txpower * -100)) || wfb_power=$((txpower * 50))
|
||||||
iw "$wfb_dev" set txpower fixed "$wfb_pwr"
|
iw "$wfb_dev" set txpower fixed "$wfb_power"
|
||||||
[ "$mode" = "HT20" ] && bandwidth=20 || bandwidth=40
|
[ "$width" = "HT20" ] && wfb_width=20 || wfb_width=40
|
||||||
}
|
}
|
||||||
|
|
||||||
start_broadcast() {
|
start_broadcast() {
|
||||||
echo_log "Starting wfb_tx"
|
echo_log "Starting wfb_tx"
|
||||||
wfb_tx -K "$wfb_key" -M "$wfb_index" -B "$bandwidth" -C 8000 -G short \
|
wfb_tx -K "$wfb_key" -M "$mcs_index" -B "$wfb_width" -k "$fec_k" -n "$fec_n" \
|
||||||
-k "$fec_k" -n "$fec_n" -i "$link_id" "$wfb_dev" &> /dev/null &
|
-S "$stbc" -L "$ldpc" -i "$link_id" -C 8000 -G short "$wfb_dev" &> /dev/null &
|
||||||
}
|
}
|
||||||
|
|
||||||
start_tunnel() {
|
start_tunnel() {
|
||||||
echo_log "Starting wfb_tun"
|
echo_log "Starting wfb_tun"
|
||||||
wfb_rx -p 160 -u 5800 -K "$wfb_key" -i "$link_id" "$wfb_dev" &> /dev/null &
|
wfb_rx -p 160 -u 5800 -K "$wfb_key" -i "$link_id" "$wfb_dev" &> /dev/null &
|
||||||
wfb_tx -p 32 -u 5801 -K "$wfb_key" -M "$tun_index" \
|
wfb_tx -p 32 -u 5801 -K "$wfb_key" -M "$tun_index" -k "$fec_k" -n "$fec_n" \
|
||||||
-k "$fec_k" -n "$fec_n" -i "$link_id" "$wfb_dev" &> /dev/null &
|
-S "$stbc" -L "$ldpc" -i "$link_id" "$wfb_dev" &> /dev/null &
|
||||||
wfb_tun -a 10.5.0.10/24 > /dev/null &
|
wfb_tun -a 10.5.0.10/24 > /dev/null &
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,11 @@
|
||||||
<a href="javascript:location.reload()"><img src="logo.webp" width="220dp"></a>
|
<a href="javascript:location.reload()"><img src="logo.webp" width="220dp"></a>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="container">
|
<section class="video-section">
|
||||||
<section class="video-section">
|
<video id="preview" poster="/mjpeg"></video>
|
||||||
<video id="preview" poster="/mjpeg"></video>
|
</section>
|
||||||
</section>
|
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
<section class="form-section">
|
<section class="form-section">
|
||||||
<form id="majestic-form">
|
<form id="majestic-form">
|
||||||
<h3>Video</h3>
|
<h3>Video</h3>
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
<select id="bitrate" name="majestic.video0.bitrate"></select>
|
<select id="bitrate" name="majestic.video0.bitrate"></select>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label for="records">Recording:</label>
|
<label for="records">Record:</label>
|
||||||
<input type="checkbox" id="records" name="majestic.records.enabled">
|
<input type="checkbox" id="records" name="majestic.records.enabled">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
<input type="checkbox" id="audio" name="majestic.audio.enabled">
|
<input type="checkbox" id="audio" name="majestic.audio.enabled">
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label for="srate">Samplerate:</label>
|
<label for="srate">Sample:</label>
|
||||||
<select id="srate" name="majestic.audio.srate">
|
<select id="srate" name="majestic.audio.srate">
|
||||||
<option value="8000">8000</option>
|
<option value="8000">8000</option>
|
||||||
<option value="48000">48000</option>
|
<option value="48000">48000</option>
|
||||||
|
@ -61,6 +61,8 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<hr class="divider">
|
||||||
|
|
||||||
<div class="button-container">
|
<div class="button-container">
|
||||||
<button id="apply-video-button">Apply</button>
|
<button id="apply-video-button">Apply</button>
|
||||||
<button id="reset-video-button">Reset</button>
|
<button id="reset-video-button">Reset</button>
|
||||||
|
@ -115,12 +117,8 @@
|
||||||
|
|
||||||
<h3>Broadcast</h3>
|
<h3>Broadcast</h3>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label for="wfb_index">WFB Index:</label>
|
<label for="wfb_index">MCS Index:</label>
|
||||||
<select id="wfb_index" name="wfb.broadcast.wfb_index"></select>
|
<select id="wfb_index" name="wfb.broadcast.mcs_index"></select>
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<label for="tun_index">TUN Index:</label>
|
|
||||||
<select id="tun_index" name="wfb.broadcast.tun_index"></select>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr class="divider">
|
<hr class="divider">
|
||||||
|
@ -142,6 +140,8 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<hr class="divider">
|
||||||
|
|
||||||
<div class="button-container">
|
<div class="button-container">
|
||||||
<button id="apply-wfb-button">Apply</button>
|
<button id="apply-wfb-button">Apply</button>
|
||||||
<button id="reset-wfb-button">Reset</button>
|
<button id="reset-wfb-button">Reset</button>
|
||||||
|
|
|
@ -22,6 +22,10 @@ async function runCommand(command) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (navigator.userAgent.includes("Android")) {
|
||||||
|
document.querySelector('.video-section').style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
function syncForm(data, formPrefix, mode) {
|
function syncForm(data, formPrefix, mode) {
|
||||||
Object.keys(data).forEach((section) => {
|
Object.keys(data).forEach((section) => {
|
||||||
Object.keys(data[section]).forEach((key) => {
|
Object.keys(data[section]).forEach((key) => {
|
||||||
|
@ -34,17 +38,10 @@ function syncForm(data, formPrefix, mode) {
|
||||||
const value = data[section][key];
|
const value = data[section][key];
|
||||||
|
|
||||||
if (mode === "setup") {
|
if (mode === "setup") {
|
||||||
if (isCheckbox) {
|
isCheckbox ? field.checked = value === true : field.value = value;
|
||||||
field.checked = value === true;
|
|
||||||
} else {
|
|
||||||
field.value = value;
|
|
||||||
}
|
|
||||||
} else if (mode === "update") {
|
} else if (mode === "update") {
|
||||||
if (isCheckbox) {
|
data[section][key] = isCheckbox ?
|
||||||
data[section][key] = field.checked;
|
field.checked : (isNaN(field.value) ? field.value : Number(field.value));
|
||||||
} else {
|
|
||||||
data[section][key] = field.value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -99,7 +96,3 @@ loadYAML('/etc/wfb.yaml', (data) => {
|
||||||
configData.wfb = data;
|
configData.wfb = data;
|
||||||
syncForm(configData.wfb, 'wfb', "setup");
|
syncForm(configData.wfb, 'wfb', "setup");
|
||||||
});
|
});
|
||||||
|
|
||||||
if (navigator.userAgent.includes("Android")) {
|
|
||||||
document.querySelector('.video-section').style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
|
@ -19,69 +19,78 @@ h3 {
|
||||||
color: #dee2e6bf;
|
color: #dee2e6bf;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row {
|
.container {
|
||||||
margin: 20px;
|
display: flex;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-section .row {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin: 10px 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-section {
|
.form-section {
|
||||||
|
width: 45%;
|
||||||
|
margin: 20px 0;
|
||||||
|
padding-top: 20px;
|
||||||
background-color: #2d2d2d;
|
background-color: #2d2d2d;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
box-shadow: 0 2px 10px #00000080;
|
box-shadow: 0 2px 10px #00000080;
|
||||||
max-width: 60%;
|
|
||||||
padding: 20px;
|
|
||||||
margin: 20px auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-section label {
|
.form-section label {
|
||||||
|
width: 10vw;
|
||||||
|
margin: 10px 0 5px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: 10px 0 5px;
|
|
||||||
width: 150px;
|
|
||||||
vertical-align: top;
|
|
||||||
color: #dee2e6;
|
color: #dee2e6;
|
||||||
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-section select {
|
.form-section select {
|
||||||
width: 120px;
|
width: 16vw;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
|
background-color: #3c3c3c;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: 1px solid #555;
|
border: 1px solid #555;
|
||||||
background-color: #3c3c3c;
|
|
||||||
color: #dcdcdc;
|
color: #dcdcdc;
|
||||||
display: inline-block;
|
font-size: 0.9rem;
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-section input {
|
.form-section input {
|
||||||
width: 120px;
|
width: 16vw;
|
||||||
height: 25px;
|
height: 26px;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-section button {
|
||||||
|
width: 20vw;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 10px;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 1rem;
|
||||||
|
color: white;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0 2px 10px #00000040;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-container {
|
.button-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
margin: 25px;
|
||||||
|
|
||||||
.form-section button {
|
|
||||||
width: 160px;
|
|
||||||
padding: 10px;
|
|
||||||
margin: 10px;
|
|
||||||
border: none;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 1rem;
|
|
||||||
color: white;
|
|
||||||
box-shadow: 0 2px 10px #00000040;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#preview {
|
#preview {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 80%;
|
max-width: 75%;
|
||||||
background-color: #000;
|
background-color: #000;
|
||||||
box-shadow: 0 2px 10px #00000080;
|
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
box-shadow: 0 2px 10px #00000080;
|
||||||
}
|
}
|
||||||
|
|
||||||
#apply-video-button, #apply-wfb-button {
|
#apply-video-button, #apply-wfb-button {
|
||||||
|
|
Loading…
Reference in New Issue