crossbario / autobahn-c

Apache License 2.0
14 stars 5 forks source link

Wifi configuration and first boot #10

Open oberstet opened 7 years ago

oberstet commented 7 years ago

When a user button connected to the ESP32 is pressed while the device is powered up, the device is entering "configuration mode".

When the device starts in "configuration mode", it will start the Wifi as an AP. The user will then connect to the ESP32 Wifi (which is acting as a Wifi AP accepting the Wifi connection coming in from the users smartphone) from an app. The app is a configuration tool we may provide, and which will upload the target Wifi configuration, as well as download the device public key.

The app then disconnects from the ESP32 Wifi, reconnects the users smartphone to the Internet, logs into a service and pairs the ESP32 device public key with the respective router and other configuration.

Before disconnecting, the smartphone app will send a "reboot" command to the ESP32, and the next boot cycle the ESP32 comes up, it will configure the Wifi for client mode, and connect to the Wifi the user has previsouly configured.

The different states and results that happen during above Wifi and device pairing process is display using different colors and intensity patterns ofa user RGB LED connected to the ESP32.

Hence, above scheme requires the following hardware connected to the ESP32:

  1. a button
  2. a RGB LED
oberstet commented 7 years ago

I think the perfect demo of this would look like this:

  1. a recipe that describes a hardware setup consisting of a ESP32 dev board, a breadboard, 2 x LED (monochrome) and 2 x button.
  2. the LEDs and buttons are connected to some of the ESP32 GPIOs
  3. a firmware to be flashed

When the firmware boots, it will run through the Wifi and device pairing process as described above. When the device then boots and successfully connects to the configured Wifi and authenticates to the configured upstream Crossbar.io router, it will register procedures and publish events exposing the second LED and the second button. The first LED and button are always user for displaying and accessing configuration mode.