ESP as a AP

anupak
Posts: 1
Joined: Wed Sep 09, 2015 10:28 pm

ESP as a AP

Postby anupak » Wed Sep 09, 2015 10:39 pm

Hi,

I am trying to use the ESP-01 as an AP (with AUTH_WPA_WPA2_PSK) authorization. I have based my code off the sample code. The ESP does behave as a AP, but with no authentication (i.e. open network). Am I missing something?

My code is as follows:

Code: Select all

/* Setup the Acess point settings */
void ICACHE_FLASH_ATTR user_set_ap_config(void)
{
    struct softap_config config;

    wifi_set_opmode(0x02);

    wifi_softap_get_config(&config); // Get config first.
    os_memset(config.ssid, 0, 32);
    os_memset(config.password, 0, 64);
    os_memcpy(config.ssid, SSID, os_strlen(SSID)); // Changes from sample
    os_memcpy(config.password, PASSWORD, os_strlen(PASSWORD));  // Changes from sample
    config.authmode = AUTH_WPA_WPA2_PSK;
    config.ssid_len = 0;// or its actual length
    config.max_connection = 4; // how many stations can connect to ESP8266 softAP at most.

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


FYI: I am using an android phone to connect to ESP.

Regards
Anupak

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: ESP as a AP

Postby ESP_Faye » Fri Sep 18, 2015 2:46 pm

Hi,

What a strange problem !

Maybe you could provide your bin files and I'll test it .

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

Re: ESP as a AP

Postby milesstone » Fri Aug 20, 2021 7:14 pm

anupak wrote:Hi,

I am trying to use the ESP-01 as an AP (with AUTH_WPA_WPA2_PSK) authorization. I have based my code off the sample code. The ESP does behave as a AP, but with no authentication (i.e. open network). Am I missing something?

My code is as follows: ogwhatsapp apk

Code: Select all

/* Setup the Acess point settings */
void ICACHE_FLASH_ATTR user_set_ap_config(void)
{
    struct softap_config config;

    wifi_set_opmode(0x02);

    wifi_softap_get_config(&config); // Get config first.
    os_memset(config.ssid, 0, 32);
    os_memset(config.password, 0, 64);
    os_memcpy(config.ssid, SSID, os_strlen(SSID)); // Changes from sample
    os_memcpy(config.password, PASSWORD, os_strlen(PASSWORD));  // Changes from sample
    config.authmode = AUTH_WPA_WPA2_PSK;
    config.ssid_len = 0;// or its actual length
    config.max_connection = 4; // how many stations can connect to ESP8266 softAP at most.

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


FYI: I am using an android phone to connect to ESP.

Regards
Anupak

I'm confused :) I do this with my ESPs, they all connect to a wifi after configuration, but before that (or if i reset them) they all default to AP, offering a page to configure them with I change my android to use their AP, it whines about no internet, but i can still talk to them (192.168.4.1 is the default address)

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

Re: ESP as a AP

Postby Nielson » Tue Aug 31, 2021 9:53 pm

milesstone wrote:
anupak wrote:Hi,

I am trying to use the ESP-01 as an AP (with AUTH_WPA_WPA2_PSK) authorization. I have based my code off the sample code. The ESP does behave as a AP, but with no authentication (i.e. open network). Am I missing something?

My code is as follows: ogwhatsapp apk

Code: Select all

/* Setup the Acess point settings */
void ICACHE_FLASH_ATTR user_set_ap_config(void)
{
    struct softap_config config;

    wifi_set_opmode(0x02);

    wifi_softap_get_config(&config); // Get config first.
    os_memset(config.ssid, 0, 32);
    os_memset(config.password, 0, 64);
    os_memcpy(config.ssid, SSID, os_strlen(SSID)); // Changes from sample
    os_memcpy(config.password, PASSWORD, os_strlen(PASSWORD));  // Changes from sample
    config.authmode = AUTH_WPA_WPA2_PSK;
    config.ssid_len = 0;// or its actual length
    config.max_connection = 4; // how many stations can connect to ESP8266 softAP at most.

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


FYI: I am using an android phone to connect to ESP.

Regards
Anupak

I'm confused :) I do this with my ESPs, they all connect to a wifi after configuration, but before that (or if i reset them) they all default to AP, offering a page to configure them with I change my android to use their AP, it whines about no internet, but i can still talk to them (192.168.4.1 is the default address)

Which version of Android are you using?

No matter what I try, I can't get LineageOS to connect to the ESP in AP mode (complaining about no internet, or in captive portal 'sign in to network' mode) and use the tcp/ip route to the ESP for the ESP traffic, and the default gateway for any other traffic (as any other machine would).

Who is online

Users browsing this forum: No registered users and 5 guests