0

My goal is to make UI for some device, through website. Device has wifi hotspot running, user can connect to it. Then I want to do "something" that I saw in few airports but have no idea how to do it.

When I use free wifi in the airport, sometimes just after connection to hotspot, webpage was opened somehow automatically on my smartphone, and allowed me to make registration in order to use internet provided through this hotspot.

If I could do the same, it will be great for user, he will not have to enter ip address (or webserver name if I run DNS) to drive this device after connection. The usecase scenario will be: connect to hotspot and proper website will appear on device automatically.

Could you tell me how this can be achieved ?

P.S. This hotspot doesn't provide any internet connection, no masquerade, no routing, just connection to itself. It's running on embedded linux.

2

What you want is known as a captive portal. Indeed, it is not obligatory to provide a Internet connection.

However, for instance, iOS, Windows, Mac OS and Android test know generic URLs for testing out if Wifi is working, and you might have to setup that for having the wifi icon marked as healthy on the client side.

What you ask is doable, but doing it purely in Linux without installing much software involves some web server/services and DNS server/service trickery (+DCHP and hostpad).

For having an automatic web page/warning for login you need to place WISPr tags in the first page the captive port redirects the device to. The major caveat for someone not experienced on that, is the WISPr tags cannot point again to the same page, as you will have recursive requests then.

For the breadcrumbs clues on how to do it, please visit the following questions on U&L

Captive portal using Apache

Captive portal detection, popup implementation?

Getting WISPr tags from a FON authentication portal

Connecting to wifi network with captive portal login page using wpa_supplicant

Mac Unable to Connect to a Wifi Hotspot - Google Starbucks

Can I get dnsmasq to drop/reject/redirect any address queries except one?

related:

Disabling CNA in MacOS

0

You want an access-point. Depending on the hardware I assume you already have, hostapd could be a fairly standard software to drive the AP.

You want a DHCP server with a standard setup to give IPs to the clients.

You want a DNS server configured to resolve any request to your device's IP: https://serverfault.com/questions/351108/using-dnsmasq-to-resolve-all-hosts-to-the-same-address

You want a HTTP server that responds to all requests, regardless of the host the client actually asked for. Apache will do so by default (virtual host are disabled).

Of course, this will not automatically open the browser on the client's device. However if the user opens the browser, it typically tries to navigate to the default home page, which will – in your setup – show your device's page.

  • It opens, if you place there the WISPr tags. I have a demo in a freeBSD netbook doing that. that activates both the iOS and Android "automatic" login procedures. It is not that complicated once you have done it. – Rui F Ribeiro Oct 20 '18 at 9:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.