Here are some useful commands:
-
@@ -254,8 +242,14 @@
return {
isLoading: false,
atcmd: null,
+ defaultAtCommand: 'ATI',
atCommandResponse: "",
sendAtCommand() {
+ if (!this.atcmd) {
+ // Use ATI as default command
+ this.atcmd = "ATI";
+ console.log("AT Command is empty, using ATI as default command: ", this.atcmd);
+ }
this.isLoading = true;
fetch(
"/cgi-bin/get_atcommand?" +
@@ -279,27 +273,6 @@
},
};
}
-
- function sendRebootCommand() {
- var isRebootClicked = true;
- console.log("Reboot command triggered");
- var atcmd = "AT+CFUN=1,1";
- fetch(
- "/cgi-bin/get_atcommand?" +
- new URLSearchParams({
- atcmd: atcmd,
- })
- )
- .then((res) => {
- return res.text();
- })
- .then((data) => {
- console.log(data); // Logging the response for debugging purposes
- })
- .catch((error) => {
- console.error("Error:", error);
- });
- }