Hello,
i'm using ESP8266 with SOFTAP-Mode.
Connecting and using web-server with my android mobile phones works without problems. Also kolleagues do not reported any problem.
I want to connect with my notebook too and it's not possibel, or in other word: for very short times: It joins and leaves permanently the AP.
Please help me or give any advice.
I'm using SDK 1.3 and following LOG i recorded:
========================================================
add 1
aid 1
station: 5c:c5:d4:de:4c:ac join, AID = 1
station: 5c:c5:d4:de:4c:ac leave, AID = 1
rm 1
. 60
. 61
add 1
aid 1
station: 5c:c5:d4:de:4c:ac join, AID = 1
station: 5c:c5:d4:de:4c:ac leave, AID = 1
rm 1
========================================================
I tried SDK 1.1 and SDK 1.2 too without any success.
Here the used initialization sequence:
====================================================
void dhcps_lease(void)
{
struct dhcps_lease dhcp_lease;
IP4_ADDR(&dhcp_lease.start_ip, 10, 10, 10, 20);
IP4_ADDR(&dhcp_lease.end_ip, 10, 10, 10, 100);
wifi_softap_set_dhcps_lease(&dhcp_lease);
}
//Main routine. Initialize stdout, the I/O and the webserver and we're done.
void user_init(void)
{
ioObj=&ioObj_static;
struct softap_config apConfig;
struct ip_info ipinfo;
char ssid[33];
char password[33];
char macaddress[17];
char info[150];
int i;
struct SettingsData *settings;
system_timer_reinit();
ets_wdt_disable();
stdoutInit();
for(i=0;i<1000;i++) os_delay_us(1000);
ets_wdt_enable();
os_printf("Starting\r\n");
settings=getSettingsDataPtr();
if (1==1 || readSettings()==false)
{
os_printf("Read Failed\r\n");
os_sprintf(settings->password,"%s","esptemplate");
os_sprintf(settings->ssid,"%s","esptemplate");
os_sprintf(settings->configstring,"");
for(i=0; i<40; i++) settings->params[i]=0L;
writeSettings();
}
if( wifi_get_phy_mode() != PHY_MODE_11G )
{
os_printf("*** Setting PHY_MODE ...\r\n");
wifi_set_phy_mode( PHY_MODE_11B );
}
if(wifi_get_opmode() != SOFTAP_MODE)
{
wifi_set_opmode_current(SOFTAP_MODE);
}
wifi_set_opmode_current(SOFTAP_MODE);
wifi_softap_dhcps_stop();
IP4_ADDR(&ipinfo.ip, 10, 10, 10, 1);
IP4_ADDR(&ipinfo.gw, 10, 10, 10, 1);
IP4_ADDR(&ipinfo.netmask, 255, 255, 255, 0);
wifi_set_ip_info(SOFTAP_IF, &ipinfo);
wifi_softap_get_config(&apConfig);
os_memset(apConfig.ssid, 0, sizeof(apConfig.ssid));
os_sprintf(ssid, "%s", settings->ssid);
os_memcpy(apConfig.ssid, ssid, os_strlen(ssid));
// if (wifi_get_opmode() == SOFTAP_MODE)
{
if (1==0)
{
// SSID
os_memset(apConfig.password, 0, sizeof(apConfig.password));
os_sprintf(password, "%s", settings->password);
os_memcpy(apConfig.password, password, os_strlen(password));
apConfig.authmode = AUTH_WPA_WPA2_PSK;
}
else
{
// without password
os_memset(apConfig.ssid, 0, sizeof(apConfig.ssid));
os_sprintf(ssid, "%s", "esptemplate2");
os_memcpy(apConfig.ssid, ssid, os_strlen(ssid));
apConfig.authmode = AUTH_OPEN;
}
apConfig.channel = 1;
apConfig.max_connection = 2;
apConfig.ssid_hidden = 0;
apConfig.ssid_len = 0;
apConfig.beacon_interval = 100;
wifi_softap_set_config_current(&apConfig);
}
dhcps_lease();
wifi_softap_dhcps_start();
system_os_task(at_procTask, at_procTaskPrio, at_procTaskQueue, at_procTaskQueueLen);
system_os_post(at_procTaskPrio, 0, 0 );
processIO(ioObj,ioAction_init);
processIO(ioObj,ioAction_setOutputs);
// os_timer_disarm(ETSTimer *ptimer)
os_timer_disarm(&working_timer);
// os_timer_setfn(ETSTimer *ptimer, ETSTimerFunc *pfunction, void *parg)
os_timer_setfn(&working_timer, (os_timer_func_t *)working_cb, (void *)0);
// void os_timer_arm(ETSTimer *ptimer,uint32_t milliseconds, bool repeat_flag)
os_timer_arm(&working_timer, 100, 1);
//httpdInit(builtInUrls, 80);
os_printf("\nReady\n");
}
SOFTAP - Some devices can not connect JOIN-LEAVE
Re: SOFTAP - Some devices can not connect JOIN-LEAVE
Postby ESP_Faye » Mon Mar 07, 2016 3:15 pm
Hi,
1. Could it connect if just using a simple softAP test code http://bbs.espressif.com/viewtopic.php?f=31&t=227 ?
2. Can you capture the WiFi packets and provide it for debugging ?
1. Could it connect if just using a simple softAP test code http://bbs.espressif.com/viewtopic.php?f=31&t=227 ?
2. Can you capture the WiFi packets and provide it for debugging ?
Who is online
Users browsing this forum: No registered users and 2 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.