Page 1 of 1

[ESP8266] SoftAP Config

Posted: Fri Feb 27, 2015 4:38 pm
by ESP_Faye
:idea: :idea: :idea:

Sample code below is based on ESP8266_NONOS_SDK.

Set SSID, password and other information about ESP8266 soft-AP.

Download blank.bin to flash for initialization.

Please notice that wifi_softap_get_config(&softap_config); // Get config first is recommended to be called first.
Or you have to set value for every parameter in softap_config, for example, softap_config.beacon_interval and softap_config.ssid_len, otherwise they will be random value which may make ESP8266 softAP hardly to be connected.

Code: Select all

 * FunctionName : user_set_softap_config
 * Description  : set SSID and password of ESP8266 softAP
 * Parameters   : none
 * Returns      : none
   struct softap_config config;

   wifi_softap_get_config(&config); // Get config first.
   os_memset(config.ssid, 0, 32);
   os_memset(config.password, 0, 64);
   os_memcpy(config.ssid, "ESP8266", 7);
   os_memcpy(config.password, "12345678", 8);
   config.authmode = AUTH_WPA_WPA2_PSK;
   config.ssid_len = 0;// or its actual length
   config.beacon_interval = 100;
   config.max_connection = 4; // how many stations can connect to ESP8266 softAP at most.

   wifi_softap_set_config(&config);// Set ESP8266 softap config .

 * FunctionName : user_init
 * Description  : entry of user application, init user function here
 * Parameters   : none
 * Returns      : none
void user_init(void)
    os_printf("SDK version:%s\n", system_get_sdk_version());

    // ESP8266 softAP set config.


Re: [ESP8266] SoftAP Config

Posted: Thu Jun 23, 2016 10:01 pm
by disideris
i see the essid and when i put the password doesn't connect.

I am trying to connect to wifi with an iphone. Does that produce a specific problem?

Re: [ESP8266] SoftAP Config

Posted: Fri Jan 20, 2017 5:46 pm
by design444
thank you for sharing this information.I would really like to visit your website.thank you so much.its code is helpful for me .
i appreciated for this post.thank you

Re: [ESP8266] SoftAP Config

Posted: Fri Jan 20, 2017 9:04 pm
by Layla508
Thanks for the post! I`ll visit this website. It may be useful for my colleagues.