rltk_wlan_init() in function wifi_on is using too much heap, causing pbuf alloc failure and makes my web server to stop functioning. I put some diagnostic prints and here is the result :
Initializing WIFI …
before rltk_wlan_init :Free heap: 187296 bytes
after rltk_wlan_init :Free heap: 127360 bytes
before rltk_wlan_init :Free heap: 127360 bytes
after rltk_wlan_init :Free heap: 81952 bytes
before rltk_wlan_start:Free heap: 81952 bytes
after rltk_wlan_start :Free heap: 68256 bytes
before rltk_wlan_start:Free heap: 68256 bytes
after rltk_wlan_start :Free heap: 68256 bytes
WIFI initialized
I assume rltk_wlan_init() and rltk_wlan_start() is called twice because i set the mode to AP_STA, but still, ~105 KB just for initializing WiFi interface is seems too much. I there a way to decrease the heap usage?
I am using board definition version 3.1.7