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 Connection Settings to be included in the configuration #458

Closed
rOY369 opened this issue Jun 13, 2024 · 2 comments
Closed

MQTT Connection Settings to be included in the configuration #458

rOY369 opened this issue Jun 13, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@rOY369
Copy link

rOY369 commented Jun 13, 2024

Problem
After every 20 minutes, the client is getting disconnected from the AWS IoT endpoint with this error and then getting reconnected

 2024-06-13T04:29:10.601Z [ERROR] {SharedCrtResourceManager.cpp}: MQTT Connection interrupted with error: `libaws-c-mqtt: AWS_ERROR_MQTT_TIMEOUT, Time limit between request and response has been exceeded.`. Device Client will retry connection until it is successfully connected to the core.

Setup

  • Version: v1.8.28-95db8c9
  • Running aws-iot-device-client as systemd service meant to be connected continuously with AWS IoT endpoint
  • Configuration
{
    "cert": "/home/pi/.certs/aws/cert.crt",
    "config-shadow": {
        "enabled": false
    },
    "device-defender": {
        "enabled": false,
        "interval": 300
    },
    "endpoint": "****.amazonaws.com",
    "fleet-provisioning": {
        "csr-file": "",
        "device-key": "",
        "enabled": false,
        "template-name": "",
        "template-parameters": ""
    },
    "jobs": {
        "enabled": false,
        "handler-directory": "/home/pi/.aws-iot-device-client/jobs"
    },
    "key": "/home/pi/.certs/aws/private.key",
    "logging": {
        "enable-sdk-logging": false,
        "file": "",
        "level": "INFO",
        "sdk-log-file": "",
        "sdk-log-level": "TRACE",
        "type": "STDOUT"
    },
    "root-ca": "",
    "sample-shadow": {
        "enabled": false,
        "shadow-input-file": "",
        "shadow-name": "",
        "shadow-output-file": ""
    },
    "samples": {
        "pub-sub": {
            "enabled": false,
            "publish-file": "",
            "publish-topic": "",
            "subscribe-file": "",
            "subscribe-topic": ""
        }
    },
    "thing-name": "controller-2792",
    "tunneling": {
        "enabled": true
    }
}

Request

  • I looked and found that changing the default keepAlive and reconnectTimeout connection settings can fix this but I could not find these options in the cli help or the template config.json
  • It will be great if we can configure these options.
  • Also, more help on how to solve this issue will be appreciated.

More Context

  • Whenever the client is disconnected, the AWS IoT thing's activity reports the following disconnect event with DUPLICATE_CLIENTID error message but I have confirmed that only one such client exists.
{
  "clientId": "controller-2792",
  "timestamp": 1718255408160,
  "eventType": "disconnected",
  "clientInitiatedDisconnect": false,
  "sessionIdentifier": "661f679d-986e-4441-a0ff-3ae5860b40a4",
  "principalIdentifier": "335c703c30dfd2407742a52f233caa9a4fe50c315a24c1f4ab073bef45138a24",
  "disconnectReason": "DUPLICATE_CLIENTID",
  "versionNumber": 2605
}

Thank you!

@rOY369 rOY369 added the enhancement New feature or request label Jun 13, 2024
@HarshGandhi-AWS
Copy link
Contributor

Hello @rOY369 , thank you for reaching out to us and thank you for sharing this finding with us on changing default connection setting from keepAlive and reconnectTimeout. Yes, right now we do not have any CLI option to set this connection property.
Device Client is an community project where we encourage our opensource community to contribute. We would encourage you to cut us a PR with this change so we can review and merge the change.
If that is something not possible for you right now, then please be patient with us until team works on adding this enhancement. It might take some time since we are swamped with other PR and bug fixes right now.

Thank you for being patient with us.
Regards,
Harsh Gandhi

@HarshGandhi-AWS
Copy link
Contributor

Hello @rOY369 , I am closing this ticket now since we are internally tracking this future enhancement separately. Thank you again for your enhancement request and also feel free to make a code change to contribute in this community.

Regards,
Harsh Gandhi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants