tonyp7 / esp32-wifi-manager

Captive Portal for ESP32 that can connect to a saved wireless network or start an access point where you can connect to existing wifis.
MIT License
664 stars 217 forks source link

AP IP address. #13

Closed snahmad closed 5 years ago

snahmad commented 6 years ago

Hi,

How this application specify 192.168.1.1 as AP IPv4 address.

I cannot find source code line where It specify it.

Just to confirm It is running in both AP and STA mode. after connect to any AP.

Is web files are part of .bin image?

snahmad commented 6 years ago

I am using Kolban C++ WIFI class. I get AP IPv4 address =192.168.4.1

I need to integrate your JS code into my angular web application.

I am using Kolban C++ classes. I guess I need to use two instance of WIFI class object. one for AP and other for STA mode.

tonyp7 commented 6 years ago

Hi,

It's just right there: https://github.com/tonyp7/esp32-wifi-manager/blob/d7f51b587460cc905f9451f14451c9802fe3bbeb/wifi_manager/main/wifi_manager.c#L438-L441

snahmad commented 6 years ago

ok. it is here

/* assign a static IP to the AP network interface */
    tcpip_adapter_ip_info_t info;
    memset(&info, 0x00, sizeof(info));
    IP4_ADDR(&info.ip, 192, 168, 1, 1);
    IP4_ADDR(&info.gw, 192, 168, 1, 1);
    IP4_ADDR(&info.netmask, 255, 255, 255, 0);
    ESP_ERROR_CHECK(tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_AP, &info));