You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Describe the issue **
The MQTT connector configuration "attributeRequests" section allows us to get attributes from devices in TB.
From the doc :
"In order to request client-side or shared device attributes to ThingsBoard server node, Gateway allows sending attribute requests."
However client attribute requests are not returned because the connector only calls shared attributes.
The use case is that we're trying to get the MACAddress , a client attribute usually, because we're using espnow protocol to directly send data to esp-devices. Substituting device name with mac address would need an additional table to be maintained
A quick workaround is just to add the self.__gateway.tb_client.client.gw_request_client_attributes call in the mqtt_connector.py
This will result in 2 calls made , one of them will not return data and not produce an MQTT message.
A proper improvement would probably be similar to what is implemented in SOCKET connector
if len(device['attributeRequests']):
self.__attribute_type = {
'client': self.__gateway.tb_client.client.gw_request_client_attributes,
'shared': self.__gateway.tb_client.client.gw_request_shared_attributes
}
Connector name (If bug in the some connector):
MQTT
Error traceback (If available):
Program :mqtt_connector.py
Method : _process_on_message
Line :692
Thank you for your interest in ThingsBoard IoT Gateway.
We have added ability to request client attributes in MQTT connector, to do this you can use "scope" parameter in configuration or in the incoming message. Expected values for "scope" - "client"/"shared".
**Describe the issue **
The MQTT connector configuration "attributeRequests" section allows us to get attributes from devices in TB.
From the doc :
"In order to request client-side or shared device attributes to ThingsBoard server node, Gateway allows sending attribute requests."
However client attribute requests are not returned because the connector only calls shared attributes.
The use case is that we're trying to get the MACAddress , a client attribute usually, because we're using espnow protocol to directly send data to esp-devices. Substituting device name with mac address would need an additional table to be maintained
This will result in 2 calls made , one of them will not return data and not produce an MQTT message.
Connector name (If bug in the some connector):
MQTT
Error traceback (If available):
Program :mqtt_connector.py
Method : _process_on_message
Line :692
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: