added cell lock max to 10

This commit is contained in:
Russel Yasol
2024-03-29 21:09:41 +08:00
parent bb2921c8fe
commit 19c233e02b
6 changed files with 232 additions and 296 deletions

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>AT Commands</title>
<title>Simple Settings</title>
<script src="/js/alpinejs.min.js" defer></script>
<link rel="stylesheet" href="/css/bulma.css" />
@@ -35,7 +35,9 @@
>
<div class="navbar-start">
<a class="navbar-item" href="/"> Connection Info </a>
<a class="navbar-item" href="/atcommander.html"> AT Commands </a>
<a class="navbar-item" href="/atcommander.html">
Simple Settings
</a>
<a class="navbar-item" href="/bandlock.html"> Simple Network </a>
<a class="navbar-item" href="/sms.html"> SMS </a>
<a class="navbar-item" href="/ttl.html"> TTL Changer </a>
@@ -95,13 +97,13 @@
<div class="column is-8">
<div class="card">
<header class="card-header">
<p class="card-header-title">ATI Response</p>
<p class="card-header-title">AT Command Response</p>
</header>
<div class="card-content">
<div class="content">
<textarea
class="textarea"
placeholder="Please send only 1 AT command at a time"
placeholder="Multiple commands should be separated by a semicolon. Example: AT+CGMR;+GSN"
rows="10"
x-text="isLoading ? 'Fetching response, please wait...' : atCommandResponse"
></textarea>
@@ -115,21 +117,18 @@
</div>
<!-- START Useful Commands Section -->
<div class="container">
<div class="container" x-data="atCommands()">
<div class="columns">
<div class="column is-12">
<div class="card">
<header class="card-header">
<p class="card-header-title">Useful Commands</p>
<p class="card-header-title">Useful One Click Commands</p>
</header>
<div class="card-content">
<div class="content">
<div
class="field"
style="margin-bottom: 1rem"
x-data="atCommands()"
>
<p class="control">
<div style="display: flex; flex-direction: row; flex-wrap: wrap; margin-top: 1rem; justify-content: space-between;">
<div class="field">
<div class="control">
<button
class="button is-danger"
@click="sendRebootCommand()"
@@ -137,131 +136,41 @@
>
Reboot
</button>
</p>
</div>
</div>
<div class="field">
<div class="control">
<button
class="button is-danger"
@click="sendRebootCommand()"
:disabled="isRebooting"
>
Reboot
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Loading modal -->
<div x-show="isRebooting" class="modal-overlay">
<div class="loading-modal">
<div class="spinner"></div>
<div class="loading-text" style="display: flex; flex-direction: column;">
<div
class="loading-text"
style="display: flex; flex-direction: column"
>
<h3>Rebooting...</h3>
<p style="margin-top: 0.5rem;">Please wait for
<span x-text="countdown" style="font-weight: 500;"></span> seconds before
refreshing the page.</p>
</div>
</div>
</div>
</div>
<!-- Add your useful commands content here -->
<p>Here are some useful commands:</p>
<ul>
<li>
<!-- Open to another tab -->
See <a href="https://github.com/iamromulan/RM520N-GL#at-commands" target="_blank" style="cursor: pointer;">https://github.com/iamromulan/RM520N-GL#at-commands</a> for
more
</li>
<li>AT+CFUN=1,1 (reboot)</li>
<li>
AT+QMAPWAC? (get current status of auto connect, 0=disabled
1=enabled)
</li>
<li>
AT+QMAPWAC=1 (enable auto connect internet for ethernet)
</li>
<li>
AT+QMAPWAC=0 (disable auto connect for ethernet; use when
you want internet over usb to work; IPPT must be disabled)
</li>
<li>
AT+QUIMSLOT? (get active sim slot; 1=Slot 1; 2=Slot 2)
</li>
<li>AT+QUIMSLOT=1 (switch to sim slot 1)</li>
<li>AT+QUIMSLOT=2 (switch to sim slot 2)</li>
<li>AT+CGDCONT? (Get active APN profle list 1 through 8)</li>
<li>
AT+CGDCONT=1,"IPV4V6","APNHERE" (Sets APN profle 1 to
APNHERE using both IPV4 and IPV6)
</li>
<li>AT+GSN (Show current IMEI)</li>
<li>AT+EGMR=1,7,"IMEIGOESHERE" (sets/repairs IMEI)</li>
<li>AT+QCAINFO (Show all connected bands/CA info)</li>
<li>
AT+QNWPREFCFG="mode_pref" (Check what the current network
search mode is set to)
</li>
<li>
AT+QNWPREFCFG="mode_pref",AUTO (Set network search mode to
automatic)
</li>
<li>
AT+QNWPREFCFG="mode_pref",NR5G:LTE (Set network search mode
to 5G/NR and 4G/LTE only)
</li>
<li>
AT+QNWPREFCFG="mode_pref",NR5G (Set network search mode to
5G/NR only)
</li>
<li>
AT+QNWPREFCFG="mode_pref",LTE (Set network search mode to
4G/LTE only)
</li>
<li>
AT+QNWPREFCFG="nr5g_disable_mode" (Check to see if SA or NSA
NR5G is disabled)
</li>
<li>
AT+QNWPREFCFG="nr5g_disable_mode",0 (Enable Both SA and NSA
5G/NR)
</li>
<li>
AT+QNWPREFCFG="nr5g_disable_mode",1 (Disable SA 5G/NR only)
</li>
<li>
AT+QNWPREFCFG="nr5g_disable_mode",2 (Disable NSA 5G/NR only)
</li>
<li>
AT+QNWPREFCFG="nr5g_band" (Get current 5G/NR bandlock
settings)
</li>
<li>
AT+QNWPREFCFG="nr5g_band",1:2:3:4:5:6 (Example: Lock to
5G/NR bands n1,n2,n3,n4,n5, and n6)
</li>
<li>
AT+QNWPREFCFG="lte_band" (Get current 4G/LTE bandlock
settings)
</li>
<li>
AT+QNWPREFCFG="lte_band",1:2:3:4:5:6 (Example: Lock to
4G/LTE bands 1,2,3,4,5, and 6)
</li>
<li>
AT+QMAP="WWAN" (Show currently assigned IPv4 and IPv6 from
the provider)
</li>
<li>
AT+QMAP="LANIP" (Show current DHCP range and Gateway address
for VLAN0)
</li>
<li>
AT+QMAP="LANIP",IP_start_range,IP_end_range,Gateway_IP (Set
IPv4 Start/End range and Gateway IP of DHCP for VLAN0)
</li>
<li>
AT+QMAP="DHCPV4DNS","disable" (disable the onboard DNS
proxy; recommended for IPPT)
</li>
<li>
AT+QMAP="MPDN_rule",0,1,0,1,1,"FF:FF:FF:FF:FF:FF" (Turn on
IP Passthrough for Ethernet)
</li>
<li>
AT+QMAP="MPDN_rule",0 (turn off IPPT/clear MPDN rule 0;
Remember to run AT+QMAPWAC=1 and reboot after)
</li>
</ul>
</div>
</div>
<p style="margin-top: 0.5rem">
Please wait for
<span x-text="countdown" style="font-weight: 500"></span> seconds
before refreshing the page.
</p>
</div>
</div>
</div>

View File

@@ -44,7 +44,9 @@
>
<div class="navbar-start">
<a class="navbar-item" href="/"> Connection Info </a>
<a class="navbar-item" href="/atcommander.html"> AT Commands </a>
<a class="navbar-item" href="/atcommander.html">
Simple Settings
</a>
<a class="navbar-item" href="/bandlock.html"> Simple Network </a>
<a class="navbar-item" href="/sms.html"> SMS </a>
<a class="navbar-item" href="/ttl.html"> TTL Changer </a>
@@ -130,85 +132,23 @@
</div>
<div
class="select is-info"
id="numFreqContainer"
style="margin-left: 1rem"
x-show="networkMode2 == 'LTE'"
>
<select id="numFreqSelect" x-model="cellNum">
<option>Number of Cells</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
</div>
<!-- For LTE Freq Number 1 -->
<div
style="margin-top: 1rem"
x-show="cellNum >= 1 && networkMode2 == 'LTE'"
>
<div style="display: flex; flex-direction: row">
<input
class="input is-info"
type="text"
placeholder="EARFCN"
x-model="earfcn1"
/>
<input
class="input is-info"
type="text"
placeholder="PCI"
x-model="pci1"
style="margin-left: 1rem"
type="number"
id="numFreqInput"
min="1"
max="10"
placeholder="1-10"
x-model="cellNum"
/>
</div>
</div>
<!-- For LTE Freq Number 2 -->
<div
style="margin-top: 1rem"
x-show="cellNum >= 2 && networkMode2 == 'LTE'"
>
<div style="display: flex; flex-direction: row">
<input
class="input is-info"
type="text"
placeholder="EARFCN"
x-model="earfcn2"
/>
<input
class="input is-info"
type="text"
placeholder="PCI"
x-model="pci2"
style="margin-left: 1rem"
/>
</div>
</div>
<!-- For LTE Freq Number 3 -->
<div
style="margin-top: 1rem"
x-show="cellNum == 3 && networkMode2 == 'LTE'"
>
<div style="display: flex; flex-direction: row">
<input
class="input is-info"
type="text"
placeholder="EARFCN"
x-model="earfcn3"
/>
<input
class="input is-info"
type="text"
placeholder="PCI"
x-model="pci3"
style="margin-left: 1rem"
/>
</div>
</div>
<div id="freqNumbersContainer"></div>
<!-- For NR5G-SA -->
<div style="margin-top: 1rem" x-show="networkMode2 == 'NR5G-SA'">
@@ -404,7 +344,6 @@
<p class="card-header-title">Query Network Parameters</p>
</header>
<div class="card-content">
<div class="content">
<textarea
class="textarea"
rows="5"
@@ -412,12 +351,9 @@
x-text=" isLoading ? 'Getting Response...' : queryCommandResponse"
></textarea>
<div class="columns is-variable is-multiline" style="margin-top: 1rem">
<div class="column is-half-desktop">
<div>
<div style="margin-top: 1.5rem">
<p>Check Locked Bands</p>
<div class="is-flex-wrap-wrap">
<div class="select is-info">
<div class="select is-info" style="margin-top: 0.5rem">
<select id="lockedBands" x-model="lockedBands">
<option>Locked Bands</option>
<option>LTE</option>
@@ -428,21 +364,17 @@
<button
class="button is-link"
style="margin-left: 1rem"
style="margin-left: 1rem; margin-top: 0.5rem"
@click="showLockedBands()"
:disabled="isLoading"
>
Check Bands
</button>
</div>
</div>
</div>
<div class="column is-half-desktop">
<div>
<div style="margin-top: 1rem">
<p>Check Cell Lock</p>
<div class="is-flex-wrap-wrap">
<div class="select is-info">
<div class="select is-info" style="margin-top: 0.5rem">
<select id="cellState" x-model="cellState">
<option>Cell Lock</option>
<option>LTE</option>
@@ -452,18 +384,18 @@
<button
class="button is-link"
style="margin-left: 1rem"
style="margin-left: 1rem; margin-top: 0.5rem"
@click="showCellState()"
:disabled="isLoading"
>
Check Cell
</button>
</div>
</div>
</div>
</div>
<div class="buttons" style="margin-top: 1rem">
<div style="margin-top: 2rem">
<p>Other Network Query</p>
</div>
<div class="buttons" style="margin-top: 0.5rem">
<button
class="button is-link mr-2"
@click="showSupportedBands()"
@@ -487,7 +419,22 @@
>
Show Pref Network
</button>
</div>
<button
class="button is-link"
@click="showCaInfo()"
:disabled="isLoading"
>
Carrier Aggregation Info
</button>
<button
class="button is-link"
@click="fullNetworkScan()"
:disabled="isLoading"
>
Full Network Scan
</button>
</div>
</div>
<div class="card-footer" style="padding: 0.25rem">
@@ -538,6 +485,7 @@
function atCommands() {
return {
isLoading: false,
isQuerying: false,
isLocking: false,
isError: false,
countdown: 5, // Initial countdown value
@@ -551,6 +499,20 @@
pci2: null,
earfcn3: null,
pci3: null,
earfcn4: null,
pci4: null,
earfcn5: null,
pci5: null,
earfcn6: null,
pci6: null,
earfcn7: null,
pci7: null,
earfcn8: null,
pci8: null,
earfcn9: null,
pci9: null,
earfcn10: null,
pci10: null,
band: null,
scs: null,
apnInput: null,
@@ -642,6 +604,34 @@
atcmd = `AT+QNWLOCK="common/4g",3,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3}`;
console.log(atcmd);
break;
case "4":
atcmd = `AT+QNWLOCK="common/4g",4,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3},${this.earfcn4},${this.pci4}`;
console.log(atcmd);
break;
case "5":
atcmd = `AT+QNWLOCK="common/4g",5,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3},${this.earfcn4},${this.pci4},${this.earfcn5},${this.pci5}`;
console.log(atcmd);
break;
case "6":
atcmd = `AT+QNWLOCK="common/4g",6,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3},${this.earfcn4},${this.pci4},${this.earfcn5},${this.pci5},${this.earfcn6},${this.pci6}`;
console.log(atcmd);
break;
case "7":
atcmd = `AT+QNWLOCK="common/4g",7,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3},${this.earfcn4},${this.pci4},${this.earfcn5},${this.pci5},${this.earfcn6},${this.pci6},${this.earfcn7},${this.pci7}`;
console.log(atcmd);
break;
case "8":
atcmd = `AT+QNWLOCK="common/4g",8,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3},${this.earfcn4},${this.pci4},${this.earfcn5},${this.pci5},${this.earfcn6},${this.pci6},${this.earfcn7},${this.pci7},${this.earfcn8},${this.pci8}`;
console.log(atcmd);
break;
case "9":
atcmd = `AT+QNWLOCK="common/4g",9,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3},${this.earfcn4},${this.pci4},${this.earfcn5},${this.pci5},${this.earfcn6},${this.pci6},${this.earfcn7},${this.pci7},${this.earfcn8},${this.pci8},${this.earfcn9},${this.pci9}`;
console.log(atcmd);
break;
case "10":
atcmd = `AT+QNWLOCK="common/4g",10,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3},${this.earfcn4},${this.pci4},${this.earfcn5},${this.pci5},${this.earfcn6},${this.pci6},${this.earfcn7},${this.pci7},${this.earfcn8},${this.pci8},${this.earfcn9},${this.pci9},${this.earfcn10},${this.pci10}`;
console.log(atcmd);
break;
default:
console.log(atcmd);
this.isError = true;
@@ -655,8 +645,6 @@
atcmd = `AT+QNWLOCK="common/5g",${this.pci1},${this.earfcn1},${this.scs},${this.band}`;
console.log(atcmd);
}
this.isLoading = true;
this.sendAtCommand(atcmd);
},
restoreBands() {
@@ -764,8 +752,19 @@
const prefCmd = 'AT+QNWPREFCFG="mode_pref"';
this.queryATCommand(prefCmd);
},
showCaInfo() {
const caCmd = "AT+QCAINFO";
this.queryATCommand(caCmd);
},
fullNetworkScan() {
const scanCmd = "AT+QSCAN=3,1";
// Show a temporary loading query message
this.queryCommandResponse =
"Full network scan initiated. This takes about a minute. Please wait...";
this.queryATCommand(scanCmd);
},
queryATCommand(atcmd) {
this.isLoading = true;
this.isQuerying = true;
fetch(
"/cgi-bin/get_atcommand?" +
new URLSearchParams({
@@ -783,11 +782,12 @@
console.error("Error sending AT command:", error);
})
.finally(() => {
this.isLoading = false;
this.isQuerying = false;
});
},
sendAtCommand(atcmd) {
this.isLocking = true;
this.isLoading = true;
this.startCountdown();
console.log(atcmd);
fetch(
@@ -820,12 +820,39 @@
this.isLocking = false;
this.isError = false;
this.isLoading = false;
this.isQuerying = false;
this.countdown = 5;
}
}, 1000);
},
};
}
const freqNumbersContainer = document.getElementById(
"freqNumbersContainer"
);
function generateFreqNumberInputs(num) {
let html = "";
for (let i = 1; i <= num; i++) {
html += `
<div style="margin-top: 1rem" x-show="cellNum >= ${i} && networkMode2 == 'LTE'">
<div style="display: flex; flex-direction: row">
<input class="input is-info" type="text" placeholder="EARFCN" x-model="earfcn${i}" />
<input class="input is-info" type="text" placeholder="PCI" x-model="pci${i}" style="margin-left: 1rem" />
</div>
</div>
`;
}
return html;
}
document
.getElementById("numFreqInput")
.addEventListener("input", function () {
const cellNum = parseInt(this.value);
freqNumbersContainer.innerHTML = generateFreqNumberInputs(cellNum);
});
</script>
</body>
</html>

View File

@@ -36,7 +36,7 @@
>
<div class="navbar-start">
<a class="navbar-item" href="/"> Connection Info </a>
<a class="navbar-item" href="/atcommander.html"> AT Commands </a>
<a class="navbar-item" href="/atcommander.html"> Simple Settings </a>
<a class="navbar-item" href="/bandlock.html"> Simple Network </a>
<a class="navbar-item" href="/sms.html"> SMS </a>
<a class="navbar-item" href="/ttl.html"> TTL Changer </a>

View File

@@ -36,7 +36,7 @@
>
<div class="navbar-start">
<a class="navbar-item" href="/"> Connection Info </a>
<a class="navbar-item" href="/atcommander.html"> AT Commands </a>
<a class="navbar-item" href="/atcommander.html"> Simple Settings </a>
<a class="navbar-item" href="/bandlock.html"> Simple Network </a>
<a class="navbar-item" href="/sms.html"> SMS </a>
<a class="navbar-item" href="/ttl.html"> TTL Changer </a>

View File

@@ -37,7 +37,7 @@
>
<div class="navbar-start">
<a class="navbar-item" href="/"> Connection Info </a>
<a class="navbar-item" href="/atcommander.html"> AT Commands </a>
<a class="navbar-item" href="/atcommander.html"> Simple Settings </a>
<a class="navbar-item" href="/bandlock.html"> Simple Network </a>
<a class="navbar-item" href="/sms.html"> SMS </a>
<a class="navbar-item" href="/ttl.html"> TTL Changer </a>

View File

@@ -31,7 +31,7 @@
<div id="navMenu" class="navbar-menu" :class="isOpen ? 'is-active' : ''">
<div class="navbar-start">
<a class="navbar-item" href="/"> Connection Info </a>
<a class="navbar-item" href="/atcommander.html"> AT Commands </a>
<a class="navbar-item" href="/atcommander.html"> Simple Settings </a>
<a class="navbar-item" href="/bandlock.html"> Simple Network </a>
<a class="navbar-item" href="/sms.html"> SMS </a>
<a class="navbar-item" href="/ttl.html"> TTL Changer </a>