ESP8266 Smart config mode.
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
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
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);
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);
}
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);
}
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*/
#define ESP_TOUCH_TIME_ENTER (20000) /*Time limit for ESP-TOUCH to receive config packets*/
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
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.