Ultra lightweight web browser for openwrt?

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.

Setting up a VPN server/peer on your router will not inherently force all internet traffic through the tunnel. @vgaetera provided a link to VPN PBR, but you probably don't even need that. Since you're really enabling remote access to the network from outside, the LAN traffic will not be affected (this is quite different than when you are configuring your router to utilize a remote VPN for outgoing traffic).

If your VPN is configured on the OpenWrt router, you can ask for help here in these forums -- I'd recommend starting a new thread to address questions like that since it isn't related to this specific thread.

2 Likes

@Hegabo I gave this a try but the AP page doesn't load.
To verify if my port forwarding is correct, I added a desktop in the lan with apache test page. Setup the forward rule on a different source port and it worked.
I also verified through tcpdump that requests are getting forwarded in the router to the lan port.
Looks like no response from the AP.
Is the AP dropping these packets due to it's firewall or something?
It's a normal consumer grade router; with dhcp disabled and a static lan IP.
Any idea why it wouldn't work?

Either firewall, or AP has no route to VPN-network/internet.

1 Like