AttributeError: 'MQTTClient' object has no attribute '_send_str'



  • Here is something strange that I just can't wrap my mind around. I am using the stock umqtt.robust and everything works fine for a couple hours. Then all of the sudden I get below exception. Once code exits into REPL, I can verify that '_send_str' is an attribute of my MQTTClient instance.

    Thoughts?

    File "L99_MQTT.py", line 36, in publish
      File "/flash/lib/umqtt/robust.py", line 56, in publish
      File "/flash/lib/umqtt/robust.py", line 54, in publish
      File "/flash/lib/umqtt/simple.py", line 124, in publish
    AttributeError: 'MQTTClient' object has no attribute '_send_str'
    Pycom MicroPython 1.18.2.r7 [v1.8.6-849-df9f237] on 2019-05-14; LoPy4 with ESP32
    
    >>> dir(_mqtt._client)
    ['after_connect', 'DELAY', 'delay', 'subscribe', '__qualname__', 'reconnect', '__init__', 'DEBUG', 'connect', 'check_msg', 'publish', 'log', 'wait_msg', '__module__', 'ssl', '_subscriptions', 'user', 'port', '_on_reconnect', 'lw_qos', 'pid', 'client_id', 'keepalive', 'pswd', 'lw_msg', 'server', 'sock', 'lw_retain', 'ssl_params', 'cb', 'lw_topic']
    
    >>> getattr(_mqtt._client, '_send_str')
    <bound_method>
    

Log in to reply
 

Pycom on Twitter