Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] Exception: 'NoneType' object has no attribute 'recv'

Under certain circumstances I get the following exception in loop_forever
I then disconnect, re-create the client and connect and again.
However, it seems the old connection is maintained as i get the constant Connecting/disconnecting that is symptomatic of multiple connections with the same clientid

Unfortunately I can't get the exception to happen locally.
It's running on Python 2.7.3 (OpenWRT) 

Is there any better way to restart after this error?


Exception: 'NoneType' object has no attribute 'recv'
 self.client.loop_forever(retry_first_connection=True)
  File "/usr/lib/python2.7/site-packages/paho/mqtt/client.py", line 1261, in loop_forever
    rc = self.loop(timeout, max_packets)
  File "/usr/lib/python2.7/site-packages/paho/mqtt/client.py", line 811, in loop
    rc = self.loop_read(max_packets)
  File "/usr/lib/python2.7/site-packages/paho/mqtt/client.py", line 1073, in loop_read
    rc = self._packet_read()
  File "/usr/lib/python2.7/site-packages/paho/mqtt/client.py", line 1407, in _packet_read
    command = self._sock.recv(1)"

Back to the top