Hi everyone,
An new to upython. By the moment Im getting stuck with this error:
assertion "0" failed: file "../py/../extmod/modussl_mbedtls.c", line 150, function: socket_new
abort() was called at PC 0x40136397 on core 0
I guess there is not response from the server, but again Im guessing.
Any directions recommended?
Regards,
Asertion error
Re: Asertion error
It's not a conection problem. Assertion errors are used mostly to indicate 'things which should never happen' which possibly translates in 'programmer mistakes'. In this case, there's a function mbedtls_ssl_setup which does not return 0 and that is not expected. According to the documentation, mbedtls_ssl_setup either returns 0 or MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed. So that is your problem likely: out of memory.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Asertion error
@droidwarrior The ESP32 port is under heavy development and it's possible that SSL/TLS is not yet fully proven. I suggest you reduce your code to a minimal code sample which produces the error and post it here. Then hopefully the assorted networking gurus will figure out whether you've uncovered a bug and, if so, report it to the developers.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 4
- Joined: Mon Aug 07, 2017 6:11 pm
Re: Asertion error
Hi,
@stijn: Already verify available memory at the moment of urequest using HTTPS and no resource exhaustion
@pythoncoder: Thanks for your answer. Im using Timer1 to poll a HTTPS urequest. Is it possible Timer1 int crash a MBEDTLS hashing or somethong in process?
Regards,
@stijn: Already verify available memory at the moment of urequest using HTTPS and no resource exhaustion
@pythoncoder: Thanks for your answer. Im using Timer1 to poll a HTTPS urequest. Is it possible Timer1 int crash a MBEDTLS hashing or somethong in process?
Regards,
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Asertion error
There are precautions which are necessary when writing interrupt handlers. The best way is to have the interrupt handler call your routine using schedule.
I suggest you read this guide to writing interrupt handlers http://docs.micropython.org/en/latest/e ... rules.html.
Code: Select all
from micropython import schedule
from machine import Timer
def rats(_):
print('rats') # This is your function
t = Timer(-1)
t.init(period=2000, mode=Timer.PERIODIC, callback=lambda _ : schedule(rats, 1))
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.