ESP8266 Smart config mode.

suresh
Posts: 11
Joined: Wed Oct 26, 2016 10:15 pm

ESP8266 Smart config mode.

Postby suresh » Thu Oct 27, 2016 5:02 pm

My requirement is as follows:
ESP8266 devices should form a mesh network. The root ESP8266 device should hook to a WiFi router. A server (an Android app) connected to the same WiFi router must be able to send commands to control each ESP8266 device.

After going through the help docs and demos, I could successfully run the mesh demo by updating user_config.h with my router's SSID and password.

Now I need the mesh_demo to work in smart config mode so that I can use ESP_Touch Android App to supply SSID and password to the ESP device. What configuration change do I need to make in mesh_demo source code to enable smart config?
Please guide me.
Thanks
Suresh

suresh
Posts: 11
Joined: Wed Oct 26, 2016 10:15 pm

Re: ESP8266 Smart config mode.

Postby suresh » Fri Oct 28, 2016 2:31 pm

I can see ESP-TOUCH time out message immediately after I restart the device.

scandone
err,scan status 1
scandone
err,scan status 4
ESP-TOUCH TIMEOUT

suresh
Posts: 11
Joined: Wed Oct 26, 2016 10:15 pm

Re: ESP8266 Smart config mode.

Postby suresh » Mon Oct 31, 2016 5:45 pm

If anyone knows why ESP-TIMEOUT is happening without even waiting for a second, please help me.

ESP_Alen

Re: ESP8266 Smart config mode.

Postby ESP_Alen » Wed Nov 02, 2016 10:08 pm

suresh wrote:If anyone knows why ESP-TIMEOUT is happening without even waiting for a second, please help me.


Please setup time for esp-touch.

/*
* while system runs smartconfig (STA mode), mesh (STA + SoftAp mode) must not been enabled,
* So wait for esptouch to run over and then execute espconn_mesh_enable
*/
os_timer_t *wait_timer = (os_timer_t *)os_zalloc(sizeof(os_timer_t));
if (NULL == wait_timer) return;
os_timer_disarm(wait_timer);
os_timer_setfn(wait_timer, (os_timer_func_t *)wait_esptouch_over, wait_timer);
os_timer_arm(wait_timer, 30000, true);

suresh
Posts: 11
Joined: Wed Oct 26, 2016 10:15 pm

Re: ESP8266 Smart config mode.

Postby suresh » Wed Nov 09, 2016 5:21 pm

Hi Alen,

Increased the timeout as per your advice. But no effect. ESP-TOUCH TIMEOUT appears immediately after the boot!

Following is my user_init routine:
Thanks.

void user_init(void)
{

/*
* set uart baut ratio
*/
uart_div_modify(0, UART_CLK_FREQ / UART_BAUD_RATIO);
uart_div_modify(1, UART_CLK_FREQ / UART_BAUD_RATIO);

MESH_DEMO_PRINT("user_init");
if (!router_init()) {
return;
}


if (!esp_mesh_demo_init())
return;

user_devicefind_init();

/*
* while system runs smartconfig (STA mode), mesh (STA + SoftAp mode) must not been enabled,
* So wait for esptouch to run over and then execute espconn_mesh_enable
*/
os_timer_t *wait_timer = (os_timer_t *)os_zalloc(sizeof(os_timer_t));
if (NULL == wait_timer) return;
os_timer_disarm(wait_timer);
os_timer_setfn(wait_timer, (os_timer_func_t *)wait_esptouch_over, wait_timer);
os_timer_arm(wait_timer, 30000, true);
}

suresh
Posts: 11
Joined: Wed Oct 26, 2016 10:15 pm

Re: ESP8266 Smart config mode.

Postby suresh » Wed Nov 09, 2016 8:43 pm

Changed the following timer value from 2000 to 20000 and it works now! Thank you Alen

#define ESP_TOUCH_TIME_ENTER (20000) /*Time limit for ESP-TOUCH to receive config packets*/

ESP_Alen

Re: ESP8266 Smart config mode.

Postby ESP_Alen » Mon Dec 05, 2016 10:41 am

suresh wrote:Changed the following timer value from 2000 to 20000 and it works now! Thank you Alen

#define ESP_TOUCH_TIME_ENTER (20000) /*Time limit for ESP-TOUCH to receive config packets*/


welcome.

milesstone
Posts: 25
Joined: Mon Apr 26, 2021 4:50 pm

Re: ESP8266 Smart config mode.

Postby milesstone » Sun Jun 20, 2021 10:28 pm

suresh wrote:My requirement is as follows:
ESP8266 devices should form a mesh network. The root ESP8266 device should hook to a WiFi router. A server (an GBWhatsApp Apk Android app) connected to the same WiFi router must be able to send commands to control each ESP8266 device.

After going through the help docs and demos, I could successfully run the mesh demo by updating user_config.h with my router's SSID and password.

Now I need the mesh_demo to work in smart config mode so that I can use ESP_Touch Android App to supply SSID and password to the ESP device. What configuration change do I need to make in mesh_demo source code to enable smart config?
Please guide me.
Thanks
Suresh

I hope this help's a lot.
https://docs.espressif.com/projects/esp ... onfig.html

Nielson
Posts: 22
Joined: Wed Dec 09, 2020 4:15 pm

Re: ESP8266 Smart config mode.

Postby Nielson » Tue Jun 22, 2021 10:53 pm

milesstone wrote:
suresh wrote:My requirement is as follows:
ESP8266 devices should form a mesh network. The root ESP8266 device should hook to a WiFi router. A server (an GBWhatsApp Apk Android app) connected to the same WiFi router must be able to send commands to control each ESP8266 device.

After going through the help docs and demos, I could successfully run the mesh demo by updating user_config.h with my router's SSID and password.

Now I need the mesh_demo to work in smart config mode so that I can use ESP_Touch Android App to supply SSID and password to the ESP device. What configuration change do I need to make in mesh_demo source code to enable smart config?
Please guide me.
Thanks
Suresh

I hope this help's a lot.
https://docs.espressif.com/projects/esp ... onfig.html

wow it's really helpful for me thank you so much for sharing this guide url.

micheal4269
Posts: 3
Joined: Wed Jun 23, 2021 5:40 am

Re: ESP8266 Smart config mode.

Postby micheal4269 » Wed Jun 23, 2021 5:46 am

Nielson wrote:
milesstone wrote:
suresh wrote:My requirement is as follows:
ESP8266 devices should form a mesh network. The root ESP8266 device should hook to a WiFi router. A server (an GB Instagram for iOS Android app) connected to the same WiFi router must be able to send commands to control each ESP8266 device.

After going through the help docs and demos, I could successfully run the mesh demo by updating user_config.h with my router's SSID and password.

Now I need the mesh_demo to work in smart config mode so that I can use ESP_Touch Android App to supply SSID and password to the ESP device. What configuration change do I need to make in mesh_demo source code to enable smart config?
Please guide me.
Thanks
Suresh

I hope this help's a lot.
https://docs.espressif.com/projects/esp ... onfig.html

wow it's really helpful for me thank you so much for sharing this guide url.

Thank you so much. It helped me a lot.

Who is online

Users browsing this forum: No registered users and 18 guests