I would like to have the following setup:
- A raspberry running RaspAp and a flask application
- Another arbitrary device, connected to the raspberry via WLAN
- (When connecting, the device should recognize that this is not a wireless connection for internet but rather only this local website, if possible)
- A Browser on said device that can reach the flask app via a domain name given by me.
At the moment, it almost works: I can reach it on my win 10 machine under http://raspberrypi/ but i don't know how to change the name. On my Phone it only works via http://raspberrypi.local/ and on the phone of my teacher, neither. (Both phones are samsung android and we tried it via chrome). The Phones also assume that this should be an internet connection, even though that's not my intent, can RaspAp "tell" the phone that this is normal behaviour?
Just changing the dnsmasq.conf properties like shown here: https://www.youtube.com/watch?v=cxaAiBVGf7s&ab_channel=RaspberryTips does absolutly nothing. When i put invalid options in though and syntax check, it verifies that it loads the file.
How would I approach this problem?
On Raspberry Pi OS, multicast DNS is supported by the Avahi daemon. Avahi facilitates service discovery on a local network via the mDNS protocol. This lets you connect a Pi to your network and access it by its hostname. Check its status like so:
Above we see that both the
wlan0andeth0interfaces have their IPv4 addresses registered with the defaultraspberrypihostname.10.3.141.1is the static IPv4 address created by RaspAP for the wireless interface.If your device supports mDNS, you can reach your Raspberry Pi by using its hostname and the
.localsuffix. Windows 10 has mDNS support built in, which explains why you're able to access it. It's also available for Windows by installing Apple's iTunes or the Bonjour service. Android has had support for Bonjour/mDNS for quite awhile, but this doesn't necessarily mean that it will work with a browser on your phone. In this case, you'll need to discover your Pi's IP address and use that.You can change the default
raspberrypihostname by editing these files:Reboot your device for the changes to take effect.
Mobile devices handle this in various ways. Some will connect to a wireless AP and report "Connected without internet" or similar. This shouldn't prevent you from accessing a local website served by the device, though. For your application, one way to handle this would be to install a captive portal. This way, the moment a device connects to the AP you can redirect it to your Flask app.
See https://docs.raspap.com/captive/ for an example of how to do this. If you need more granular control take a look at openNDS.
Source: developer of RaspAP