Skip to content

AdafruitIO_WiFi: start_ssl_client() goes in infinite loop if the AP disconnects #20

Closed
@fcojocaru

Description

@fcojocaru

Arduino board: Adafruit HUZZAH32 – ESP32 Feather Board
Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.5

Story:
I am using the Adafruit IO Temperature & Humidity Example , slightly modified ( see below )

  1. Temperature and humidity come from a BME280 so the include looks like:
    ===
#include "config.h"

#include <stdint.h>
#include "SparkFunBME280.h"
//Library allows either I2C or SPI, so include both.
#include "Wire.h"

===

Issue:
A variable number of minutes after powering up the board ( but rarely longer than 30 ) the WIFI disconnects ( or the AP gets bored ).

This triggers a loop
===still working===

Temperature: 25.34C
Pressure: 102410.58Pa
[V][ssl_client.cpp:240] send_ssl_data(): Writing HTTP request...
[V][ssl_client.cpp:240] send_ssl_data(): Writing HTTP request...

===failed===

Temperature: 25.33C
Pressure: 102410.80Pa
[V][ssl_client.cpp:240] send_ssl_data(): Writing HTTP request...
[V][ssl_client.cpp:240] send_ssl_data(): Writing HTTP request...
[E][ssl_client.cpp:28] handle_error(): UNKNOWN ERROR CODE (004E)
[E][ssl_client.cpp:30] handle_error(): MbedTLS message code: -78
[V][ssl_client.cpp:209] stop_ssl_socket(): Cleaning SSL connection.
[V][ssl_client.cpp:48] start_ssl_client(): Free heap before TLS 51080
[V][ssl_client.cpp:50] start_ssl_client(): Starting socket
[V][ssl_client.cpp:86] start_ssl_client(): Seeding the random number generator
[V][ssl_client.cpp:95] start_ssl_client(): Setting up the SSL/TLS structure...
[I][ssl_client.cpp:119] start_ssl_client(): WARNING: Use certificates for a more secure communication!
[V][ssl_client.cpp:143] start_ssl_client(): Setting hostname for TLS session...
[V][ssl_client.cpp:158] start_ssl_client(): Performing the SSL/TLS handshake...
[E][ssl_client.cpp:28] handle_error(): RSA - The public key operation failed : BIGNUM - Memory allocation failed
[E][ssl_client.cpp:30] handle_error(): MbedTLS message code: -17040
[E][WiFiClientSecure.cpp:108] connect(): lwip_connect_r: 11
[V][ssl_client.cpp:209] stop_ssl_socket(): Cleaning SSL connection.
[V][ssl_client.cpp:48] start_ssl_client(): Free heap before TLS 50724
[V][ssl_client.cpp:50] start_ssl_client(): Starting socket
[V][ssl_client.cpp:86] start_ssl_client(): Seeding the random number generator
[V][ssl_client.cpp:95] start_ssl_client(): Setting up the SSL/TLS structure...
[I][ssl_client.cpp:119] start_ssl_client(): WARNING: Use certificates for a more secure communication!
[V][ssl_client.cpp:143] start_ssl_client(): Setting hostname for TLS session...
[V][ssl_client.cpp:158] start_ssl_client(): Performing the SSL/TLS handshake...
[E][ssl_client.cpp:28] handle_error(): RSA - The public key operation failed : BIGNUM - Memory allocation failed
[E][ssl_client.cpp:30] handle_error(): MbedTLS message code: -17040
[E][WiFiClientSecure.cpp:108] connect(): lwip_connect_r: 11

======

Question:
Is the lower layer supposed to handle this exceptions or is the job of the upper layer libraries to treat these and trigger a reset / reconnect to wifi?

The way it looks to me ( I'm new to this so I apologize in advance ) is that a WiFi exception is never triggered and WiFiClientSecure starts looping without an exit condition ( aka 10 retries ).

Again , if this is the wrong place to open the issue , I apologize.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions