Enhance 5G modem management with integrated web GUI and connection control

- Introduced a web GUI for managing 5G connections, replacing the standalone 5g-router service.
- Updated scripts to ensure exclusive access to the AT port, preventing conflicts.
- Improved troubleshooting documentation in 5G_MODEM_TROUBLESHOOTING.md, adding checks for processes using the AT port.
- Enhanced connection management in the web app, including auto-connect and detailed status APIs.
- Updated installation scripts to reflect changes in service management and dependencies.
This commit is contained in:
nearxos
2026-02-02 10:34:25 +02:00
parent 78f7ccc6db
commit 9dc35a57a2
14 changed files with 1224 additions and 115 deletions

View File

@@ -24,7 +24,11 @@ cd /tmp/Alpine_5G
# Enable community repo if needed
sed -i 's|#.*community|http://mirrors.neterra.net/alpine/v3.23/community|' /etc/apk/repositories
apk update
apk add iptables libmbim-tools qmi-utils
# Core packages
apk add iptables python3 py3-flask
pip install pyserial
# Optional: dnsmasq for LAN DHCP/DNS, speedtest-cli for speedtests
apk add dnsmasq speedtest-cli
```
@@ -42,10 +46,10 @@ chmod +x scripts/install.sh
This installs:
- `/etc/5g-router.conf` (from example edit if needed)
- `/usr/local/bin/connect-5g.sh`, `status-5g.sh`, `healthcheck-5g.sh`, etc.
- `/etc/init.d/5g-router` (OpenRC service)
- `/usr/local/share/5g-webgui/` Web GUI with integrated connection management
- `/etc/init.d/5g-webgui` (OpenRC service handles both Web GUI and 5G connection)
- `/etc/iptables/rules.v4`
- Enables `5g-router` at boot
- Enables `5g-webgui` at boot
## 4. Edit config (if needed)
@@ -58,14 +62,14 @@ Set at least:
- `APN` e.g. `internet` for CYTA
- `WAN_IF` / `LAN_IF` default `eth1` and `eth0.100` are usually correct
Optional: `FAILOVER_ENABLED=yes` and `FAILOVER_IF=eth0` to use ethernet when 5G is down.
Optional:
- `WATCHDOG_INTERVAL=60` check connection every 60s and reconnect if needed
- `FAILOVER_ENABLED=yes` and `FAILOVER_IF=eth0` to use ethernet when 5G is down
## 5. Start 5G and test
## 5. Start Web GUI (includes 5G connection)
```bash
service 5g-router start
# Or run once:
/usr/local/bin/connect-5g.sh
service 5g-webgui start
# Check status
/usr/local/bin/status-5g.sh
@@ -74,7 +78,16 @@ service 5g-router start
ping -c 3 8.8.8.8
```
## 6. Enable iptables restore at boot (if not already)
## 6. Access Web GUI
Open **http://\<device-ip\>:5000** in your browser.
- **admin** / **admin** full access
- **support** / **support** view-only + restart 5G
**Change passwords after first login!**
## 7. Enable iptables restore at boot (if not already)
```bash
rc-update add iptables-restore default
@@ -82,5 +95,22 @@ rc-update add iptables-restore default
## Done
The device will bring up 5G at boot. To restart 5G: `service 5g-router restart`.
For full docs see [README.md](../README.md) and [5G_MODEM_TROUBLESHOOTING.md](../5G_MODEM_TROUBLESHOOTING.md).
The device will bring up 5G at boot via the Web GUI service. Manage via web interface at port 5000.
To restart 5G: use the Web GUI, or `service 5g-webgui restart`.
For full docs see [README.md](../README.md), [WEBGUI.md](WEBGUI.md), and [5G_MODEM_TROUBLESHOOTING.md](../5G_MODEM_TROUBLESHOOTING.md).
---
## Legacy: Standalone 5g-router service
If you prefer to run without the Web GUI, you can still use the legacy service:
```bash
rc-update del 5g-webgui default
rc-update add 5g-router default
service 5g-router start
```
This runs `connect-5g.sh` without the web interface.