Skip to content

Conversation

seopyoon
Copy link
Contributor

I added smart Config support for the library.

Based upon ESP83266 arduino library.

Haven't had chance to confirm it working.

return false;
}

return _smartConfigDone;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i do not see _smartConfigDone being set to true anywhere? Maybe missing from the callback?

return IPv6Address(addr.addr);
}


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not forget to add #include <esp_smartconfig.h> up on top

@me-no-dev
Copy link
Member

Please see my comments, with those changes I have tested it and its working :)

@me-no-dev
Copy link
Member

You might want to add an example as well :)

@seopyoon
Copy link
Contributor Author

Done that!

@me-no-dev how did you test it? my example code doesn't seem to work. please verify. Thanks in advance.

@me-no-dev
Copy link
Member

@seopyoon you did not add _smartConfigDone = true inside _smartConfigCallback, so you never get the done status. Yes with the edits I mentioned I tested the code and it worked fine

@seopyoon
Copy link
Contributor Author

Done! I should've read your comments more thoroughly. Could you confirm my example .ini working?

Thanks!

@me-no-dev
Copy link
Member

Sketch filename should be the same as the folder name it's in. So change SmartConfig.ino to WiFiSmartConfig.ino
Also this sketch I think looks better and more informative on what is going on:

#include "WiFi.h"

void setup() {
  Serial.begin(115200);

  //Init WiFi and SmartConfig
  WiFi.mode(WIFI_AP_STA);
  WiFi.beginSmartConfig();

  //Wait for SmartConfig packet from your phone
  Serial.print("Waiting for SmartConfig");
  while(!WiFi.smartConfigDone()){
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("SmartConfig recieved");

  //Wait for WiFi to connect with the recieved settings
  Serial.print("Waiting for WiFi");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");

  //WiFi is connected and we have IP
  Serial.println("WiFi Connected.");
  Serial.print("IP Address: ");
  Serial.println(WiFi.localIP());
}

void loop() {

}

Please do test your code and at least compile it.

@seopyoon
Copy link
Contributor Author

seopyoon commented Jan 20, 2017

@me-no-dev modified name of file, added comments. Confirmed compiling, and running without error. But, I cannot make it connect via ESP Touch technology. I am using this app for Android.
Any idea? (continuous . after Waiting for SmartConfig and ic_enable_sniffer)

@me-no-dev
Copy link
Member

I also use the ESPTouch app from the App store (iPhone user here) and it was working. maybe check the android store for updated version?

@me-no-dev me-no-dev merged commit 57dbc9a into espressif:master Jan 20, 2017
@me-no-dev
Copy link
Member

rst:0x1 (POWERON_RESET),boot:0x16 (SPI_FAST_FLASH_BOOT)
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x16 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0008,len:8
load:0x3fff0010,len:1760
load:0x40078000,len:6668
load:0x40080000,len:252
entry 0x40080034
Waiting for SmartConfig......................................................
SmartConfig received.
Waiting for WiFi......
WiFi Connected.
IP Address: 192.168.254.199

@christophepersoz
Copy link

christophepersoz commented Feb 3, 2020

Hello,
I just tried the SmartConfig.ino in association with ESP touch for iOS and I can't get it connected. On the ESP32 side the sketch build and run normally, but on the iOS side nothing occurs once "Confirm" button pressed. Have you notice any issues across the versions that can affect the behaviours of the smartConfig support as the last related comment is from Jan 2017?
Thanks.

brentru pushed a commit to adafruit/arduino-esp32 that referenced this pull request Oct 22, 2024
…t-install

Only install clang-format if it is really missing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants