3

I am trying to replicate the sonoff Quick Pairing Mode in Swift. My question is: how does eWeLink transmits data between the phone and the esp8266 inside the Sonoff without using Bluetooth?

As I know you can’t access to another Wi-Fi in iOS from code automatically. So how eWeLink do it?

SquareInc
  • 61
  • 3
  • the device starts a WiFi access point – Juraj Dec 07 '20 at 15:41
  • Yes, the device start an AP, but how the iOS app connects to it? – SquareInc Dec 07 '20 at 15:50
  • I guess, the app knows the SSID and the password – Juraj Dec 07 '20 at 15:52
  • Yes, they know the SSD and the password but as I know you can't connect to multiple WiFi at the same moment in iOS. – SquareInc Dec 08 '20 at 12:07
  • disconnect, connect, send ssid and pass, reconnect? – Juraj Dec 08 '20 at 20:43
  • no. No changes are made to the current wifi connection. My iPhone remains connected to my wifi while eWeLink communicates some informations to the module – SquareInc Dec 12 '20 at 10:51
  • I was searching this and found two situations, so, I don't am sure, but make sense: there are two ways: compatible mode (old) by AP connection and the current, who the sonoff send the connection data by broadcast in the current network, the device will connect In each network and waiting for this message ( this messages don't are encrypted). – rodrigo Jun 21 '21 at 22:32

1 Answers1

0

The Sonoff device is based on the Espressif boards. It uses a SoC(System on Chip) called as ESP8266 (or similar).

These boards have a feature called as Smart Config. Its documented here by the manufacturer of the chip. https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/network/esp_smartconfig.html

In a nut shell, what happens is that the mobile App broadcasts the SSID and the password in an encrypted format. The device is capable of sniffing this data and use it to configure the wifi.