This commit is contained in:
2025-12-23 10:39:56 -08:00
parent 8c9603fa43
commit 7f00704ff3
12 changed files with 97 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
```bash
cat > /etc/banner <<"EOF"
██████╗ ██████╗ ███████╗ ███████╗
██╔══██╗ ██╔═████╗ ██╔════╝ ██╔════╝
██████╔╝ ██║██╔██║ ███████╗ ███████╗
██╔══██╗ ████╔╝██║ ╚════██║ ╚════██║
██████╔╝ ╚██████╔╝ ███████║ ███████║
╚═════╝ ╚═════╝ ╚══════╝ ╚══════╝
██ ██ █████╗ ████████╗████████╗
██ ██ ██╔══██╗╚══██╔══╝╚══██╔══╝
██ █ ██ ███████║ ██║ ██║
██ ███ ██ ██╔══██║ ██║ ██║
╚███╔███╔╝██║ ██║ ██║ ██║
╚══╝╚══╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
OpenWRT 24.10.5 - Boss Watt Rev 0.2: UNTETHERING LIBERTY
EOF

View File

@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org/>

View File

@@ -0,0 +1,49 @@
# USB Audio Drivers for GL-XE300 with OpenWRT 24.10.0
## ALSA Userland Tools
These give you the aplay, alsamixer, and basic testing commands. USB audio support was confirmed with a C-Media USB DAC (class-compliant).
opkg install alsa-utils
aplay play WAV files
alsamixer mixer for volume control (if supported)
speaker-test generate test tones
## Kernel Modules for Audio Support
These allow the kernel to actually see and use the USB audio device:
opkg install kmod-sound-core
opkg install kmod-usb-audio
Make sure both were installed — they enable:
ALSA sound subsystem (snd)
USB audio class driver (snd-usb-audio)
Check module status:
lsmod | grep snd
## Other Notes
opkg install usbutils
lsusb
lsusb -v
Assuming your files live in /root/wav/:
WAV (Raw PCM):
aplay --buffer-time=200000 --period-time=10000 -D plughw:0,0 /root/wav/test.wav
MP3:
mpg123 -a plughw:0,0 /root/wav/test.mp3
## Install Commands
```bash
opkg update && opkg install alsa-utils kmod-sound-core kmod-usb-audio mpg123 madplay timidity usbutils

View File

@@ -0,0 +1,97 @@
# OpenWRT 24.10.0 Extroot on XE-300
## 1. Insert card & install required packages
opkg update
opkg install block-mount kmod-fs-ext4 kmod-usb-storage e2fsprogs
block-mount - block info, fstab handling, extroot logic
kmod-fs-ext4 - kernel driver for ext4 filesystem
kmod-usb-storage - makes the SD slot show up as /dev/sda
e2fsprogs - provides mkfs.ext4
## 2. Confirm the SD card is /dev/sda and /dev/sda1
Check dmesg:
dmesg | grep -i sd
Sample Output:
sd 0:0:0:0: [sda] 1000005632 512-byte logical blocks: (512 GB/477 GiB)
sda: sda1
sd 0:0:0:0: [sda] Attached SCSI removable disk
## 3. Format /dev/sda1 as ext4 for extroot
mkfs.ext4 -L extroot /dev/sda1
You should see output ending with success and a UUID.
## 4. Grab the UUID and create the extroot fstab entry
UUID=$(block info | awk -F\" '/sda1/ {print $2}')
echo $UUID
Sample UUID output:
4851f00e-696b-47d3-a529-82c2aca292db
Now write the minimal extroot config using uci:
uci set fstab.extroot="mount"
uci set fstab.extroot.uuid="$UUID"
uci set fstab.extroot.target="/overlay"
uci set fstab.extroot.fstype="ext4"
uci set fstab.extroot.enabled="1"
uci commit fstab
Sanity-check the file:
cat /etc/config/fstab
Sample output:
config global
option anon_swap '0'
option anon_mount '0'
option auto_swap '1'
option auto_mount '1'
option delay_root '5'
option check_fs '0'
config mount 'extroot'
option uuid '4851f00e-696b-47d3-a529-82c2aca292db'
option target '/overlay'
option fstype 'ext4'
option enabled '1'
## 5. Reboot into extroot
reboot
Wait for the router to come back up, then SSH in again.
## 6. Verify that the SD card is now your root overlay
df -h
Expected output:
Filesystem Size Used Available Use% Mounted on
/dev/root 4.0M 4.0M 0 100% /rom
tmpfs 58.7M 200.0K 58.5M 0% /tmp
/dev/sda1 468.3G 2.1M 444.4G 0% /overlay
overlayfs:/overlay 468.3G 2.1M 444.4G 0% /
Explanation:
/dev/root at /rom → read-only squashfs from flash
/dev/sda1 at /overlay → SD card is the writable layer
overlayfs:/overlay on / → full rootfs = ROM + SD overlay
You now have a 468 GB OpenWrt box.
No /rwm mount
No copy of internal overlay
This is a clean, SD-only overlay setup.

View File

@@ -0,0 +1,47 @@
# OpenWRT 24.10.4 Firmware with GPIO I²C for GL.iNet XE300
Custom OpenWRT build enabling **GPIO-based I²C master** on the XE300 using `i2c-gpio` driver and clean DTS integration.
## Locate & Edit DTS
target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts
git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git checkout v24.10.4
./scripts/feeds update -a
./scripts/feeds install -a
## Menu Config
Target System: Atheros ATH79
Target Profile: GL.iNet GL-XE300
Kernel Modules → I2C Support:
kmod-i2c-core
kmod-i2c-gpio
Utilities → i2c-tools
make -j$(nproc)
## Test It
ls /dev/i2c-*
i2cdetect -y 0
cat /sys/kernel/debug/gpio
i2cdump -y 0 0x48 # Adjust address accordingly
## Notes
- ✅ If you connect the resistors after boot, bus works great (ADS1115 detected at 0x48).
- ✅ Reboots are fine — problem only occurs on cold boot / full power cycle.
- ✅ The ADS1115 can be powered before boot or after — no issue.
- ❌ The presence of 3.3V on SDA/SCL at boot causes the SoC to hang.
Ubuntu 22.04+ build tools:
```bash
sudo apt update && sudo apt install -y \
build-essential clang flex bison g++ gawk gcc-multilib \
g++-multilib gettext libncurses-dev libssl-dev python3 \
python3-pip rsync unzip zlib1g-dev file wget git

View File

@@ -0,0 +1,194 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca953x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
compatible = "glinet,gl-xe300", "qca,qca9531";
model = "GL.iNet GL-XE300";
aliases {
label-mac-device = &eth0;
};
gpio-export {
compatible = "gpio-export";
gpio_lte_power {
gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
gpio-export,name = "lte_power";
gpio-export,output = <1>;
};
gpio_sd_detect {
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
gpio-export,name = "sd_detect";
gpio-export,output = <0>;
};
};
keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&jtag_disable_pins>;
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
};
};
leds {
compatible = "gpio-leds";
lan {
gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
function = LED_FUNCTION_LAN;
color = <LED_COLOR_ID_GREEN>;
};
wan {
gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
function = LED_FUNCTION_WAN;
color = <LED_COLOR_ID_GREEN>;
};
wlan {
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
function = LED_FUNCTION_WLAN;
color = <LED_COLOR_ID_GREEN>;
linux,default-trigger = "phy0tpt";
};
lte {
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
label = "green:lte";
};
};
i2c_gpio: i2c@0 {
compatible = "i2c-gpio";
gpios = <&gpio 15 GPIO_ACTIVE_HIGH
&gpio 4 GPIO_ACTIVE_HIGH>;
i2c-gpio,delay-us = <5>;
i2c-gpio,timeout-ms = <100>;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
};
};
&pcie0 {
status = "okay";
};
&usb0 {
status = "okay";
};
&usb_phy {
status = "okay";
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <25000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x40000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x40000 0x10000>;
};
partition@50000 {
label = "art";
reg = <0x50000 0x10000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
macaddr_art_0: macaddr@0 {
compatible = "mac-base";
reg = <0x0 0x6>;
#nvmem-cell-cells = <1>;
};
cal_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
};
};
partition@60000 {
label = "kernel";
reg = <0x60000 0x400000>;
};
partition@460000 {
label = "nor_reserved";
reg = <0x460000 0xba0000>;
};
};
};
flash@1 {
compatible = "spi-nand";
reg = <1>;
spi-max-frequency = <25000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "ubi";
reg = <0x0 0x8000000>;
};
};
};
};
&eth0 {
status = "okay";
phy-handle = <&swphy4>;
nvmem-cells = <&macaddr_art_0 0>;
nvmem-cell-names = "mac-address";
};
&eth1 {
nvmem-cells = <&macaddr_art_0 1>;
nvmem-cell-names = "mac-address";
};
&wmac {
status = "okay";
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
};

View File

@@ -0,0 +1,41 @@
# LTE Recovery Script for GL-XE300_V1.0 Router Board
This script resets and brings up a Quectel EP06-A LTE modem using `uqmi`.
## What It Does
- Kills stuck `uqmi` processes
- Stops the active PDP session (with timeout)
- Blanks and restores the APN
- Forces `raw_ip=Y` mode
- Brings interface down and up cleanly
- Confirms WAN is working (IP + route + ping)
## Why I Made This
Most LTE recovery tools are locked behind vendor-specific web GUIs.
This script is built for **OpenWRT 24.10.0** and is intended for users running **command-line only** with no GUI.
Use cases include:
- Deployments where modem control must be done over shell
- Cron-based or watchdog-based recovery without manual intervention
- Off-grid or solar-powered systems where the LTE radio is **only active at certain times of day**
If you're running raw OpenWRT and want reliable LTE recovery on CLI, this is for you.
## Requirements
System must be flashed to **OpenWRT 24.10.0** with the **Quectel EP06-A** modem installed.
Assumes modem interface is named `wwan` and located at `/dev/cdc-wdm0`.
The script uses an APN of `mobile`, which is valid for **EIOT Club SIM cards** as of this commit.
This SIM was selected for its plug-and-play compatibility with OpenWRT and `uqmi`, requiring no manual registration or configuration.
Assumes WAN port has internet access during the first run so the required packages can be installed.
Install required packages:
```bash
opkg update && opkg install uqmi ip-full iputils-ping uci

View File

@@ -0,0 +1,178 @@
#!/bin/sh
# ✅ Function: Check if we have a usable WAN link
wait_for_data_connection() {
echo "[RAIDBOT] ⏳ Waiting for usable WAN link (IP + route)..."
for i in $(seq 1 20); do
IP=$(ip -4 -o addr show dev wwan0 | awk '{print $4}')
if [ -n "$IP" ]; then
if ip r | grep -q "default via"; then
if ip route get 8.8.8.8 2>/dev/null | grep -q "dev wwan0"; then
echo "[RAIDBOT] ✅ WAN is up. IP: $IP"
return 0
fi
fi
fi
echo "[RAIDBOT] ...not ready yet ($i/20)"
sleep 2
done
echo "[RAIDBOT] ❌ Timed out waiting for usable link."
return 1
}
# ✅ Function: Wait until the interface is truly down
wait_for_down() {
echo "[RAIDBOT] ⏳ Waiting for wwan0 to go down..."
for i in $(seq 1 10); do
ip a show dev wwan0 | grep -q "inet " || {
echo "[RAIDBOT] ✅ Interface down confirmed."
return 0
}
sleep 3
done
echo "[RAIDBOT] ⚠️ Interface may still be up."
return 1
}
# ✅ Function: Wait until modem detaches from PDP session
wait_for_detach() {
echo "[RAIDBOT] ⏳ Waiting for modem to detach from network..."
for i in $(seq 1 10); do
STATUS=$(uqmi -d /dev/cdc-wdm0 --get-data-status 2>/dev/null | grep '"connected"' || true)
if [ -z "$STATUS" ]; then
echo "[RAIDBOT] ✅ Modem detached from PDP session."
return 0
fi
echo "[RAIDBOT] ...still attached ($i/10)"
sleep 2
done
echo "[RAIDBOT] ⚠️ Timed out waiting for modem to detach."
return 1
}
# ✅ Function: Hang-proof stop-network
safe_stop_network() {
STATUS=$(uqmi -d /dev/cdc-wdm0 --get-data-status 2>/dev/null | grep '"connected"' || true)
if [ -z "$STATUS" ]; then
echo "[RAIDBOT] ⚠️ Modem already disconnected — skipping stop-network."
return 0
fi
echo "[RAIDBOT] 🔻 Issuing stop-network with timeout guard..."
(
uqmi -d /dev/cdc-wdm0 --stop-network 0xffffffff --autoconnect
) &
STOP_PID=$!
for i in $(seq 1 10); do
if ! kill -0 $STOP_PID 2>/dev/null; then
echo "[RAIDBOT] ✅ stop-network completed (in ${i}s)"
wait_for_detach
return 0
fi
echo "[RAIDBOT] ...waiting for stop-network to finish ($i/10)"
sleep 1
done
echo "[RAIDBOT] ❌ stop-network hung — killing process..."
kill -9 $STOP_PID 2>/dev/null
wait $STOP_PID 2>/dev/null
echo "[RAIDBOT] ⚠️ stop-network force killed — skipping wait_for_detach."
return 1
}
# ✅ Function: Kill stuck uqmi and verify
kill_uqmi_safely() {
echo "[RAIDBOT] 🔪 Killing any stuck uqmi processes..."
killall -9 uqmi 2>/dev/null
for i in $(seq 1 5); do
if ! pgrep uqmi >/dev/null; then
echo "[RAIDBOT] ✅ uqmi process gone."
return 0
fi
echo "[RAIDBOT] ...still cleaning up ($i/5)"
sleep 1
done
echo "[RAIDBOT] ⚠️ uqmi process may still be running!"
return 1
}
# ✅ Function: Set APN and confirm it
set_apn_and_confirm() {
local apn_value="$1"
echo "[RAIDBOT] 📡 Setting APN to '$apn_value'..."
uci set network.wwan.apn="$apn_value"
uci commit network
for i in $(seq 1 5); do
CURRENT_APN=$(uci get network.wwan.apn 2>/dev/null)
if [ "$CURRENT_APN" = "$apn_value" ]; then
echo "[RAIDBOT] ✅ APN is now '$CURRENT_APN'."
return 0
fi
echo "[RAIDBOT] ...verifying APN ($i/5)"
sleep 1
done
echo "[RAIDBOT] ⚠️ APN setting failed (wanted '$apn_value', got '$CURRENT_APN')."
return 1
}
# ✅ Function: Set raw_ip=Y and confirm it
set_raw_ip_mode() {
echo "[RAIDBOT] ⚙️ Setting raw_ip=Y..."
echo Y > /sys/class/net/wwan0/qmi/raw_ip
for i in $(seq 1 5); do
RAW=$(cat /sys/class/net/wwan0/qmi/raw_ip 2>/dev/null || echo "unknown")
if [ "$RAW" = "Y" ]; then
echo "[RAIDBOT] ✅ raw_ip confirmed as 'Y'."
return 0
fi
echo "[RAIDBOT] ...verifying raw_ip ($i/5)"
sleep 1
done
echo "[RAIDBOT] ⚠️ raw_ip mode failed to set (still '$RAW')."
return 1
}
# --- Recovery Sequence Begins ---
kill_uqmi_safely
safe_stop_network
set_apn_and_confirm ''
set_raw_ip_mode
echo "[RAIDBOT] 🛑 ifdown wwan (blank run)..."
ifdown wwan
wait_for_down
echo "[RAIDBOT] 🚀 Bringing up blank APN..."
ifup wwan
if wait_for_data_connection; then
echo "[RAIDBOT] 🔻 Re-stopping PDP (post-blank)..."
safe_stop_network
else
echo "[RAIDBOT] ⚠️ Skipping post-blank PDP stop — WAN never came up."
fi
set_apn_and_confirm 'mobile'
set_raw_ip_mode
echo "[RAIDBOT] 🛑 ifdown wwan (real APN)..."
ifdown wwan
wait_for_down
echo "[RAIDBOT] 🚀 Bringing up real APN (mobile)..."
ifup wwan
if ! wait_for_data_connection; then
echo "[RAIDBOT] ❌ Final APN bring-up failed — WAN still unreachable."
exit 1
fi
echo "[RAIDBOT] 🌐 Final ping test..."
ping -c3 8.8.8.8

View File

@@ -0,0 +1,79 @@
# USB Wi-Fi Adapter Setup (MediaTek MT7612U) for GL-XE300 with OpenWRT 24.10.0
## Step 1: Detect USB Adapter
lsusb
Expected:
0e8d:7612 MediaTek Inc. Wireless
## Step 2: Confirm Driver Loads
dmesg | tail -n 50
Expected:
mt76x2u ... Firmware Version: 0.0.00
ieee80211 phy3: Selected rate control algorithm 'minstrel_ht'
## Step 3: Generate and Edit Wireless Config
wifi config
Replace /etc/config/wireless with:
config wifi-device 'radio0'
option type 'mac80211'
option path 'platform/ahb/18100000.wmac'
option band '2g'
option channel '1'
option htmode 'HT20'
option disabled '0'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'
config wifi-device 'radio1'
option type 'mac80211'
option path 'platform/ahb/1b000000.usb/usb1/1-1/1-1.3/1-1.3:1.0'
option band '5g'
option channel '36'
option htmode 'VHT80'
option disabled '0'
config wifi-iface 'default_radio1'
option device 'radio1'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt-5G'
option encryption 'none'
## Step 4: Bring Up Wireless
wifi down
wifi up
iw dev
Example Output:
Interface phy3-ap0
ssid OpenWrt-5G
channel 40 (5200 MHz), width: 80 MHz
Interface phy0-ap0
ssid OpenWrt
channel 1 (2412 MHz), width: 20 MHz
You now have both the internal 2.4GHz and external USB 5GHz radios running together in AP mode.
## Install Commands
```bash
opkg update && opkg install \
kmod-mt76x2u mt76x2u-firmware usbutils