I would like Build a UI that views and changes settings of the router (Quectel_EC25) I want to use PHP to get Openwrt API but don't know where to start and which one I should use.
Any help and sugggestions are appreciated
Isn't that a LTE modem, not a router ?
A cellular 4G module .. hardware is Ether EC20 and EC25
So what are you looking for ?
An API for the modem, or for controlling it via Openwrt?
I need API provided by OpenWRT to read and modify settings in PHP
Here are more details:
GSI antenna:
- OS: Working with standard 23.05.0 (LTS) installation of openwrt
- Hardware: 4G module: Ether EC20/EC25 and both will work
- UI: Standard stock Luci user interface
Goal: Build an UI for the customer:
- What the UI should be able to do:
- View and change settings of: (1) LTE (2) Wifi (3) WAN, LAN network parameters
- Manage 2 users: admin and guest
- Technology
PHP
PHP is probably too big for most routers, hence not used/implemented.
But it's an open source project, so I guess you could create the API yourself.
Are you running the PHP server on the device being controlled or is it running on a different device?
As far as an "OpenWrt API" is concerned, the closest thing is the JSON-RPC interface that LuCI uses to communicate with the device. The wiki has an example of starting an RPC session and making ubus calls with it. Also see this LuCI how-to guide.
Note that all those calls are made over HTTP (not HTTPS). If you don't want plaintext sent over a network you either need to use SSH port forwarding, enable TLS on uhttpd, or create a Wireguard VPN interface specifically for management.
Thanks for response and I appreciate your help
I'll be running the PHP server on different device, I'll be working remotely with the hardware since the antenna could be accessed via web interface and ssh.
You might certainly like my newest OpenWRT php API client at :
The Openwrt specific module is at :
HTH