socket server buffer error
Posted: Tue Apr 18, 2017 7:19 pm
Hello,
I am creating a simple socket server on the ESP32 using the esp-idf libraries on Eclipse.
When the schedular starts the connection task, it results in this error message:
[0;32mI (81) cpu_start: Starting scheduler on APP CPU..[0m.socket: -1 error: No buffer space available
The error message is coming from my code as follows:
void socket_server_task(void *ignore) {
#define PORT_NUMBER 8001
struct sockaddr_in clientAddress;
struct sockaddr_in serverAddress;
int sock;
int rc;
sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sock < 0) {
printf("socket: %d ", sock);
printf("error: %s ", strerror(errno));
vTaskDelete(NULL);
}
This task is started from my main app as follows:
void app_main() {
nvs_flash_init();
xTaskCreate(&socket_server_task, "socket_server_task", 2048, NULL, 5, NULL);
xTaskCreate(&main_task, "main_task", 2048, NULL, 5, NULL);
}
I looked at my menuconfig and nothing seems to be out of the ordinary - see relevant sdkconfig settings below:
# ESP32-specific
#
CONFIG_WIFI_ENABLED=y
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=5
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32
CONFIG_ESP32_WIFI_AMPDU_ENABLED=y
CONFIG_ESP32_WIFI_NVS_ENABLED=y
CONFIG_PHY_ENABLED=y
# LWIP
#
CONFIG_L2_TO_L3_COPY=y
CONFIG_LWIP_MAX_SOCKETS=10
CONFIG_LWIP_THREAD_LOCAL_STORAGE_INDEX=0
CONFIG_LWIP_SO_REUSE=y
CONFIG_LWIP_SO_RCVBUF=y
CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1
# CONFIG_LWIP_IP_FRAG is not set
# CONFIG_LWIP_IP_REASSEMBLY is not set
CONFIG_TCP_MAXRTX=12
CONFIG_TCP_SYNMAXRTX=6
CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y
What am I missing that is causing this error at bootup time?
I am creating a simple socket server on the ESP32 using the esp-idf libraries on Eclipse.
When the schedular starts the connection task, it results in this error message:
[0;32mI (81) cpu_start: Starting scheduler on APP CPU..[0m.socket: -1 error: No buffer space available
The error message is coming from my code as follows:
void socket_server_task(void *ignore) {
#define PORT_NUMBER 8001
struct sockaddr_in clientAddress;
struct sockaddr_in serverAddress;
int sock;
int rc;
sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sock < 0) {
printf("socket: %d ", sock);
printf("error: %s ", strerror(errno));
vTaskDelete(NULL);
}
This task is started from my main app as follows:
void app_main() {
nvs_flash_init();
xTaskCreate(&socket_server_task, "socket_server_task", 2048, NULL, 5, NULL);
xTaskCreate(&main_task, "main_task", 2048, NULL, 5, NULL);
}
I looked at my menuconfig and nothing seems to be out of the ordinary - see relevant sdkconfig settings below:
# ESP32-specific
#
CONFIG_WIFI_ENABLED=y
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=5
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32
CONFIG_ESP32_WIFI_AMPDU_ENABLED=y
CONFIG_ESP32_WIFI_NVS_ENABLED=y
CONFIG_PHY_ENABLED=y
# LWIP
#
CONFIG_L2_TO_L3_COPY=y
CONFIG_LWIP_MAX_SOCKETS=10
CONFIG_LWIP_THREAD_LOCAL_STORAGE_INDEX=0
CONFIG_LWIP_SO_REUSE=y
CONFIG_LWIP_SO_RCVBUF=y
CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1
# CONFIG_LWIP_IP_FRAG is not set
# CONFIG_LWIP_IP_REASSEMBLY is not set
CONFIG_TCP_MAXRTX=12
CONFIG_TCP_SYNMAXRTX=6
CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y
What am I missing that is causing this error at bootup time?