2

I am trying to build an application like Wemo App for learning purpose and I am stuck at a place. I am using ESP32 for this learning. In the future, it can be ESP8266 or any other.

In the wemo device, you first connect your mobile to your wemo device through devices AP and then open the WemoApp and then you enter the SSID and PSK of the Home router you want wemo device to connect to. And after that just press, next and voila device connects to the home network and you can control it.

I searched for OTA updates and found that you need to create a new sketch and export it into .bin file and then upload it through its browser or just through an Arduino.

Is there a way to not do all of this and directly just update the SSID and PSK through a Mobile App? Because to create and convert a sketch in .bin and then sending is complicated from a Mobile App.

I searched over this forum and found this but didn't explain how to achieve that. I am continuously searching and would love to get the knowledge from experienced.

Lucifer
  • 346
  • 1
  • 11
  • Why would you need to do an OTA update just to switch from AP to STA and set the SSID and PSK? Also, you probably want to consider using BLE rather than WiFi for the initial configuration step. See here for an example workflow. – jcaron Feb 25 '20 at 17:58
  • If I use ESP8266 then I have to use Wi-Fi. And I was searching and found only through OTA way we can update the credentials to make the device switch to the home network. I am following the Wemo Smart Switch devices and learning how they pair and set the credentials. Your workflow is awesome but chances of getting tutorials for the same are rare. I was thinking If I use "Http" then? Just pass the SSID and PSK as a parameter in the background after connecting through AP and from Mobile App. And after receiving the credentials device will restart and connect to a new network. What do you think? – Lucifer Feb 26 '20 at 05:26
  • 1
    There are sketches that already have a blueprint for this, without uploading any files. Please see my answer here: https://iot.stackexchange.com/a/4286/9008 – oh.dae.su Feb 26 '20 at 06:03
  • @oh.dae.su I read your answer and all the links within it. Wifimanager documentation is not good and This link is good but is confusing a little bit. I will try to implement this but don't know how to integrate it into Mobile App. I don't want a web-view type thing to display that configuration page in-app. When I just enter SSID and PSK and hit next in the background it should send data to the device without a page. – Lucifer Feb 26 '20 at 12:44
  • And this is complicated and doesn't expose the idea of integrating into a Mobile App or Maybe I am not understanding it. – Lucifer Feb 26 '20 at 12:45
  • And after the configuration, If I want to send and receive data from the device then How will I do it? Like receiving DHT11 data. I didn't understand that MQTT broker flow. That HTTP way, can it be created without an index page just URL thing and which I can use to pass the parameter and just simply fetch the data and store it in SSID and PSK variable and check If I get new of these value save it as a default and restart the device. So when the device gets connected to the Wi-Fi network and after that, I am thinking of broadcasting DHT11 temp data on URL with /temp and receive it on mobile. – Lucifer Feb 26 '20 at 12:51
  • or is there other way? – Lucifer Feb 26 '20 at 12:51
  • @jcaron do you have any tutorial links or guides for that BLE and Wifi setup? – Lucifer Feb 26 '20 at 12:55
  • And does to get the data like DHT11 from the device to the Mobile app services like AWS IoT will be good or any other free one. If you can suggest some please do. – Lucifer Feb 26 '20 at 12:57
  • @oh.dae.su where is the iotthing.h library of shane G from this link. And how to make it work in simple. – Lucifer Feb 26 '20 at 13:00
  • Anyone any insight? – Lucifer Feb 28 '20 at 07:42

0 Answers0