Add web GUI, docs, scripts, and 5G router config

- Web app (Flask): status, config, firewall, logs, users, restart
- Docs: AT commands, deploy, DNS, quickstart, web GUI
- Scripts: connect, deploy, diag, healthcheck, modem-status, speedtest, status, troubleshoot
- Init and iptables: 5g-router, 5g-webgui, rules.v4
- CHANGELOG, TODO, REVISION; config and README updates
This commit is contained in:
nearxos
2026-02-02 09:38:23 +02:00
parent 1136a332b5
commit 160ad641ce
46 changed files with 4320 additions and 40 deletions

View File

@@ -10,9 +10,14 @@ The 5G modem is fully operational with CYTA Cyprus SIM card.
| File | Description |
|------|-------------|
| [README.md](README.md) | This file - overview and quick start |
| [5G_MODEM_TROUBLESHOOTING.md](5G_MODEM_TROUBLESHOOTING.md) | Complete modem configuration reference |
| [configure_fm350_5g.sh](configure_fm350_5g.sh) | Configuration script for the modem |
| [README.md](README.md) | This file overview and reference |
| [docs/QUICKSTART.md](docs/QUICKSTART.md) | **Quick start** clone → install script → config → start |
| [docs/DEPLOY.md](docs/DEPLOY.md) | First-time SSH and key-based deploy |
| [docs/DNS.md](docs/DNS.md) | DNS (resolv.conf, dnsmasq) for router and LAN |
| [5G_MODEM_TROUBLESHOOTING.md](5G_MODEM_TROUBLESHOOTING.md) | Modem AT commands and troubleshooting |
| [configure_fm350_5g.sh](configure_fm350_5g.sh) | Manual configuration script (uses `/etc/5g-router.conf`) |
| [CHANGELOG.md](CHANGELOG.md) | Version and feature notes |
| [docs/WEBGUI.md](docs/WEBGUI.md) | Web GUI login (admin/support), permissions, install |
## Hardware
@@ -42,7 +47,21 @@ Internet (CYTA 5G)
LAN Clients
```
## Quick Start
## Quick Start (new device)
For a **single-command flow** from a fresh device, see **[docs/QUICKSTART.md](docs/QUICKSTART.md)**. Summary:
1. Clone or copy this repo to the device.
2. Install packages: `apk add iptables libmbim-tools qmi-utils` (and optionally dnsmasq, speedtest-cli).
3. Run **`./scripts/install.sh`** installs scripts, OpenRC service, firewall rules, and `/etc/5g-router.conf`.
4. Edit `/etc/5g-router.conf` if needed (APN, interfaces).
5. Start: `service 5g-router start` or `/usr/local/bin/connect-5g.sh`.
For SSH and key setup: **[docs/DEPLOY.md](docs/DEPLOY.md)**.
---
## Manual Quick Start (step-by-step)
### 1. Install Required Packages
@@ -154,20 +173,35 @@ rc-status
# - 5g-router (connection script)
```
## Files on Device
## Files on Device (after install)
| Path | Purpose |
|------|---------|
| `/usr/local/bin/connect-5g.sh` | Startup connection script |
| `/etc/5g-router.conf` | Config (APN, interfaces, failover, watchdog) from repo `etc/5g-router.conf.example` |
| `/usr/local/bin/connect-5g.sh` | Connection script (run by service or manually) |
| `/usr/local/bin/status-5g.sh` | Status (modem, interface, route, last speedtest) |
| `/usr/local/bin/healthcheck-5g.sh` | Health check for monitoring (exit 0/1) |
| `/usr/local/bin/speedtest-5g.sh` | Optional speedtest cron target |
| `/usr/local/bin/rotate-5g-log.sh` | Optional log rotation for 5g-router.log |
| `/etc/init.d/5g-router` | OpenRC service |
| `/etc/init.d/iptables-restore` | Firewall restore service |
| `/etc/iptables/rules.v4` | Saved firewall rules |
| `/etc/dnsmasq.conf` | DHCP configuration |
| `/etc/network/interfaces` | Network configuration |
| `/etc/iptables/rules.v4` | Saved firewall rules (from repo `etc/iptables/rules.v4`) |
| `/etc/dnsmasq.conf` | DHCP configuration (if using dnsmasq) |
| `/var/log/5g-router.log` | Connection log |
| `/var/log/speedtest-5g.log` | Optional speedtest log |
## Troubleshooting
### Modem not up (WAN down, no IP)
**On the device**, run the modem/WAN diagnostic:
```bash
/usr/local/bin/diag-modem-up.sh
```
It reports service status, modem USB (Mode 40 vs 41), WAN interface state, AT port, last log lines, and suggested fixes. See [docs/WEBGUI.md](docs/WEBGUI.md) → Troubleshooting: Modem not up.
### Modem not responding to AT commands
1. Check modem is in Mode 40: `lsusb | grep 7126`
@@ -193,20 +227,31 @@ service 5g-router restart
## Verification Commands
```bash
# Check modem
lsusb | grep -i fibocom
# Status script (modem, interface, default route, last speedtest)
/usr/local/bin/status-5g.sh
/usr/local/bin/status-5g.sh --json
# Check network
# Diagnostics (run on device to debug modem/WAN or AT port)
/usr/local/bin/diag-modem-up.sh # why modem not up
/usr/local/bin/diag-at-port.sh # why no AT data in Web GUI
# Health check (for Nagios / Uptime Kuma)
/usr/local/bin/healthcheck-5g.sh
# Manual checks
lsusb | grep -i fibocom
ip addr show eth1
ip route show
# Test connectivity
ping -c 3 8.8.8.8
ping -c 3 google.com
# Check NAT rules
iptables -t nat -L -n -v
# View logs
tail -f /var/log/5g-router.log
```
## Optional: scheduled speedtest and log rotation
```bash
# Cron: speedtest every 6 hours, log rotation daily
# Add to crontab -e (root):
# 0 */6 * * * /usr/local/bin/speedtest-5g.sh
# 0 3 * * * /usr/local/bin/rotate-5g-log.sh
```