Ultra lightweight web browser for openwrt?

I am running openwrt on a router and there is one WiFi access point attached to it.
The WiFi AP is configured as dump-AP (no NAT, DCHP disabled). It's running native firmware, i.e. no openwrt on the AP.
I want to extract some information from the AP, like how many users are connected etc.
I can see those info on the AP config page which uses javascript through my browser.
Now the questions:
Is there a way to extract those values from the AP?
I can ssh to the openwrt router and from there do wget/curl on the AP config page but due to javascript it doesn't work.
So is there a browser on Openwrt which can be used?
Any other way?

That doesn't appear related to my question. Thanks for the effort though.
So basically:

PC == openwrt-router(R1) == Access-Point(AP)

My question is, since the AP doesn't support ssh/linux due to locked vendor firmware, I am wondering how to extract some info from it, programmatically.
If I had browser available on R1, I would fire it up and load the config page of AP and extract the info.
wget is not working due to no javascript support on it.
Hence my query on a browser availability.
Open for any other suggestion as well.

So you want a text based browser with javascript support that you can programmatically use to screen scrape statistics off the vendor AP... If you find out how to do that make sure to @ tag me on it, because I have never heard of such a thing and would be interested to know :wink:

Yes, you got it.
It doesn't have to be text based, just have to be light enough to fit and run on openwrt devices.

Best you can do is "screen scrape" whatever it offers through its existing management interfaces. Since this often requires pattern matching and enough memory to hold the page, something like Python running on a "desktop" might be a better match than shoehorning it into an all-in-one router. Seeing if it supports SNMP would be worthwhile as well.

1 Like

I have personally never tried to run things like javascript on an OpenWrt device. As such, I don't know if it is possible... but that aside, one reason this may not be advisable is the relatively small amount of flash storage, RAM, CPU power in many consumer routers -- it probably wouldn't run well and/or might cause other issues.

All of that said, is there a reason you don't want to run it from a standard computer or mobile device browser? You should be able to connect directly to the admin page of your AP from any normal browser. Are you trying to do something special and smart on the OpenWrt router (R1) such that the router itself needs to query the AP and take action?

R1 is remotely managed. So I was looking for an option to remotely ssh to the router and extract info from the AP.
I understand it can be done on a different PC. However it would be nice to do this without a separate PC.

I mean everything would have worked if not for this javascript thing.
A non-javascript page could have been easily fetched using wget, since I know the urls of all the pages of the AP..

Try nmap to find open ports.
It may run some telnet-like service.

One way would be to forward a certain port to the AP and access its GUI remotely. But then there are probably security concerns with that.

That makes sense. In the absence of an embedded solution, you might install a VPN into the OpenWrt router (OpenVPN or Wireguard are pretty good options). From there, you could connect to the remote network via VPN and use a web browser on your machine to connect to the AP, just like if you were natively connected to that network.

3 Likes

The first part I do anyway, i.e. ssh to the openwrt router remotely using vpn.

So in summary, the vendor firmware locked AP page can only be scraped on a different and dedicated machine (desktop or mobile), which is connected to the router's local network.

This looked like an option.
But for more than one AP this will not work, since all APs will be serving their page on same standard http port, which cannot be changed because of locked firmware.

Does this vpn allow you access to other devices on the remote lan, or just to the OpenWrt router itself. There is no reason why you shouldn’t be able to access the APs remotely if general LAN access is available - the AP would see your browser as a local device even though you’re working over a vpn.

The javascript probably pulls the status information from the AP as JSON from another URL. You can use wget directly on the status URL, then parse the JSON.

3 Likes

It sure can work. On Openwrt you assign forwarding from different ports (say 13201, 13202, 13203) to the different IPs of the APs (say 192.168.1.101, 192.168.1.102, 192.168.1.103) on whatever port they are expecting (most probably 80 or 443).

Though, this exposes you APs to Internet, so I'm not sure that you would like to do it.

1 Like

Just to the OpenWrt router itself.

Do you have the ability to change the vpn configuration to allow access to the aps?

I don't know.
What I know is that I want to avoid forcing lan devices to access internet through a vpn.
So I haven't looked at going full fledged vpn as an option.

If you don't need to fetch the data from AP to OpenWrt exactly, there's no point to complicate the task, just set up the routing properly.