Mg_ssl_if_mbedtls is blocking



We develop a firmware for controlling RGB lamp. It is based on esp8266. Lamp can be controlled using IR remote controller or via wifi / MQTT.

The problem is that while mos is doing MQTT connection then device doesn’t respond to IR remote controller because it is blocked by computing some elliptic curve:

[Jan  9 09:16:48.806] mg_ssl_if_mbedtls.c:35  0x3fff316c ciphersuite: TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256
[Jan  9 09:16:49.767] SW ECDH curve 3

This takes couple of seconds and makes bad user experience on controlling the device. Is there a way to workaround this problem?


Well, not really.
Mongoose OS uses NonOS SDK, where any task can grab a CPU.
The real solution would be to switch to the RTOS based SDK.
In your case, only workarounds are possible - like connect in advance and keep the connection in a background.

1 Like