SMTP Email Client issue
Posted: Sat Jan 16, 2021 7:20 pm
Hi All,
I have a project which initialises wifi on the main thread then creates an email task which looks for messages on a queue and sends via email. The email task is the smtp_client_example code.
Sometimes this works fine but when I change unrelated code it seems to fail with "mbedtls_ssl_read failed with error -0x7200" and sometimes -0x7100. The failure is in write_ssl_and_get_response when it calls mbedtls_ssl_read.
I suspect this is a threading/ task corruption issue so wanted to check whether in principle this should be fine i.e. initialising wifi in the main thread and doing the smpt email in another? I assume that xQueueSend takes a copy of the data so where the data is stored before calling it shouldn't matter?
Thanks in advance for your help
Lee.
I have a project which initialises wifi on the main thread then creates an email task which looks for messages on a queue and sends via email. The email task is the smtp_client_example code.
Sometimes this works fine but when I change unrelated code it seems to fail with "mbedtls_ssl_read failed with error -0x7200" and sometimes -0x7100. The failure is in write_ssl_and_get_response when it calls mbedtls_ssl_read.
I suspect this is a threading/ task corruption issue so wanted to check whether in principle this should be fine i.e. initialising wifi in the main thread and doing the smpt email in another? I assume that xQueueSend takes a copy of the data so where the data is stored before calling it shouldn't matter?
Thanks in advance for your help
Lee.