Page 1 of 1

how to support the "captive Portal" on ESP8266

Posted: Sat Jul 28, 2018 5:10 pm
by lijay910
HI
use the code,such as:
LOCAL void ICACHE_FLASH_ATTR
user_udp_recv(void *arg, char *pusrdata, unsigned short length)
{
char DeviceBuffer[40] = {0};
char Device_mac_buffer[60] = {0};
char hwaddr[6];
struct espconn *pesp_conn = arg;
struct ip_info ipconfig;
at_port_print("user_udp_recv\r\n");
//at_port_print(pusrdata);
//m_pespconn =pesp_conn;

remot_info *premot = NULL;
sint8 value = ESPCONN_OK;
char pbuf[100] = {0};
if (espconn_get_connection_info(pesp_conn,&premot,0) == ESPCONN_OK){
pesp_conn->proto.tcp->remote_port = premot->remote_port;
pesp_conn->proto.tcp->remote_ip[0] = premot->remote_ip[0];
pesp_conn->proto.tcp->remote_ip[1] = premot->remote_ip[1];
pesp_conn->proto.tcp->remote_ip[2] = premot->remote_ip[2];
pesp_conn->proto.tcp->remote_ip[3] = premot->remote_ip[3];

os_sprintf(pbuf,"DNS Remote[IP=" IPSTR "][Port=%d]",IP2STR(&pesp_conn->proto.udp->remote_ip), pesp_conn->proto.udp->remote_port);
at_port_print(pbuf);
//espconn_sent(pesp_conn, pusrdata, os_strlen(pusrdata));
espconn_sent(pesp_conn, html, strlen(html));
}
}

but it is never usefull.
after to connet to the EPS82666 AP, but cann't show the portal window on the phone.
how to suport the captive Portal on esp8266??