"wifi_get_ip_info" does not work as expected. It returns true without initializing the struct.
This causes dhcp_set_info to fail later on (as it depends on wifi_get_ip_info internally - check "...\third_party\udhcp\files.c" ) and DHCP does not work correctly.
struct ip_info setinfo;
struct ip_info getinfo;
setinfo.gw.addr = ipaddr_addr( "192.168.4.128" );
setinfo.ip.addr = ipaddr_addr( "192.168.4.128" );
setinfo.netmask.addr = ipaddr_addr( "255.255.255.0" );
set_result = wifi_set_ip_info(SOFTAP_IF, &setinfo);
printf("Set returned:%d [IP:%X,GW:%X,MASK:%X]\r\n", set_result, setinfo.ip.addr, setinfo.gw.addr, setinfo.netmask.addr );
get_result = wifi_get_ip_info(SOFTAP_IF, &getinfo);
printf("Get returned:%d [IP:%X,GW:%X,MASK:%X]\r\n", get_result, getinfo.ip.addr, getinfo.gw.addr, getinfo.netmask.addr );
Set returned:1 [IP:8004A8C0,GW:8004A8C0,MASK:FFFFFF]
Get returned:1 [IP:0,GW:0,MASK:0]
Otherwise, LWIP's BSD sockets seem to work nicely and system is pretty stable if only static memory is used. Using dynamic memory like it's done in the examples (zalloc,free) causes reset at some point.
Edit: It works if DHCP is configured at a later point (other thread in couple of seconds). wifi_get_ip_info then works as expected. I suppose a background thread is responsible for updating the values...
Thank you for your good work.
Who is online
Users browsing this forum: No registered users and 9 guests
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
We also have a RTOS version and a MESH version too!
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!