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.

Who is online

Users browsing this forum: No registered users and 290 guests