ARMmbed / mbed-os-example-for-aws

Mbed OS example to connect to AWS IoT Core
Apache License 2.0
15 stars 21 forks source link

Timeout problem #18

Open sglee-huconn opened 4 years ago

sglee-huconn commented 4 years ago

In the example, a publish is executed up to 10 times. but for testing, I modified the loop to be infinite and not to go out of the loop as in the following code.

    for (uint32_t i = 0; ;i++) {
        // - for i in 0..9
        //  - wait up to 1 sec
        //  - if no message received Publish: "You have %d sec remaining to say hello...", 10-i
        //  - other wise, exit
        // if (wait_sem.try_acquire_for(1000)) {
        //     break;
        // }

        time(&ts);

        static char message[2048];
        snprintf(message, 2048, \
        "{\"timestamp\":\"%"PRIu64"\",\"int\":\"%"PRIi32"\",\"unsigned\":\"%"PRIu32"\"}" \
        , ts, -1, i \
        );
    ....
        auto pub_status = IotMqtt_PublishSync(connection, &publish,
                                              /* flags */ 0, /* timeout ms */ MQTT_TIMEOUT_MS);
        if (pub_status != IOT_MQTT_SUCCESS) {
            tr_warning("AWS Sdk: failed to publish message with %u.", pub_status);
        }

        ThisThread::sleep_for(500);
   }

at first, it runs well. but after some time, it emits a timeout error or a socket error.

when QoS1 is set, I found the following truth. in a normal state, the socket reads 33, 95 bytes in turn while in the timeout situation it reads 128 bytes at once

mbed_awsiot_err1

when I set QoS to 0, It isn't timed out but after a while, it eventually shows socket error and isn't recovered.

mbed_awsiot_err2

i am testing with STM DISCO IOT01A board though Wifi.

ciarmcom commented 4 years ago

@sglee-huconn thank you for raising this issue.Please take a look at the following comments:

Could you add some more detail to the description? A good description should be at least 25 words. What target(s) are you using? What toolchain(s) are you using? What version of Mbed OS are you using (tag or sha)? It would help if you could also specify the versions of any tools you are using? How can we reproduce your issue?

NOTE: If there are fields which are not applicable then please just add 'n/a' or 'None'.This indicates to us that at least all the fields have been considered. Please update the issue header with the missing information, the issue will not be mirroredto our internal defect tracking system or investigated until this has been fully resolved.

ciarmcom commented 4 years ago

@sglee-huconn it has been 5 days since the last reminder. Could you please update the issue header as previously requested?

ciarmcom commented 4 years ago

@sglee-huconn it has been 5 days since the last reminder. Could you please update the issue header as previously requested?

ciarmcom commented 3 years ago

@sglee-huconn it has been 5 days since the last reminder. Could you please update the issue header as previously requested?

ciarmcom commented 3 years ago

@sglee-huconn it has been 5 days since the last reminder. Could you please update the issue header as previously requested?

ciarmcom commented 3 years ago

@sglee-huconn it has been 5 days since the last reminder. Could you please update the issue header as previously requested?

ciarmcom commented 3 years ago

@sglee-huconn it has been 5 days since the last reminder. Could you please update the issue header as previously requested?

ciarmcom commented 3 years ago

@sglee-huconn it has been 5 days since the last reminder. Could you please update the issue header as previously requested?

ciarmcom commented 3 years ago

@sglee-huconn it has been 5 days since the last reminder. Could you please update the issue header as previously requested?

ciarmcom commented 3 years ago

@sglee-huconn it has been 5 days since the last reminder. Could you please update the issue header as previously requested?

ciarmcom commented 3 years ago

@sglee-huconn it has been 5 days since the last reminder. Could you please update the issue header as previously requested?

ciarmcom commented 3 years ago

@sglee-huconn it has been 5 days since the last reminder. Could you please update the issue header as previously requested?

ciarmcom commented 3 years ago

@sglee-huconn it has been 5 days since the last reminder. Could you please update the issue header as previously requested?

ciarmcom commented 3 years ago

@sglee-huconn This issue has an incomplete or old issue template.For future reference please use an up to date clone of the repository before raising issues. Many thanks.

ciarmcom commented 3 years ago

Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers. Internal Jira reference: https://jira.arm.com/browse/IOTOSM-3117