Skip to content
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

MQTT with TLS, disconnected after some time (IDFGH-14465) #15239

Open
3 tasks done
stdenits opened this issue Jan 20, 2025 · 0 comments
Open
3 tasks done

MQTT with TLS, disconnected after some time (IDFGH-14465) #15239

stdenits opened this issue Jan 20, 2025 · 0 comments
Labels
Status: Opened Issue is new

Comments

@stdenits
Copy link

stdenits commented Jan 20, 2025

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Hello.

I'm using ESP32S3 and ESP-IDF (master branch) with VSCode.

I encountered the fact that after some time (15-30 minutes) after connecting to the MQTT broker with the SSL certificate, the connection is broken and the client can no longer connect. Even after restarting the MQTT client.
After rebooting the device, the client reconnects as if nothing happened.

E (1577065) transport_base: esp_tls_conn_write error, errno=No more processes
E (1577065) mqtt_client: Writing failed: errno=11
I (1577065) MQTT: MQTT_EVENT_ERROR
I (1577065) MQTT: Last errno string 0 (Success)
E (1577065) mqtt_client: Error to resend data 
I (1577075) MQTT: MQTT_EVENT_DISCONNECTED
W (1577075) MQTT: MQTT connection retry: 1
W (1577085) mqtt_client: Publish: Losing qos0 data when client not connected
I (1587085) MQTT: Other event id:7
E (1587595) esp-aes: Failed to allocate memory
E (1587595) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x4301
I (1587595) esp-tls-mbedtls: Certificate verified.
E (1587595) esp-tls: Failed to open new connection
E (1587605) transport_base: Failed to open a new connection
E (1587605) mqtt_client: Error transport connect
I (1587615) MQTT: MQTT_EVENT_ERROR
E (1587615) MQTT: Last error reported from esp-tls: 0x801a
E (1587625) MQTT: Last error reported from tls stack: 0x4301
I (1587625) MQTT: Last errno string 0 (Success)
I (1587625) MQTT: MQTT_EVENT_DISCONNECTED
W (1587635) MQTT: MQTT connection retry: 2
I (1602635) MQTT: Other event id:7

On the MQTT broker side, during an attempt to reconnect the MQTT client, an error is returned:

OpenSSL Error[0]: error:0A000126:SSL routines::unexpected eof while reading

I have attached logs with and without debug information.

log wo dbg info.txt
mbed tls debug log.txt
Image

@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 20, 2025
@github-actions github-actions bot changed the title MQTT with TLS, disconnected after some time MQTT with TLS, disconnected after some time (IDFGH-14465) Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

2 participants