Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL/TLS Handshake error on esp32-wrover-e kit with rainmaker matter controller example (MEGH-5732) #319

Open
3 tasks done
Shivi-6 opened this issue Jul 5, 2024 · 11 comments

Comments

@Shivi-6
Copy link

Shivi-6 commented Jul 5, 2024

Answers checklist.

  • I have read the Rainmaker documentation and the issue is not addressed there.
  • I have updated my IDF branch (release/vX.Y) to the latest version and checked that the issue is present there. This is not applicable if you are using Rainmaker with Arduino.
  • I have searched the Rainmaker forum and issue tracker for a similar issue and not found a similar issue.

General issue report

I was trying to create a matter controller out of my esp32-wrover-e kit with 4mb flash. First of all. the partition was 2mb each which was insufficient for a binary of 2.1mb so I crreated a single partition of 3.5 mb instead of two ota partitions. After this, the build was successful and I was able to flash the binary to my board. I was also able to generate the QR code for commissioning.
While monitoring using the "idf.py monitor" and trying to connect the controller with rainamaker app, I am getting mbedtls handshake issue. Please find the logs attached and let me know what could be the solution.
idf_py_stdout_output.pdf

@github-actions github-actions bot changed the title SSL/TLS Handshake error on esp32-wrover-e kit with rainmaker matter controller example SSL/TLS Handshake error on esp32-wrover-e kit with rainmaker matter controller example (MEGH-5732) Jul 5, 2024
@Shivi-6
Copy link
Author

Shivi-6 commented Jul 5, 2024

idf_py_stdout_output.pdf
This is the log when the controller got connected to the google home app but after the message "Device connected" appeared and I clicked the "Done" option, it showed "something went wrong" and the device did not connect. In this case, the error "ERROR A stack overflow in task Tmr Svc has been detected." appears.
I am a bit new to this so I don't know exactly where the issue lies. Please help me.

@vikramdattu
Copy link
Contributor

Hi @Shivi-6 this looks like a memory issue.

ESP32 Wrover Kit has external RAM. Could you please enable it via menuconfig, and check if it solves the issue?

@Shivi-6
Copy link
Author

Shivi-6 commented Jul 5, 2024

I tried enabling the option in menuconfig but the build failed. With the help of "https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/performance/ram-usage.html#optimizing-iram-usage" this document, I changed some configurations and the build succeeded. But now there's a different error while monitoring. Attaching the log :
idf_py_stdout_output_new.pdf

@vikramdattu
Copy link
Contributor

Can you share more details? Where exactly the crash is happening? You may want to enable Invoke GDB Stub on Panic option and check the backtrace.

Do you have any changes of your own which would lead to the crash?

@Shivi-6
Copy link
Author

Shivi-6 commented Jul 8, 2024

No I do not have any changes of my own. I was just simply flashing the matter_controller example in rainmaker sdk to my esp32 board. The only change I have done is in the partition table because the 2 partitions (each of 2 MB) were not sufficient for the binary (2.1 MB) so I created a single one.
partitions.csv

Can you please guide me about the steps that I need to take to crrectly work with the controller example.

@Shivi-6
Copy link
Author

Shivi-6 commented Jul 8, 2024

Steps for configuration.pdf
These are the steps I tried for flashing the controller example in ESP32

@vikramdattu
Copy link
Contributor

Hi @Shivi-6 please increase FreeRTOS Timer task stack size by 2K and let me know if the problem persists.
You can do this via menuconfig.

idf.py menuconfig > Component config > FreeRTOS > Kernel > configTIMER_TASK_STACK_DEPTH
Do set this number to 4K.

@Shivi-6
Copy link
Author

Shivi-6 commented Jul 8, 2024

configTIMER_TASK_STACK_DEPTH was already configured to 8192. I still tried with 4K and in both the cases, the error is still there. @vikramdattu can you please confirm if the steps mentioned in #319 (comment) are correct. I just want to make sure if I am going in the right direction

@Shivi-6
Copy link
Author

Shivi-6 commented Jul 19, 2024

Update : @vikramdattu I changed the board and now using an ESP32 with 16 MB flash but the ssl/tls error is still there..
Please let me know what can be done

@vikramdattu
Copy link
Contributor

Hi @Shivi-6 the issue has nothing to do with the flash. Can you try very large CONFIG_TIMER_TASK_STACK_DEPTH? 16KB maybe?
The issue is clearly, the stack is not sufficient. Do you have some custom code added in the callback which might be causing the issue?

@Shivi-6
Copy link
Author

Shivi-6 commented Jul 23, 2024

Hi @vikramdattu , after changing the hardware, the stack overflow error is not there, but I am still getting errors related to MQTT saying "Failed to Initialise MQTT". How can I solve this issue? Or can I disable MQTT and connect locally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants