1

In systems like Alexa or Sonos, the mobile app asks for location access and from there it tries to find the device.

After that one is prompted to enter the wifi details and attach the device with the local network.

What is actually going on behind the scenes?

How does the app discover a hardware device without it first being in the network itself?

What I was doing till now was advertising a Wifi AP, which needs to be connected from the app, enter the details and reconnect back to my local network. The Pi then attempts to connect itself with my home wifi.

But how does this whole location access thing work? I would like to know the theory.

  • Ask Alexa? - sorry couldn't resist. This isn't really a question about raspberry Pi, it's a question about Alexa/Sonos. – Charemer Aug 15 '18 at 13:48
  • So I cited an example which would make it absolutely clear. I just want to know what is going behind the scenes of different Iot devices, which a Pi is, and there techniques to solve discovery and networking. I would like to study those in Pi. – arjun Aug 15 '18 at 14:02
  • it probably uses UPNP to do the device discovery and configuration (IP: 239.255.255.250 protocol: SSDP) ..... run wireshark (wireshark.org) on your computer and you will see almost all devices on your network broadcasting information to that IP address – jsotola Aug 15 '18 at 15:26
  • Well I am running a Upnp service. But that happens only after the Pi is in the network. Those devices(Sonos, Alexa) broadcast something else, which makes the discovery possible without using Wifi in the first place. Wifi is used later as I have written. Now they ask for location access to do this. I wonder how that works? – arjun Aug 15 '18 at 15:52
3

Android 6 and later needs location permission before they can see the list of access points found in the most recent scan: https://developer.android.com/reference/android/net/wifi/WifiManager#getScanResults()

Then the app can then see the names of any wifi devices that are broadcasting their SSID's. It can:

  • See all wifi SSID's that the phone can see, and their signal strengths, without connecting to any wifi network.
  • Show you this list of access points, and you can select one
  • Connect to a specific wifi network, using the SSID you chose
|improve this answer|||||
  • I already have this setup. I was not asking that. – arjun Aug 15 '18 at 15:01
  • Then please clarify your question. You asked "How does the app discover a hardware device without it first being in the network itself?", which I answered. The app can see the SSID's without connecting. – Francois Stark Aug 15 '18 at 15:20
  • Hey. So they dont use SSIDs. Because I can setup a similar one too. They ask for location access. The app finds the devices from there. Then they ask to enter the Wifi details for the device to connect. All this is happening when the device is run for the first time. – arjun Aug 15 '18 at 15:55
  • Android 6 and later needs location permission before they can see the list of access points found in the most recent scan:developer.android.com/reference/android/net/wifi/… Then the app can show you the list of available access points you can connect to. – Francois Stark Aug 15 '18 at 16:15
  • Hmmm... But those AP aren't visible in your phones Wifi manager. Are you certain this is how the device advertise? – arjun Aug 15 '18 at 22:07
0

The following was taken from an anonymous edit to Francois's answer, which was rejected


If the Access Point has a hidden SSID, as a client you can still try to connect to it if you suspect you know the SSID. This software scans wifi accesses and detects hidden SSID’s by looking at how other customers log in. However, it explains that anybody can access a hidden AP if you have the correct name: Hidden Wi-Fi Network: How to know the name of a wireless network with no SSID.

|improve this answer|||||

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