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

Publish failed! Error NETWORK_SSL_WRITE_ERROR = -7 #6

Open
edChori opened this issue Mar 2, 2018 · 2 comments
Open

Publish failed! Error NETWORK_SSL_WRITE_ERROR = -7 #6

edChori opened this issue Mar 2, 2018 · 2 comments

Comments

@edChori
Copy link

edChori commented Mar 2, 2018

Hi,

I'm using BLE and WIFI simultaneously, the device connects to AWS and successfully posts 2 MQTT messages but when sending the 3rd one it stops working. The error I get is E (122946) aws_iot: failed! mbedtls_ssl_write returned -0x5.
Log trace: Publish failed! Error NETWORK_SSL_WRITE_ERROR = -7
Free memory: 28348

the implemented logic is:

  1. Scan BLE device
  2. Connect to WiFi
  3. Connect to AWS
  4. Find BLE Device
  5. Publish data

FUNC_ENTRY: aws_iot_mqtt_publish L#272
DEBUG: aws_iot_mqtt_publish L#273 /voronich/0/reports
FUNC_ENTRY: aws_iot_mqtt_is_client_connected L#235
FUNC_EXIT: aws_iot_mqtt_is_client_connected L#266 Return Code : 1
FUNC_ENTRY: aws_iot_mqtt_get_client_state L#55
FUNC_EXIT: aws_iot_mqtt_get_client_state L#60 Return Code : 3
FUNC_ENTRY: aws_iot_mqtt_set_client_state L#102
FUNC_ENTRY: aws_iot_mqtt_client_lock_mutex L#65
FUNC_EXIT: aws_iot_mqtt_client_lock_mutex L#83 Return Code : 0
FUNC_ENTRY: aws_iot_mqtt_get_client_state L#55
FUNC_EXIT: aws_iot_mqtt_get_client_state L#60 Return Code : 3
FUNC_EXIT: aws_iot_mqtt_set_client_state L#127 Return Code : 0
FUNC_ENTRY: _aws_iot_mqtt_internal_publish L#205
FUNC_ENTRY: _aws_iot_mqtt_internal_serialize_publish L#97
FUNC_ENTRY: aws_iot_mqtt_internal_init_header L#189
FUNC_EXIT: aws_iot_mqtt_internal_init_header L#264 Return Code : 0
FUNC_ENTRY: aws_iot_mqtt_internal_write_len_to_buffer L#60
FUNC_EXIT: aws_iot_mqtt_internal_write_len_to_buffer L#71 Return Code : 2
FUNC_EXIT: _aws_iot_mqtt_internal_serialize_publish L#132 Return Code : 0
Call _aws_iot_mqtt_internal_serialize_publish : 0
FUNC_ENTRY: aws_iot_mqtt_internal_send_packet L#272
FUNC_ENTRY: aws_iot_mqtt_client_lock_mutex L#65
FUNC_EXIT: aws_iot_mqtt_client_lock_mutex L#83 Return Code : 0
ENABLE_THREAD_SUPPORT call aws_iot_mqtt_client_lock_mutex : 0
E (1503909) aws_iot: failed! mbedtls_ssl_write returned -0x50
Network stack write result: -7
ENABLE_THREAD_SUPPORT call aws_iot_mqtt_client_unlock_mutex : 0
FUNC_EXIT: aws_iot_mqtt_internal_send_packet L#319 Return Code : -1
Call aws_iot_mqtt_internal_send_packet : -1
FUNC_EXIT: _aws_iot_mqtt_internal_publish L#228 Return Code : -1
Call _aws_iot_mqtt_internal_publish : -1
FUNC_ENTRY: aws_iot_mqtt_set_client_state L#102
FUNC_ENTRY: aws_iot_mqtt_client_lock_mutex L#65
FUNC_EXIT: aws_iot_mqtt_client_lock_mutex L#83 Return Code : 0
FUNC_ENTRY: aws_iot_mqtt_get_client_state L#55
FUNC_EXIT: aws_iot_mqtt_get_client_state L#60 Return Code : 5
FUNC_EXIT: aws_iot_mqtt_set_client_state L#127 Return Code : 0
Call aws_iot_mqtt_set_client_state : 0
FUNC_EXIT: aws_iot_mqtt_publish L#301 Return Code : -1

@dimkir
Copy link

dimkir commented Aug 10, 2018

I would be grateful if you can hint of - how did you enable function tracing?

I have noticed that there are trace related macros, aws_iot_log.h, however I cannot find a way to enable them.

  • if i try to #define ENABLE_IOT_TRACE inside of the sketchfile (.ino) - nothing happens
  • if i monkey patch aws_iot_log.h to make those directive available always - I still no output on my Serial Monitor, as printf output goes to nowhere (when I am uploading and running sketch on ESP32 board)

image

Thank you

@rishadali
Copy link

Hello,
I am also seeing this error once the WiFi is turned off it throws this error
E (44829) aws_iot: failed! mbedtls_ssl_write returned -0x4e
and it is unable to reconnect to the WiFi and logging
Publish failed
Did you resolve the issue? Thanks

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

3 participants