Skip to content

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

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

Closed
fcojocaru opened this issue Feb 8, 2018 · 1 comment

Comments

@fcojocaru
Copy link

fcojocaru commented Feb 8, 2018

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!

@brentru
Copy link
Member

brentru commented Oct 17, 2019

This should be fixed in the latest ESP8266 Arduino library (esp8266/Arduino#4078).

@brentru brentru closed this as completed Oct 17, 2019
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