question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebSocket connection to 'wss://a85xxxxxxxx.iot.us-west-1.amazonaws.com/mqtt?....' failed

See original GitHub issue

Hello All,

I am facing some weird issues when the reconnection workflow is executed.

“aws-iot-device-sdk”: “^2.2.1”,

MQTT connection successfully established with AWS IoT.

When UI is idle it starts to reconnect workflow.

But unfortunately, it didn’t get succeed and continuously retry after some time.

I can not find any reason for such behavior from error.

When I searched for a similar issue I can see for others it shows errors like handshake failure etc.

image psd

My connection configuration looks like(Angular 6):

var awsIot = require('aws-iot-device-sdk'); this.iotDevice = new awsIot.device({ host: <Endpoint>, clientId: <clientId>, accessKeyId:<accessKeyId>, secretKey: <secretAccessKey>, sessionToken: <sessionToken>, protocol: 'wss', baseReconnectTimeMs: 1000, debug: false });

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jmklixcommented, Sep 15, 2021

@harshkoralwala glad you where able to fix your problem!

@heyralfs hopefully your problem was solved, but if it wasn’t please open a new ticket detailing your specific problem.

1reaction
harshkoralwalacommented, Sep 15, 2021

@jmklix @heyralfs

The issue was with local storage. My application was clearing all local storage data on some activity. So it looks like for the re-connect scenario, the module needs some stored data from local storage. After not removing local storage data, the Same issue was not found.

Hope this helps

Read more comments on GitHub >

github_iconTop Results From Across the Web

Websocket connection failed · Issue #259 · aws/aws-iot-device ...
I am using the SDK on the client side, and connecting to my AWS IoT endpoint via the wss protocol, using Cognito as...
Read more >
WebSocket connection to <AWS IoT Url> failed: EMPTY
Found out that my AWS IoT IAM credentials were invalid so I was unable to properly connect to the cloud. If the developers...
Read more >
Diagnosing connectivity issues - AWS IoT Core
A successful connection to AWS IoT requires: A valid connection. A valid and active certificate. A policy that allows the desired connection and...
Read more >
Using MQTT Over WebSockets with Mosquitto
How does it work and what is better MQTT or MQTT over websockets? ... I am unable to connect to the (Mosquitto) broker...
Read more >
Connect to MQTT broker with Websocket - EMQ
This article will demonstrate how to use WebSocket to connect to ... This service was created based on the EMQX MQTT IoT cloud...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found