-->
Page 1 of 2

Problem with DHCP in SOFTAP

PostPosted: Thu Jan 29, 2015 7:06 pm
by aignaciors
Hello everyone,

I'm developing a IoT device, that uses the MQTT( from tuan ) + httpd codes, i mix the two codes in one to configure the device and after connect to a broker, but in user_init() function, when change the SSID of the deivce in SOFTAP mode, the DHCP just stop to work and i cannot to connect from other device in the ESP8266 unless i use the system_restore, anyone had this kind of problem?

Code: Select allvoid user_init(void)
{
   stdoutInit();
   ioInit();

   //system_restore();   

   /****** Print Some inf. about ESP ******/

   os_printf("\n\n");
   os_printf("\nPrinting AP Settings:\n");
   struct softap_config cfgESP;
   while(!wifi_softap_get_config(&cfgESP));
   os_printf("\nSSID:%s",cfgESP.ssid);
   os_printf("\nPASSWORD:%s",cfgESP.password);
   os_printf("\nCHANNEL:%d",cfgESP.channel);
   os_printf("\nAuthentification:%d",cfgESP.authmode);
   os_printf("\nSSID Hidden:%d",cfgESP.ssid_hidden);
   os_printf("\nMax Connections:%d",cfgESP.max_connection);
   os_printf("\n\n");

   /****** Change SSID ******/
   memset(cfgESP.ssid, 0, 32);
   strcpy(cfgESP.ssid, WIFI_APSSID);
   wifi_softap_set_config(&cfgESP);

   /****** Init WS ******/
   httpdInit(builtInUrls, 80);
   os_printf("\nWebServer=Ready\n");

   /****** MQTT polling to connect ******/
   os_timer_disarm(&mqtt_timer);
   os_timer_setfn(&mqtt_timer, (os_timer_func_t *)CheckForMQTT_cb, (void *)0);
   os_timer_arm(&mqtt_timer, 500, 1);
   os_printf("\nMQTT timer=Started\n");
}

Re: Problem with DHCP in SOFTAP

PostPosted: Mon Feb 23, 2015 3:52 pm
by ATIF EL KHACHINE
Hi, I'am getting into the same situation as you. Have you got any workaround to fixe it please ?

Best regards

Re: Problem with DHCP in SOFTAP

PostPosted: Wed Feb 25, 2015 9:30 pm
by aignaciors
Hi,

I'm still trying to get a way to fix this. :(

Re: Problem with DHCP in SOFTAP

PostPosted: Thu Feb 26, 2015 12:07 pm
by ATIF EL KHACHINE
What esp sdk version are using ?