Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] BacNet connector broken in version 3.5.2, 3.5.3, 3.5.3.1 #1551

Open
jurkov opened this issue Oct 4, 2024 · 2 comments
Open

[BUG] BacNet connector broken in version 3.5.2, 3.5.3, 3.5.3.1 #1551

jurkov opened this issue Oct 4, 2024 · 2 comments
Assignees
Labels

Comments

@jurkov
Copy link

jurkov commented Oct 4, 2024

Describe the bug
Starting a newly created iot-gateway with docker or native python throws the same error since version 3.5.2.
Version 3.5.1 works fine.

Connector name (If bug in the some connector):
BacNET Connector

Error traceback (If available):

  File "C:\projects\thingsboard-gateway-native\.venv\Lib\site-packages\thingsboard_gateway\connectors\bacnet\bacnet_uplink_converter.py", line 53, in convert
    count=len(dict_result["attributes"]))
              ~~~~~~~~~~~^^^^^^^^^^^^^^
TypeError: string indices must be integers, not 'str'

Versions (please complete the following information):

  • OS: Windows 11 or Docker Image OS
  • Thingsboard IoT Gateway version 3.5.2, 3.5.3, 3.5.3.1
  • Python version 3.11, Python version 3.12 (installed pyasyncore by hand)
@Isac-enerlab
Copy link

Good morning

I'm using Ubuntu 20.04.5 LTS version

Tb_gateway 3.5.1 which was collecting data from a mall plant we have. We have 20 units with telemetry collection, the majority of which are BACnet.

After releasing release 3.5.3, three applications stopped, two we managed to reestablish but 1 presents an error, which supports what was mentioned by friend "jurkov".

follow logs.

enerlab-1@GW-SCISP-1:~$ sudo systemctl restart thingsboard-gateway && journalctl -fu thingsboard-gateway.service
-- Logs begin at Sat 2024-10-05 22:31:28 UTC. --
Oct 08 08:29:48 GW-SCISP-1 python3[71546]: File "/var/lib/thingsboard_gateway/.local/lib/python3.8/site-packages/bacpypes/netservice.py", line 213, in confirmation
Oct 08 08:29:48 GW-SCISP-1 python3[71546]: self.adapterSAP.process_npdu(self, npdu)
Oct 08 08:29:48 GW-SCISP-1 python3[71546]: File "/var/lib/thingsboard_gateway/.local/lib/python3.8/site-packages/bacpypes/netservice.py", line 573, in process_npdu
Oct 08 08:29:48 GW-SCISP-1 python3[71546]: self.response(apdu)
Oct 08 08:29:48 GW-SCISP-1 python3[71546]: File "/var/lib/thingsboard_gateway/.local/lib/python3.8/site-packages/bacpypes/comm.py", line 320, in response
Oct 08 08:29:48 GW-SCISP-1 python3[71546]: self.serverPeer.confirmation(*args, **kwargs)
Oct 08 08:29:48 GW-SCISP-1 python3[71546]: File "/var/lib/thingsboard_gateway/.local/lib/python3.8/site-packages/bacpypes/appservice.py", line 1243, in confirmation
Oct 08 08:29:48 GW-SCISP-1 python3[71546]: self.sap_request(apdu)
Oct 08 08:29:48 GW-SCISP-1 python3[71546]: File "/var/lib/thingsboard_gateway/.local/lib/python3.8/site-packages/bacpypes/comm.py", line 527, in sap_request
Oct 08 08:29:48 GW-SCISP-1 python3[71546]: self.serviceElement.indication(*args, **kwargs)

Please help me with some idea of ​​what I can do.

@jurkov
Copy link
Author

jurkov commented Oct 10, 2024

A workaround would be to downgrade to 3.5.1. I fixed line 174 in tb_client.py and replaced 'DEBUG' with 10. (To be able to use MQTTS).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants