aws iot disconnect event when publishing to $aws/certificates/create/json

Hello, currently developing software for 9160 and integrate to aws iot core using your aws_iot library..  All the interactions with aws have been working so far, but whenever i publish on $aws/certificates/create/json i get a disconnect event, the device has every permission in aws. The logs on aws side show that the publish is a success and the response on aws/certificates/create/json/accepted is a success. The next event is then a disconnect with reason "connection_lost". 

The device will then try to reconnect but keeps on failing with aws_iot_connect, error -119 (which i believe map to connection already in progress?). Any tips to what might cause this? The aws event handling is quite similar to the one proposed in the aws_iot sample.  

I am using nrf connect 2.1.2

 

Parents
  • Hi,

    All the interactions with aws have been working so far, but whenever i publish on $aws/certificates/create/json i get a disconnect event,

    Do you get a socket error, or an MQTT disconnect packet?

    The logs on aws side show that the publish is a success and the response on aws/certificates/create/json/accepted is a success.

    How large is the message sent from AWS in this case?

    The device will then try to reconnect but keeps on failing with aws_iot_connect, error -119 (which i believe map to connection already in progress?). Any tips to what might cause this? The aws event handling is quite similar to the one proposed in the aws_iot sample.  

    Did you close the socket/call aws_disconnect before you tried to re-connect?

    Best regards,

    Didrik

  • The event i was referring to was a mqtt disconnect event in the aws logs with reason CONNECTION_LOST. 

    The error messages i get in the nrf terminal right after the diconnect event are "aW: connection_poll_start failed, error: -119" and "aws_iot_connect, error: -119" and "ws_iot_send, error: -122" 

    The json sent from aws is around 3500 bytes- I have set CONFIG_AWS_IOT_MQTT_RX_TX_BUFFER_LEN=8192

    I did not call aws_disconnect before trying to reconnect- the reconnect is scheduled from a disconnect event. The issue persist when calling aws_disconnect from the disconnect event before trying to reconnect.  

    Best regards. 

  • What I am trying to do is simply provisioning new certificates by claim, as described in docs.aws.amazon.com/.../provision-wo-cert.html

  • I will have to look more into the error you get when you try to reconnect tomorrow, but the original disconnect is expected.

    The TLS buffers in the modem are ca. 2,3kB large, so larger TLS fragments cannot be decoded. So if a too large TLS fragment is received, the modem will close the connection.

Reply Children
Related