ESP32 FreeRTOS memory allocation error
Posted: Wed Oct 06, 2021 4:16 pm
Hi,
I use xTaskCreate and when I use it twice it works properly but when I add one more xTaskCreate then I have error:
[E][ssl_client.cpp:36] _handle_error(): [start_ssl_client():207]: (-32512) SSL - Memory allocation failed
[E][WiFiClientSecure.cpp:133] connect(): start_ssl_client: -32512
What can be reason of that ? It used the whole available memory ?
Moderators Note: Fixed Codebox
I use xTaskCreate and when I use it twice it works properly but when I add one more xTaskCreate then I have error:
[E][ssl_client.cpp:36] _handle_error(): [start_ssl_client():207]: (-32512) SSL - Memory allocation failed
[E][WiFiClientSecure.cpp:133] connect(): start_ssl_client: -32512
What can be reason of that ? It used the whole available memory ?
- xTaskCreate(led,"led",6000,NULL,1,NULL);
- xTaskCreate(door,"door",6000,NULL,1,NULL);
- xTaskCreate(ledonoff,"ledonoff",6000,NULL,1,NULL);
- void door(void *parameter)
- {
- int pauzaPir = 100000;
- for(;;){
- fireStatusDoor = Firebase.getString("DOOR");
- if (fireStatusDoor == "Close")
- {
- myservo.write(90);
- }
- else if (fireStatusDoor == "Open")
- {
- myservo.write(0);
- }
- else {
- Serial.println("Wrong Credential! Please send open/close");
- }
- vTaskDelay(10);
- }
- vTaskDelete ( NULL );
- }
- void ledonoff(void *parameter)
- {
- for(;;){
- fireStatusLed = Firebase.getString("LED_STATUS");
- if (fireStatusLed == "ON")
- {
- digitalWrite(led_1, HIGH);
- }
- else if (fireStatusLed == "OFF")
- {
- digitalWrite(led_1, LOW);
- }
- else
- {
- Serial.println("Wrong Credential! Please send ON/OFF");
- }
- vTaskDelay(10);
- }
- vTaskDelete ( NULL );
- }
- void led(void *parameter)
- {
- int led_r;
- int led_g;
- int led_b;
- for(;;)
- {
- led_r=Firebase.getInt("LED_R");
- led_g=Firebase.getInt("LED_G");
- led_b=Firebase.getInt("LED_B");
- for (int i=0; i<num_led; i++){
- leds[i] = CRGB(led_r, led_g, led_b );
- FastLED.show();
- }
- vTaskDelay(10);
- }
- vTaskDelete ( NULL );
- }
Moderators Note: Fixed Codebox