2

I have added a device to my boiler which allows temperature control through a mobile app. In order to connect it to the WiFi network I just followed the manual:

  1. install the app, ensure you are connected to the local WiFi
  2. push the button on the device so that blue led is blinking
  3. scan device QR code

This connects the device to my app and I can provide the SSID and password. I’ m wondering how can the app communicate with the device upload credentials if it is not yet on the network. I assume the QR is somehow related to the MAC address but I don’t get how the device can receive data without having acquired any IP.

Does it have something to do with uPnP?

Alex Ljamin
  • 1,083

1 Answers1

2

I assume the QR is somewhat related to the MAC address but I don’t get how the device can receive data without having acquired any IP... Does it have something to do with UPnP?

Vitoconnect 100:

enter image description here

Good question!

  • The crux of this is how is your smart device able to receive the WiFi information that you enter in the app before it's connected to the router? This would appear to be a catch-22 situation: the smart device surely needs to be on the network in order to receive the WiFi setup information, yet it needs the WiFi setup information in order to connect to the network.

  • Firstly, what's happening has nothing to do with UPnP, not least because UPnP doesn't come into play until a device is already on the network.

  • The same goes for MAC address information: that wouldn't explain how the app is able to communicate with the device before the device is connected to the router.

  • By definition, this initial setup information can't be going through your router, so infrastructure mode (i.e. communication through the router) can be ruled out.

  • Somehow, this initial setup process completely bypasses the router.

What's going on?

Wireless ad hoc mode!

Here's what happens:

  1. You press the setup button on the smart device and the blue LED starts blinking
  2. The smart device has started to broadcast a temporary ad hoc wireless network, whose sole purpose is to receive the WiFi setup information directly from your cell phone (bypassing the router)
  3. When you then scan the QR code using your phone, the app obtains the following connection information that's embedded within it, which it then sends directly to the smart device via the temporary ad hoc network:
    • SSID
    • password
    • IP address of the smart device (to which the router access information will be transmitted)
  4. Once the app has obtained this information from the QR code, it immediately switches from infrastructure to ad hoc mode and sends the access credentials for your router directly to the smart device
  5. The smart device receives this information, before disabling its ad hoc network (the blue LED stops flashing here), and establishing a connection to the router in infrastructure mode. It is now successfully connected to the network and behaving as a typical wireless client device. Setup complete.
  6. Seeing that the temporary ad hoc network being broadcast by the smart device has now disappeared, the phone automatically reconnects to the router in infrastructure mode

    • It's theoretically possible that this initial network setup could be done via Bluetooth instead of via a wireless ad hoc connection but it would be more cost effective for the manufacturer to simply use the existing 2.4 GHz wireless radio for this purpose. WiFi also has much longer range than Bluetooth and the energy savings of Bluetooth would be insignificant for a one-time connection.

    • If you're curious, you might want to try pressing the setup button on the smart device and, instead of doing anything using the smart device's companion app, simply scan for available WiFi networks from your phone. You will most likely be able to see the temporary ad hoc network that the smart device broadcasts while its blue LED is blinking!

Mr Ethernet
  • 4,459