SDXPINN branch is now ipk focused
-Updated opkg-feed with new packages -Updated key cause I lost my private key
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
Package: luci-app-atinout-mod
|
||||
Version: 1.3.4-20241006
|
||||
Depends: libc, atinout, luci-compat
|
||||
Source: package/luci-app-atinout-mod
|
||||
SourceName: luci-app-atinout-mod
|
||||
License: GPLv3
|
||||
Section: luci
|
||||
SourceDateEpoch: 1636930326
|
||||
Maintainer: OpenWrt LuCI community
|
||||
Architecture: all
|
||||
Installed-Size: 3790
|
||||
Description: Web UI for atinout modded by iamromulan preset for use on SDXPINN
|
||||
5
ipk-source/luci-app-atinout-mod_1.3.4-20241006_all/CONTROL/postinst
Executable file
5
ipk-source/luci-app-atinout-mod_1.3.4-20241006_all/CONTROL/postinst
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
[ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
|
||||
[ -s ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
|
||||
. ${IPKG_INSTROOT}/lib/functions.sh
|
||||
default_postinst $0 $@
|
||||
7
ipk-source/luci-app-atinout-mod_1.3.4-20241006_all/CONTROL/postinst-pkg
Executable file
7
ipk-source/luci-app-atinout-mod_1.3.4-20241006_all/CONTROL/postinst-pkg
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
chmod +x /sbin/set_at_port.sh
|
||||
chmod +x /usr/bin/luci-app-atinout
|
||||
rm -rf /tmp/luci-indexcache
|
||||
rm -rf /tmp/luci-modulecache/
|
||||
/sbin/set_at_port.sh
|
||||
exit 0
|
||||
4
ipk-source/luci-app-atinout-mod_1.3.4-20241006_all/CONTROL/prerm
Executable file
4
ipk-source/luci-app-atinout-mod_1.3.4-20241006_all/CONTROL/prerm
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
[ -s ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
|
||||
. ${IPKG_INSTROOT}/lib/functions.sh
|
||||
default_prerm $0 $@
|
||||
74
ipk-source/luci-app-atinout-mod_1.3.4-20241006_all/build-ipk
Executable file
74
ipk-source/luci-app-atinout-mod_1.3.4-20241006_all/build-ipk
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Script for building OpenWRT .ipk packages using tar by iamromulan
|
||||
# Works with SDXPPINN OpenWRT - iamromulan
|
||||
# This script accepts an optional path to the directory containing the `CONTROL` and `root` directories.
|
||||
# Usage: ./build-ipk.sh [path]
|
||||
# If no path is provided, the script will look in the current directory for `CONTROL` and `root` directories.
|
||||
# This will spit out an ipk in the current directory
|
||||
|
||||
# Check if the script is run as root. If not, rerun with sudo.
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Script is not running as root. Re-executing with sudo..."
|
||||
exec sudo "$0" "$@"
|
||||
fi
|
||||
|
||||
# Set the default build path to the current directory
|
||||
build_path="."
|
||||
|
||||
# Check if a path is provided as the first argument
|
||||
if [ "$1" ]; then
|
||||
build_path="$1"
|
||||
fi
|
||||
|
||||
# Check if the required directories are present in the specified path
|
||||
if [ ! -d "${build_path}/CONTROL" ] || [ ! -d "${build_path}/root" ]; then
|
||||
echo "Error: CONTROL and root directories must be present in the specified path (${build_path})."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract values from the CONTROL/control file in the specified path
|
||||
pkgname=$(grep -i '^Package:' "${build_path}/CONTROL/control" | awk '{print $2}')
|
||||
version=$(grep -i '^Version:' "${build_path}/CONTROL/control" | awk '{print $2}')
|
||||
architecture=$(grep -i '^Architecture:' "${build_path}/CONTROL/control" | awk '{print $2}')
|
||||
|
||||
# Check if values are extracted correctly
|
||||
if [ -z "$pkgname" ] || [ -z "$version" ] || [ -z "$architecture" ]; then
|
||||
echo "Error: Failed to extract Package, Version, or Architecture from ${build_path}/CONTROL/control."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set the final IPK name based on the extracted values
|
||||
ipkname="${pkgname}_${version}_${architecture}.ipk"
|
||||
|
||||
# Ensure all CONTROL scripts are executable
|
||||
echo "Setting permissions for CONTROL scripts..."
|
||||
chmod +x "${build_path}/CONTROL"/*
|
||||
|
||||
# Set ownership for CONTROL and root files
|
||||
echo "Setting ownership for all package files..."
|
||||
chown -R root:root "${build_path}/CONTROL"/*
|
||||
chown -R root:root "${build_path}/root"/*
|
||||
|
||||
# Create control.tar.gz from the CONTROL directory
|
||||
echo "Creating control.tar.gz..."
|
||||
tar -czvf control.tar.gz -C "${build_path}/CONTROL" .
|
||||
|
||||
# Create data.tar.gz from the root directory
|
||||
echo "Creating data.tar.gz..."
|
||||
tar -czvf data.tar.gz -C "${build_path}/root" .
|
||||
|
||||
# Create debian-binary file (must contain exactly "2.0" without a newline)
|
||||
echo -n "2.0" > debian-binary
|
||||
chown -R root:root debian-binary
|
||||
|
||||
# Combine the components into the final .ipk file using tar
|
||||
echo "Packaging ${ipkname}..."
|
||||
tar -czvf "$ipkname" debian-binary control.tar.gz data.tar.gz
|
||||
|
||||
# Clean up intermediate files
|
||||
echo "Cleaning up temporary files..."
|
||||
rm -f control.tar.gz data.tar.gz debian-binary
|
||||
|
||||
echo "IPK package ${ipkname} created successfully using tar."
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
Reboot;AT+CFUN=1,1
|
||||
Disconnect;AT+CFUN=0
|
||||
Connect;AT+CFUN=1
|
||||
Signal Info;AT+QENG="servingcell"
|
||||
CA Info;AT+QCAINFO
|
||||
Get current SIM Slot;AT+QUIMSLOT?
|
||||
Switch to SIM Slot 1;AT+QUIMSLOT=1
|
||||
Switch to SIM Slot 2;AT+QUIMSLOT=2
|
||||
Get current APN List;AT+CGDCONT?
|
||||
Set APN to NRBROADBAND;AT+CGDCONT=1,"IPV4V6","NRBROADBAND"
|
||||
Show Current IMEI;AT+EGMR=0,7
|
||||
Show Current Network Mode;AT+QNWPREFCFG="mode_pref"
|
||||
Set Network Mode to AUTO;AT+QNWPREFCFG="mode_pref",AUTO
|
||||
Set Network Mode to 5G NR/4G LTE Only;AT+QNWPREFCFG="mode_pref",NR5G:LTE
|
||||
Set Network Mode to 5G NR Only;AT+QNWPREFCFG="mode_pref",NR5G
|
||||
Set Network Mode to 4G LTE Only;AT+QNWPREFCFG="mode_pref",LTE
|
||||
Check to see if SA or NSA is disabled;AT+QNWPREFCFG="nr5g_disable_mode"
|
||||
Enable Both SA and NSA;AT+QNWPREFCFG="nr5g_disable_mode",0
|
||||
Disable SA Only;AT+QNWPREFCFG="nr5g_disable_mode",1
|
||||
Disable NSA Only;AT+QNWPREFCFG="nr5g_disable_mode",2
|
||||
Get Currently Enabled 5G/NR SA Bands;AT+QNWPREFCFG="nr5g_band"
|
||||
Get Currently Enabled 5G/NR NSA Bands;AT+QNWPREFCFG="nsa_nr5g_band"
|
||||
Get Currently Enabled 4G/LTE Bands;AT+QNWPREFCFG="lte_band"
|
||||
View assigned IPv4/IPv6 addresses from the provider;AT+QMAP="WWAN"
|
||||
Enable IPPT paste in MAC for FF:FF:FF...;AT+QMAP="MPDN_rule",0,1,0,1,1,"FF:FF:FF:FF:FF:FF"
|
||||
Disable IPPT;AT+QMAP="MPDN_rule",0
|
||||
Set IPv4 DMZ....replace iphere;AT+QMAP="DMZ",1,4,iphere
|
||||
Set IPv6 DMZ....replace iphere;AT+QMAP="DMZ",1,6,iphere
|
||||
Disable IPv4 DMZ;AT+QMAP="DMZ",0,4
|
||||
Disable IPv6 DMZ;AT+QMAP="DMZ",0,6
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
config atinout 'general'
|
||||
option atcport '/dev/smd11'
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
# Copyright 2020-2021 Rafał Wabik (IceG) - From eko.one.pl forum
|
||||
# Licensed to the GNU General Public License v3.0.
|
||||
|
||||
work=false
|
||||
for port in /dev/ttyUSB*
|
||||
do
|
||||
[[ -e $port ]] || continue
|
||||
gcom -d $port info &> /tmp/testusb
|
||||
testUSB=`cat /tmp/testusb | grep "Error\|Can't"`
|
||||
if [ -z "$testUSB" ]; then
|
||||
work=$port
|
||||
break
|
||||
fi
|
||||
done
|
||||
rm -rf /tmp/testusb
|
||||
|
||||
if [ $work != false ]; then
|
||||
uci set atinout.@atinout[0].atcport=$work
|
||||
uci commit atinout
|
||||
fi
|
||||
21
ipk-source/luci-app-atinout-mod_1.3.4-20241006_all/root/sbin/set_at_port.sh
Executable file
21
ipk-source/luci-app-atinout-mod_1.3.4-20241006_all/root/sbin/set_at_port.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
# Copyright 2020-2021 Rafał Wabik (IceG) - From eko.one.pl forum
|
||||
# Licensed to the GNU General Public License v3.0.
|
||||
|
||||
work=false
|
||||
for port in /dev/ttyUSB*
|
||||
do
|
||||
[[ -e $port ]] || continue
|
||||
gcom -d $port info &> /tmp/testusb
|
||||
testUSB=`cat /tmp/testusb | grep "Error\|Can't"`
|
||||
if [ -z "$testUSB" ]; then
|
||||
work=$port
|
||||
break
|
||||
fi
|
||||
done
|
||||
rm -rf /tmp/testusb
|
||||
|
||||
if [ $work != false ]; then
|
||||
uci set atinout.@atinout[0].atcport=$work
|
||||
uci commit atinout
|
||||
fi
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
ARGS=$1
|
||||
DEVPORT=$(uci -q get atinout.general.atcport)
|
||||
|
||||
if [ "$DEVPORT" ]; then
|
||||
echo "${ARGS}" | /usr/bin/atinout - ${DEVPORT} -
|
||||
fi
|
||||
@@ -0,0 +1,49 @@
|
||||
local e=require"luci.util"
|
||||
local e=require"nixio.fs"
|
||||
local e=require"luci.sys"
|
||||
local e=require"luci.http"
|
||||
local e=require"luci.dispatcher"
|
||||
local e=require"luci.http"
|
||||
local t=require"luci.sys"
|
||||
local t=require"luci.model.uci".cursor()
|
||||
module("luci.controller.modem.atc",package.seeall)
|
||||
function index()
|
||||
entry({"admin","modem"},firstchild(),"Modem",30).dependent=false
|
||||
entry({"admin","modem","atc"},alias("admin","modem","atc","atcommand"),translate("AT Commands"),10).acl_depends={"luci-app-atinout-mod"}
|
||||
entry({"admin","modem","atc","atcommand"},template("modem/atcommand"),translate("AT Commands"),10)
|
||||
entry({"admin","modem","atc","atconfig"},cbi("modem/atconfig"),translate("Configuration"),20)
|
||||
entry({"admin","modem","webcmd"},call("webcmd"))
|
||||
entry({"admin","modem","atc","user_atc"},call("useratc"),nil).leaf=true
|
||||
end
|
||||
function webcmd()
|
||||
local t=e.formvalue("cmd")
|
||||
if t then
|
||||
local t=io.popen("/usr/bin/luci-app-atinout "..t:gsub("[$]","\\\$"):gsub("\"","\\\"").." 2>&1")
|
||||
local a=t:read("*a")
|
||||
t:close()
|
||||
e.write(tostring(a))
|
||||
else
|
||||
e.write_json(e.formvalue())
|
||||
end
|
||||
end
|
||||
function uussd(t)
|
||||
local e=nixio.fs.access("/etc/config/atcommands.user")and
|
||||
io.popen("cat /etc/config/atcommands.user")
|
||||
if e then
|
||||
for a in e:lines()do
|
||||
local e=a
|
||||
if e then
|
||||
t[#t+1]={
|
||||
usd=e
|
||||
}
|
||||
end
|
||||
end
|
||||
e:close()
|
||||
end
|
||||
end
|
||||
function useratc()
|
||||
local e={}
|
||||
uussd(e)
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
@@ -0,0 +1,35 @@
|
||||
local e=require"luci.util"
|
||||
local o=require"nixio.fs"
|
||||
local e=require"luci.sys"
|
||||
local e=require"luci.http"
|
||||
local e=require"luci.dispatcher"
|
||||
local e=require"luci.http"
|
||||
local e=require"luci.sys"
|
||||
local e=require"luci.model.uci".cursor()
|
||||
local n="/etc/config/atcommands.user"
|
||||
local t
|
||||
local e
|
||||
local i
|
||||
local a=nixio.fs.glob("/dev/tty[A-Z][A-Z]*")
|
||||
t=Map("atinout",translate("Atinout Configuration"),
|
||||
translate("Configuration panel for atinout."))
|
||||
e=t:section(NamedSection,'general',"atinout",""..translate("AT Commands Terminal Settings"))
|
||||
e.anonymous=true
|
||||
i=e:option(Value,"atcport",translate("AT Command Sending Port"))
|
||||
if a then
|
||||
local e
|
||||
for e in a do
|
||||
i:value(e,e)
|
||||
end
|
||||
end
|
||||
local e=e:option(TextValue,"user_atcommands",translate("User AT Commands"),translate("Each line must have the following format: 'AT Command name;AT Command'. Save to file '/etc/config/atcommands.user'."))
|
||||
e.rows=20
|
||||
e.rmempty=false
|
||||
function e.cfgvalue(e,e)
|
||||
return o.readfile(n)
|
||||
end
|
||||
function e.write(t,t,e)
|
||||
e=e:gsub("\r\n","\n")
|
||||
o.writefile(n,e)
|
||||
end
|
||||
return t
|
||||
@@ -0,0 +1,133 @@
|
||||
<%+header%>
|
||||
<!--
|
||||
This module gives some convinience to access the shell via web, in
|
||||
case that you don't have a uart console or telnet/ssh connection.
|
||||
Hua Shao <nossiac@163.com>
|
||||
-->
|
||||
<h2><%:AT Commands%></h2>
|
||||
<label><%:Web UI for sending AT Commands.%></label>
|
||||
<p></p>
|
||||
<h4><%:Sending commands to modem%></h4>
|
||||
<div class="table" width="100%">
|
||||
|
||||
<div class="tr">
|
||||
<div class="td left" width="23%"><%:User AT Commands%>:</div>
|
||||
|
||||
<div class="td left" style="width:55%;">
|
||||
<select name="ussd" id="pl" onclick="copyFunction()">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="td left" style="width:55%;"></div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="td left" style="width:23%;"><%:Command to send%>:</div>
|
||||
<div class="td left" ><input type="text" id="code" required size="20" ></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="table" width="100%">
|
||||
<div class="td left" style="width:23%;"><%:Reply%>:
|
||||
<p>
|
||||
<pre id="result" style="visibility: hidden; width:77%;"></pre></div>
|
||||
|
||||
<div class="tr cbi-rowstyle-2">
|
||||
<div class="td right"><div style="float: left;"><div class="ifacebadge"><a href="https://eko.one.pl">e1</a></div></div><input type="button" style="margin-right: 23%"; id="sendcmd" class="btn cbi-button cbi-button-neutral" value="<%:Send Command%>" /></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
window.onload = function readUSER() {
|
||||
|
||||
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "modem", "atc", "user_atc")%>', null,
|
||||
function(x, json)
|
||||
{
|
||||
select = document.getElementById('pl');
|
||||
|
||||
var count = Object.keys(json).length;
|
||||
|
||||
|
||||
for(var d=0;d<=count;d++)
|
||||
{
|
||||
var opt = document.createElement('option');
|
||||
|
||||
var s = json[d].usd;
|
||||
var fields = s.split(/;/);
|
||||
var name = fields[0];
|
||||
var code = fields[1];
|
||||
opt.text = name;
|
||||
opt.value = code.trim();
|
||||
opt.innerHTML = name;
|
||||
select.appendChild(opt);
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function copyFunction() {
|
||||
|
||||
var node = document.getElementById('result');
|
||||
node.style.visibility = 'hidden';
|
||||
|
||||
var x = document.getElementById("pl").value;
|
||||
document.getElementById("code").value = x;
|
||||
document.getElementById("result").innerHTML = "";
|
||||
}
|
||||
|
||||
|
||||
function postcmd(cmd) {
|
||||
(new XHR()).post("<%=luci.dispatcher.build_url("admin", "modem", "webcmd")%>", {"cmd":cmd}, function(x) {
|
||||
console.log(x.response)
|
||||
console.log(x)
|
||||
|
||||
var aStr = x.response;
|
||||
var myre = /(^[ \t]*\n)/gm;
|
||||
var bStr = aStr.replace(myre,"");
|
||||
|
||||
document.getElementById("result").innerHTML = bStr;
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function (ev) {var button = document.getElementById("sendcmd");
|
||||
button.addEventListener("click", function () {
|
||||
|
||||
|
||||
var s = document.getElementById("code").value;
|
||||
if ( s.length == 0 )
|
||||
{
|
||||
document.getElementById("result").innerHTML = "";
|
||||
alert("<%:Please enter a AT Command%>");
|
||||
return false;
|
||||
}
|
||||
|
||||
var cmd = document.getElementById("code");
|
||||
postcmd(cmd.value);
|
||||
cmd.value = "";
|
||||
|
||||
var node = document.getElementById('result');
|
||||
if (node.style.visibility=='visible') {
|
||||
node.style.visibility = 'hidden';
|
||||
}
|
||||
else
|
||||
node.style.visibility = 'visible'
|
||||
|
||||
return true;
|
||||
});
|
||||
}, true);
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<%+footer%>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"luci-app-atinout-mod": {
|
||||
"description": "Grant UCI and file access for luci-app-atinout-mod",
|
||||
"read": {
|
||||
"uci": [ "atinout" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "atinout" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user