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.

Not reciving messages after a while

See original GitHub issue

Hello, I’m experiencing some issue with this library

I have a node.js app running on a Raspberry Pi. The connection is done successfully and I can send / receive messages, but after a while (sometimes 20 minutes, sometimes 4 hours), I stop receiving messages.

I’m running this application in several machines and not all of them experience the same issue. Also, when I stop receiving messages, after a restart, the app communicates successfully again (which indicates that it’s not a network related issue)

Can you point me on how can I debug this? Thanks in advance

"aws-iot-device-sdk": "2.2.0" node --version: 8.10.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
matiasdecarlicommented, May 21, 2018

Ok finally found the issue & solution for this

The issue that I was having was: the messages not been posted on AWS IoT due to a faulty network. Since the messages didn’t have a timeout set, I was realizing after a long time that the messages were failing. To solve this, I just set keepalive: 10. After 10 seconds if the messages didn’t have the PUBACK, an error is trigged, and the reconnection is attempted

(I’m also using qos: 1)

After doing this, the library works as a charm. Thanks for the help @fengsongAWS

0reactions
matiasdecarlicommented, May 18, 2018

I am already using the qos:1, yes.

Regarding the lost connection, I can see locally that after the app starts & connect, if I turn off the wifi, the iot doesn’t realize that the messages are not being sent. Is there any way to detect this sooner? After I turn off the connection, all the publish messages stop reaching the callback

device.publish('<Topic>', JSON.stringify(payload), {
      qos: 1
    }, function (err, resp) {
      // never reach this part
    })
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix It When You're Not Receiving Texts on Android
How to Fix Androids Not Receiving Texts · Check for blocked numbers. · Check the network connection. · Disable Airplane mode. · Reboot...
Read more >
Not receiving text on your phone: Here's how to fix - India Today
Steps to follow when Android is not receiving text messages: · Reboot your phone · Check the reception · Clear the cache from...
Read more >
Fix problems sending, receiving or connecting to Messages
Fix problems sending or receiving messages from specific contacts. Delete the contact and add it again. Check if you blocked them. Verify that...
Read more >
How to Fix Phone Not Receiving Text Messages - Alphr
Reboot your phone. · Check service provider reception. · Check old messaging threads. · Clear the cache from your text app. · Remove...
Read more >
If you can't send or receive messages on your iPhone or iPad
If you're in a group message and stop receiving messages, check to see if you left the conversation. Open Messages and tap the...
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