Skip to content

Commit 37bed71

Browse files
authored
Merge pull request #12 from hkfuertes/cosmetics
- Added LuCI RPC Api - Changed `eth0` for `br-lan` in overview page. - Removed `eth0` from `br-lan` as its not present in this device. - Fixed `usb0` being multiple added to `br-lan`.
2 parents 452f07a + 7f678a7 commit 37bed71

File tree

4 files changed

+90
-86
lines changed

4 files changed

+90
-86
lines changed

diffconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ CONFIG_PACKAGE_libfdisk=y
3030
CONFIG_PACKAGE_libffi=y
3131
CONFIG_PACKAGE_libiwinfo=y
3232
CONFIG_PACKAGE_libiwinfo-data=y
33+
CONFIG_PACKAGE_liblua=y
3334
CONFIG_PACKAGE_liblucihttp=y
35+
CONFIG_PACKAGE_liblucihttp-lua=y
3436
CONFIG_PACKAGE_liblucihttp-ucode=y
3537
CONFIG_PACKAGE_libmbim=y
3638
CONFIG_PACKAGE_libmount=y
@@ -39,16 +41,25 @@ CONFIG_PACKAGE_libpcre2=y
3941
CONFIG_PACKAGE_libqmi=y
4042
CONFIG_PACKAGE_libqrtr-glib=y
4143
CONFIG_PACKAGE_libreadline=y
44+
CONFIG_PACKAGE_libubus-lua=y
4245
CONFIG_PACKAGE_lsblk=y
46+
CONFIG_PACKAGE_lua=y
4347
CONFIG_PACKAGE_luci=y
4448
CONFIG_PACKAGE_luci-app-firewall=y
4549
CONFIG_PACKAGE_luci-app-package-manager=y
4650
CONFIG_PACKAGE_luci-app-usb-gadget=y
4751
CONFIG_PACKAGE_luci-base=y
52+
CONFIG_PACKAGE_luci-lib-base=y
53+
CONFIG_PACKAGE_luci-lib-ip=y
54+
CONFIG_PACKAGE_luci-lib-json=y
55+
CONFIG_PACKAGE_luci-lib-jsonc=y
56+
CONFIG_PACKAGE_luci-lib-nixio=y
4857
CONFIG_PACKAGE_luci-lib-uqr=y
4958
CONFIG_PACKAGE_luci-light=y
59+
CONFIG_PACKAGE_luci-lua-runtime=y
5060
CONFIG_PACKAGE_luci-mod-admin-full=y
5161
CONFIG_PACKAGE_luci-mod-network=y
62+
CONFIG_PACKAGE_luci-mod-rpc=y
5263
CONFIG_PACKAGE_luci-mod-status=y
5364
CONFIG_PACKAGE_luci-mod-system=y
5465
CONFIG_PACKAGE_luci-proto-ipv6=y
@@ -73,6 +84,7 @@ CONFIG_PACKAGE_terminfo=y
7384
CONFIG_PACKAGE_tune2fs=y
7485
CONFIG_PACKAGE_ucode-mod-html=y
7586
CONFIG_PACKAGE_ucode-mod-log=y
87+
CONFIG_PACKAGE_ucode-mod-lua=y
7688
CONFIG_PACKAGE_ucode-mod-math=y
7789
CONFIG_PACKAGE_uhttpd=y
7890
CONFIG_PACKAGE_uhttpd-mod-ubus=y

packages/uci-usb-gadget/files/usb-gadget.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ add_to_bridge() {
246246
local iface="$(cat "$ifname_file")"
247247
log "Adding $iface to bridge"
248248

249-
uci -q delete "network.@device[0].ports=$iface" 2>/dev/null || true
249+
# Add the inteface to bridge
250+
uci -q del_list "network.@device[0].ports=$iface" 2>/dev/null || true
250251
uci add_list "network.@device[0].ports=$iface"
251252
}
252253

@@ -407,7 +408,7 @@ teardown_gadget() {
407408
for ifname in functions/*/ifname; do
408409
if [ -f "$ifname" ]; then
409410
local iface="$(cat "$ifname")"
410-
uci -q delete "network.@device[0].ports=$iface" 2>/dev/null || true
411+
uci -q del_list "network.@device[0].ports=$iface" 2>/dev/null || true
411412
fi
412413
done
413414
uci commit network

packages/uz801-tweaks/files/uci_defaults

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ uci set network.modem.ifname='wwan0'
1616
uci del_list firewall.@zone[1].network='modem'
1717
uci add_list firewall.@zone[1].network='modem'
1818

19+
# We don't have eth0
20+
uci -q del_list "network.@device[0].ports=eth0" 2>/dev/null || true
21+
sed -i 's/"device": "eth0"/"device": "br-lan"/g' /etc/board.json
22+
1923
# Commit all changes
2024
uci commit
2125

readme.md

Lines changed: 71 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,76 @@
11
![OpenWrt logo](https://raw.githubusercontent.com/openwrt/openwrt/refs/heads/main/include/logo.png)
22

3-
OpenWrt Project is a Linux operating system targeting embedded devices. Instead
4-
of trying to create a single, static firmware, OpenWrt provides a fully
5-
writable filesystem with package management. This frees you from the
6-
application selection and configuration provided by the vendor and allows you
7-
to customize the device through the use of packages to suit any application.
8-
For developers, OpenWrt is the framework to build an application without having
9-
to build a complete firmware around it; for users this means the ability for
10-
full customization, to use the device in ways never envisioned.
11-
12-
### This repository
13-
Modern version of OpenWrt working on UZ801v3:
14-
- Modem Working
15-
- ModemManager not showing Rx/Tx in Luci
16-
- Wifi Working
17-
- USB gadget (NCM, RNDIS, MASS, ACM Shell)
18-
- Configure via [uci](packages/uci-usb-gadget/readme.md) or `luci` app.
19-
- TUN installed
20-
- Wireguard Installed
21-
- `hotplug.d` scripts to manage leds, only on/off if iface, no blinking:
22-
- On default Linux Kernel `dts`, leds are swapped!
23-
- Wifi Led: [packages/ledcontrol/files/99-modem-led](packages/ledcontrol/files/99-modem-led)
24-
- Modem Led: [packages/ledcontrol/files/99-wifi-led](packages/ledcontrol/files/99-wifi-led)
25-
- ~~Firmware is dumped on first boot from modem/persist partition:~~
26-
- ~~Uses the binaries/firmware from the own device.~~
27-
- __*This will return eventually...*__
28-
- Leaves the `luci-app-tailscale` package in `/root` ready to be installed:
29-
- It is not auto installed as it will install `tailscale` that is a heavy package and not everyone is using tailscale.
30-
- `apk add --allow-untrusted /root/luci-app-tailscale*.apk`
31-
- **SquashFS and OverlayFS**:
32-
- The image no longer uses `ext4` for rootfs, instead it uses `squashfs`.
33-
- This allows for an overlay `ext4` partition to be used and enables `firstboot` (factory reset) mechanism.
34-
35-
36-
### How to build OpenWrt
37-
Docker is required!
38-
```bash
3+
Modern OpenWrt build targeting the UZ801v3 LTE dongle with full modem and USB gadget support.
4+
5+
## Table of Contents
6+
7+
- [About OpenWrt](#about-openwrt)
8+
- [Features](#features)
9+
- [Prerequisites](#prerequisites)
10+
- [Building](#building)
11+
- [Installation](#installation)
12+
- [Flashing from OEM Firmware](#flashing-from-oem-firmware)
13+
- [Accessing Boot Modes](#accessing-boot-modes)
14+
- [Troubleshooting](#troubleshooting)
15+
- [No Network / Modem Stuck at Searching](#no-network--modem-stuck-at-searching)
16+
- [Roadmap](#roadmap)
17+
- [Credits](#credits)
18+
19+
---
20+
21+
## About OpenWrt
22+
23+
OpenWrt Project is a Linux operating system targeting embedded devices. Instead of trying to create a single, static firmware, OpenWrt provides a fully writable filesystem with package management. This frees you from the application selection and configuration provided by the vendor and allows you to customize the device through the use of packages to suit any application.
24+
25+
## Features
26+
27+
### Working Components
28+
- **Modem**: Fully functional with cellular connectivity
29+
- ModemManager Rx/Tx stats not displayed in LuCI (known issue)
30+
- **WiFi**: Complete wireless support
31+
- **USB Gadget Modes**: NCM, RNDIS, Mass Storage, ACM Shell
32+
- Configure via [UCI](packages/uci-usb-gadget/readme.md) or LuCI app
33+
- **VPN Ready**: TUN driver and WireGuard pre-installed
34+
- **LED Control**: Managed via `hotplug.d` scripts
35+
- Note: LEDs are swapped in default kernel DTS
36+
- WiFi LED: [99-modem-led](packages/ledcontrol/files/99-modem-led)
37+
- Modem LED: [99-wifi-led](packages/ledcontrol/files/99-wifi-led)
38+
39+
### Storage & Recovery
40+
- **SquashFS Root**: Compressed root filesystem
41+
- **OverlayFS**: ext4 overlay partition for user data
42+
- **Factory Reset**: `firstboot` mechanism enabled
43+
44+
### Additional Packages
45+
- **Tailscale**: LuCI app included in `/root` (manual installation required)
46+
- Install with: `apk add --allow-untrusted /root/luci-app-tailscale*.apk`
47+
- Not auto-installed to save space
48+
49+
## Prerequisites
50+
51+
- Docker installed on your system
52+
- Basic knowledge of Linux command line
53+
- For flashing: [edl tool](https://github.com/bkerler/edl)
54+
55+
## Building
56+
57+
1. Enter the build environment:
58+
```
3959
cd devenv
40-
docker compose run --rm builder # This will open bash inside a build environment
41-
cp /repo/diffconfig .config # Copies the config on to the working folder
42-
echo "# CONFIG_SIGNED_PACKAGES is not set" >> .config # Optional: Disable APK signature verification
60+
docker compose run --rm builder
61+
```
62+
63+
2. Configure and build:
64+
```
65+
cp /repo/diffconfig .config
66+
echo "# CONFIG_SIGNED_PACKAGES is not set" >> .config # Optional: disable signature verification
4367
make defconfig
4468
make -j$(nproc)
4569
```
4670

47-
### How to flash from OEM
48-
- Install `edl`: https://github.com/bkerler/edl
49-
- Put the device in `edl` mode: https://wiki.postmarketos.org/wiki/Zhihe_series_LTE_dongles_(generic-zhihe)#How_to_enter_flash_mode
50-
- Do a full backup: `edl rf backup.bin`
51-
- Run `./openwrt-msm89xx-msm8916-yiming-uz801v3-flash.sh`: The script will backup the important partitions specific for your device, will flash everything and will restore de previously saved partitions.
52-
53-
After the succesful flash if you:
54-
- Want to enter `fastboot`, just insert the device with the button pressed.
55-
- Want to enter `edl`, boot into fastboot and execute: `fastboot oem reboot-edl`.
56-
57-
### No Network/Modem Stuck at Searching
58-
59-
First, extract the contents of `modem.bin` from your firmware dump. You can do `eld r modem modem.bin`. In linux, its a simple image, you can mount it. Once you have it mounted, navigate to this directory: `image/modem_pr/mcfg/configs/mcfg_sw/generic/` and choose the folder according to your region:
60-
61-
- **APAC** - Asia Pacific
62-
- **CHINA** - China
63-
- **COMMON** - Use this if your region is not listed
64-
- **EU** - Europe
65-
- **NA** - North America
66-
- **SA** - South America
67-
- **SEA** - South East Asia
68-
69-
Once you have selected your region, you'll find folders typically representing Telcos in your area. Navigate through the appropriate folder until you locate `mcfg_sw.mbn`. If your telco is not listed, just grab a generic as it is done in this project for europe:
70-
```makefile
71-
# packages/msm8916-firmware/Makefile
72-
define Build/Compile
73-
...
74-
::image/modem_pr/mcfg/configs/mcfg_sw/generic/common/default/default/mcfg_sw.mbn $(PKG_BUILD_DIR)
75-
...
76-
endef
77-
```
71+
## Installation
7872

79-
#### To apply the fix:
80-
1. Transfer the file to your dongle: `scp -O mcfg_sw.mbn root@192.168.1.1:/lib/firmware/MCFG_SW.MBN`
81-
- **Capitalization matters!** Modem expects it to be all caps.
82-
3. Reboot the device.
73+
### Flashing from OEM Firmware
8374

8475
### Future:
8576
- Recover `msm-firmware-dumper`.
@@ -90,13 +81,9 @@ Once you have selected your region, you'll find folders typically representing T
9081
- Feed: `https://downloads.openwrt.org/snapshots/targets/msm89xx/msm8916/packages/packages.adb` has been removed from distfeeds file.
9182

9283
## Credits
93-
- @ghosthgy https://github.com/ghosthgy/openwrt-msm8916
94-
- Starting point for this project.
95-
- @lkiuyu https://github.com/lkiuyu/immortalwrt
96-
- Almost all the msm8916 folder + patches + openstick feeds.
97-
- @Mio-sha512 https://github.com/Mio-sha512/OpenStick-Builder
98-
- `usb-gadget` and `msm-firmware-loader` idea (now `msm-firmware-dumper`).
99-
- @AlienWolfX https://github.com/AlienWolfX/UZ801-USB_MODEM/wiki/Troubleshooting
100-
- For the carriers policy troubleshooting.
101-
- @gw826943555 and @asvow https://github.com/gw826943555/luci-app-tailscale
102-
- Application for controlling tailscale from luci.
84+
85+
- **[@ghosthgy](https://github.com/ghosthgy/openwrt-msm8916)** - Initial project foundation
86+
- **[@lkiuyu](https://github.com/lkiuyu/immortalwrt)** - MSM8916 support, patches, and OpenStick feeds
87+
- **[@Mio-sha512](https://github.com/Mio-sha512/OpenStick-Builder)** - USB gadget and firmware loader concepts
88+
- **[@AlienWolfX](https://github.com/AlienWolfX/UZ801-USB_MODEM/wiki/Troubleshooting)** - Carrier policy troubleshooting guide
89+
- **[@gw826943555](https://github.com/gw826943555/luci-app-tailscale) & [@asvow](https://github.com/asvow)** - Tailscale LuCI application

0 commit comments

Comments
 (0)