Problem with SOFTAP_MODE connection

khgoh
Posts: 7
Joined: Thu Mar 19, 2015 11:14 am

Problem with SOFTAP_MODE connection

Postby khgoh » Wed Oct 28, 2015 11:46 am

Hi,
Our system (with hardware ESP-07) has been using esp_iot_sdk_v1.1.0 without problem for sometime now. When we try to recompile our code with the latest SDK, we found out that we have problem with the system when running as SOFTAP_MODE. The part of our system code are as below,

void ICACHE_FLASH_ATTR wifictrl_StartSoftAP(void)
{
uint8_t mac[6];
struct softap_config apCfg;
struct ip_info ipinfo;

wifi_set_opmode(SOFTAP_MODE);
wifi_softap_dhcps_stop();
wifictrl_SetupDefaultAPCfg(&apCfg,&ipinfo);
wifi_softap_set_config(&apCfg);

wifi_set_phy_mode(PHY_MODE_11G);
wifi_set_broadcast_if(SOFTAP_IF);

wifi_set_ip_info(SOFTAP_IF, &ipinfo);

wifi_softap_dhcps_start();

wifiCtrl_ApStarted=1;

}

/*
* Prepare the default configuration setting according to setting in user_config.h
*/
void ICACHE_FLASH_ATTR wifictrl_SetupDefaultAPCfg(struct softap_config *pAPConfig, struct ip_info *pAP_Ip)
{
uint8_t mac[6];
int count;

wifi_get_macaddr(STATION_IF,mac);
count = os_sprintf(pAPConfig->ssid, WIFI_AP_NAME);
pAPConfig->ssid_len=count+(os_sprintf(&(pAPConfig->ssid[count]),"_%02X:%02X:%02X",
mac[3],mac[4],mac[5]));
os_sprintf(pAPConfig->password, "%s", WIFI_AP_PASSWORD);
pAPConfig->authmode = WIFI_AP_AUTHMODE;
pAPConfig->ssid_hidden = WIFI_AP_SSIDHIDDEN;
pAPConfig->channel = WIFI_AP_CHANNEL;
pAPConfig->max_connection = WIFI_AP_MAXCONN;
pAPConfig->beacon_interval=WIFI_AP_BEACON;

pAP_Ip->ip.addr=ipaddr_addr(WIFI_AP_IP);
pAP_Ip->gw.addr=ipaddr_addr(WIFI_AP_GATEWAY);
pAP_Ip->netmask.addr=ipaddr_addr(WIFI_AP_NETMASK);
}

Our testing are base on 2 type of client tring to connect to the system running under SOFTAP_MODE,
Client 1: Dell XPS15 Notebook with build in wifi adapter, running Windows10.
Client 2: Samasung Galaxy Note4 Phone running with Android 5.1.1.

We testing the same code with your SDK version 1.1.0, 1.1.2 and the latest 1.4.1_pre3 and the result are as below,
With SDK 1.1.0,
Client1: Can connect and obtain the IP from the system
Client2: Can connect and obtain the IP from the system

With SDK 1.1.2
Client1: Can Connect but unable to obtain the IP from the system.
Client2: Can connect and obtain the IP from the system

With SDK 1.4.1_pre3
Client1: Cannot connect at all, the client immediately reject when try to connect.
Client2: Cannot connect at all, the client immediately reject when try to connect.

Please help to look in to the problem and hopefully with the above result, will help you to troubleshot and find the problem bug as soon as possible.

Regards,
KH Goh

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

Re: Problem with SOFTAP_MODE connection

Postby ESP_Faye » Wed Oct 28, 2015 5:32 pm

Hi,

Could your please provide the UART output logs for debugging ?

khgoh
Posts: 7
Joined: Thu Mar 19, 2015 11:14 am

Re: Problem with SOFTAP_MODE connection

Postby khgoh » Wed Oct 28, 2015 6:22 pm

Hi,
Below is the Log base on sdk v1.4.1_pre3,

mode : softAP(1a:fe:34:fe:36:1c)
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
bcn 0
del if1
usl
add if1
bcn 100
bcn 0
del if1
usl
add if1
fpm open,type:2 0
bcn 100

After the last entry, when I try to connect with my Android phone, the connection is unsuccessful. Any no more log is printed out.
For your information, my AP ip setting are as below,

#define WIFI_AP_IP "10.18.18.1"
#define WIFI_AP_GATEWAY "10.18.18.1"
#define WIFI_AP_LEASE_IP_START "10.18.18.5"
#define WIFI_AP_LEASE_IP_END "10.18.18.200"
#define WIFI_AP_NETMASK "255.255.255.0"

and I added in,

iplease.start_ip.addr=ipaddr_addr(WIFI_AP_LEASE_IP_START);
iplease.end_ip.addr=ipaddr_addr(WIFI_AP_LEASE_IP_END);
wifi_softap_set_dhcps_lease(&iplease);
wifi_softap_dhcps_start();

in my code, the result is the same.

../KH Goh

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

Re: Problem with SOFTAP_MODE connection

Postby ESP_Faye » Fri Oct 30, 2015 3:03 pm

Hi,

I tried your test code, it works fine.

Here is my bin files, please download it and have a try.

Code: Select all

#define WIFI_AP_NAME "TEST8266"
#define WIFI_AP_PASSWORD "88888888"
Attachments
softAP_test_bin.zip
(154.75 KiB) Downloaded 124 times

Who is online

Users browsing this forum: No registered users and 11 guests