This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

mqtt_client_tls_write hangs on writing to TLS socket send(client->transport.tls.sock....)

Hi,

We are using the modem firmware V1.2 and source code ncs v1.2.0.

Problem: we are using the TLS connected socket to amazon cloud and after about 12 minutes of doing:

```

waiting 2 min
connecting to MQTT
sending a few packets
disconnecting from MQTT

```

we get a hang on a specific call out of my reach:
File: mqtt_transport_socket_tls.c

Function: int mqtt_client_tls_write(struct mqtt_client *client, const u8_t *data, u32_t datalen)

Inside the function is a loop and a call here - which the source code isn't revealed for.
ret = send(client->transport.tls.sock, data + offset, datalen - offset, 0);

The last argument - flags - is set to 0 by Nordic, so if there is any problem sending, this call will hang forever.
Linux supports having MSG_DONTWAIT and returncodes to handle situations if they occur but now it's just not working.

We need a fix for this bug.
If the transmit fails, there needs to be a timeout so we can recover and not get hung, which kills the application calling.
If I can produce a trace or whatever needed for this let me know. We are running our custom code so it only works on our custom hw.

/Johan

Parents Reply
  • I'm not sure how to record a modem trace with custom hardware.
    Can you guide how that is done?

    I know you want to have some serial output from the modem over some serial channel, becoming a usb-serial port into the PC - so the software can pick it up.

    In our design, i'm not sure which serial port that needs to be pinned out from the modem - to supply such data outward to the pc going through an usb-converter - also named so your software can recognize it as the modem trace serial channel.

    See the problem with custom hardware vs your sdk kit hw?

Children
Related