BLE and WiFi Tasks Memory Allocation Failed
Posted: Sat Dec 15, 2018 7:02 pm
I have 2 FreeRTOS tasks where task 1 executes BLEDevice::init() and task 2 uses HttpClient to send a request to an HTTPS backend. I am running on a ESP WROVER DEV Kit v4.1.
I run the first BLE task and it executes fine; however, once the WiFi task executes (after the BLE task), it throws the following exception:
Full log below:
I bought the WROVER module since I figured the extra heap would work well with both WiFi and BLE; however, I can't get a simple use-case to execute over HTTPS. I can run the WiFi task by itself (without BLEDevice::init() from the other task), and I can run the BLE task independently. It's when I try to BLEDevice::init() and then run WiFi is when it fails. Any help is greatly appreciated.
I run the first BLE task and it executes fine; however, once the WiFi task executes (after the BLE task), it throws the following exception:
Code: Select all
12:59:27.684 -> [E][ssl_client.cpp:33] handle_error(): SSL - Memory allocation failed
Code: Select all
2:59:27.190 -> [V][ssl_client.cpp:53] start_ssl_client(): Free heap before TLS 4182376
12:59:27.190 -> [V][ssl_client.cpp:55] start_ssl_client(): Starting socket
[V][ssl_client.cpp:88] start_ssl_client(): Seeding the random number generator
12:59:27.684 -> [V][ssl_client.cpp:97] start_ssl_client(): Setting up the SSL/TLS structure...
12:59:27.684 -> [I][ssl_client.cpp:121] start_ssl_client(): WARNING: Use certificates for a more secure communication!
12:59:27.684 -> [V][ssl_client.cpp:145] start_ssl_client(): Setting hostname for TLS session...
12:59:27.684 -> [E][ssl_client.cpp:33] handle_error(): SSL - Memory allocation failed
12:59:27.684 -> [E][ssl_client.cpp:35] handle_error(): MbedTLS message code: -32512
12:59:27.717 -> [E][WiFiClientSecure.cpp:109] connect(): start_ssl_client: -32512
12:59:27.717 -> [V][ssl_client.cpp:211] stop_ssl_socket(): Cleaning SSL connection.
12:59:27.717 -> [D][HTTPClient.cpp:846] connect(): failed connect to [my backend server]:443
12:59:27.717 -> [W][HTTPClient.cpp:1124] returnError(): error(-1): connection refused
12:59:27.717 -> [I][HTTPAdapter.cpp:135] sync(): Received HTTP response [-1].
12:59:27.750 -> [W][HTTPClient.cpp:1124] returnError(): error(-4): not connected