micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

AttributeError: 'TBDeviceMqttClient' object has no attribute '__name__'

Open sahil06habile opened this issue 5 years ago • 1 comments

import network from uthingsboard.client import TBDeviceMqttClient

sta_if = network.WLAN(network.STA_IF) ap_if = network.WLAN(network.AP_IF)

ap_if.active(False) sta_if.active(True) sta_if.connect('Sahil', '12345678')

while not sta_if.isconnected(): pass print("connected to internet")

See examples for more authentication options

client = TBDeviceMqttClient('X.X.X.X', access_token='shgfisfwfiwufhweh', port = 1883)

Connecting to ThingsBoard

print("connecting") client.connect() print("connected")

Sending telemetry

telemetry = {'New': 458, 'enabled': True} client.send_telemetry(telemetry)

Checking for incoming subscriptions or RPC call requests (non-blocking)

client.check_msg()

Disconnecting from ThingsBoard

client.disconnect()

getting this error while running this code.

File "main.py", line 19, in File "/lib/uthingsboard/client.py", line 89, in connect File "/lib/uthingsboard/client.py", line 248, in _log AttributeError: 'TBDeviceMqttClient' object has no attribute 'name'

sahil06habile avatar Oct 06 '21 10:10 sahil06habile

There is no uthingsboard module or TBDeviceMqttClient code here in this repository. Most likely the module in use was from https://github.com/manuargue/thingsboard-micropython - and issues with the module should be directed there.

jonnor avatar Aug 25 '24 10:08 jonnor