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.

MQTT Error when listening for messages

See original GitHub issue

Description of the problem

When I try to listen to messages, I get this every few seconds:

MQTT Error: A network protocol error occurred when communicating with the broker.
Got exception while listening
NoneType: None

Code to reproduce

echobot

Environment information

  • python3.7.5
  • fbchat version 1.9.1

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
JarbasAlcommented, Jan 7, 2020

i am having exactly same issue

potentially useful info:

  • connecting from Portugal
  • newly created account
  • installed by pip
  • v1.9.1
  • echobot example
  • xubuntu

not pasting logs because i’m getting same output as @Strafos

1reaction
gave92commented, Jan 7, 2020

Issue seems to be that no cookies are passed when creating the mqtt websocket. It works for me when I change this to

def get_cookie_header(session, host):
    """Extract a cookie header from a requests session."""
    return ";".join(f"{key}={value}"
             for key, value in session.cookies.get_dict().items())
Read more comments on GitHub >

github_iconTop Results From Across the Web

MQTT Error when listening for messages · Issue #495 - GitHub
Description of the problem When I try to listen to messages, I get this every few seconds: MQTT Error: A network protocol error...
Read more >
Go MQTT client stops listening new messages after receiving ...
I have a Paho MQTT GO client that listens to the broker. After around 2400-2500 messages, it stops listening to the new messages....
Read more >
Sending and Receiving Messages with MQTT - EV3Dev
A very simple script to publish a message: #!/usr/bin/env python3 import paho.mqtt.client as mqtt # This is the Publisher client = mqtt.Client() ...
Read more >
Fail to Connecty to MQTT - The Things Stack v3
I have a Arduino that is connected over LoraWan to a TTN via a gateway, and I then have a script running to...
Read more >
View MQTT messages with the AWS IoT MQTT client
If your messages are not showing up in the message log as you expect, try subscribing to a wild card topic filter as...
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