thingsboard / thingsboard-gateway

Open-source IoT Gateway - integrates devices connected to legacy and third-party systems with ThingsBoard IoT Platform using Modbus, CAN bus, BACnet, BLE, OPC-UA, MQTT, ODBC and REST protocols
https://thingsboard.io/docs/iot-gateway/what-is-iot-gateway/
Apache License 2.0
1.72k stars 828 forks source link

[HELP] Can't access data with Bacnet #1520

Open mgruenberger21 opened 2 weeks ago

mgruenberger21 commented 2 weeks ago

Hello,

I cantt access data of a heating system with bacnet using thingsboard-gateway. When I use Yabe, I can accesss all the things I want to know. But when requesting data with thingsboard-gateway, I dont get any answer of the heating system to my request. grafik

e.g. the request for this value shold look like this I think: { "general": { "objectName": "tb-gateway", "address": "0.0.0.0:47808", "objectIdentifier": 599, "maxApduLengthAccepted": 1476, "segmentationSupported": "segmentedBoth", "vendorIdentifier": 15 }, "devices": [ { "deviceName": "BACnet Device ${objectName}", "deviceType": "default", "address": "IPADDR:47808", "pollPeriod": 10000, "attributes": [ { "key": "Außentemperatur Kessel 1", "type": "double", "objectId": "analogInput:239", "propertyId": "presentValue" } ] } ], "logLevel": "DEBUG", "name": "Bacnet", "enableRemoteLogging": true, "id": "ac5e542d-623b-432a-9a96-04fe82655e34" }

Debug-Logs of thingsboard-gateway:

b-gateway | 2024-09-04 11:50:37 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 204 - Configuration update request received. tb-gateway | 2024-09-04 11:50:37 - |DEBUG| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 205 - Got config update request: {'active_connectors': ['Bacnet']} tb-gateway | 2024-09-04 11:50:37 - |DEBUG| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _handle_active_connectors_update - 404 - Processing active connectors configuration update... tb-gateway | 2024-09-04 11:50:37 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 204 - Configuration update request received. tb-gateway | 2024-09-04 11:50:37 - |DEBUG| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 205 - Got config update request: {'Bacnet': {'mode': 'basic', 'name': 'Bacnet', 'type': 'bacnet', 'enableRemoteLogging': True, 'logLevel': 'DEBUG', 'sendDataOnlyOnChange': False, 'configuration': 'bacnet.json', 'configurationJson': {'general': {'objectName': 'tb-gateway', 'address': '0.0.0.0:47808', 'objectIdentifier': 599, 'maxApduLengthAccepted': 1476, 'segmentationSupported': 'segmentedBoth', 'vendorIdentifier': 15}, 'devices': [{'deviceName': 'BACnet Device ${objectName}', 'deviceType': 'default', 'address': 'IP-ADDR:47808', 'pollPeriod': 10000, 'attributes': [{'key': 'Außentemperatur Kessel 1', 'type': 'double', 'objectId': 'analogInput:239', 'propertyId': 'presentValue'}]}], 'logLevel': 'DEBUG', 'name': 'Bacnet', 'enableRemoteLogging': True, 'id': 'ac5e542d-623b-432a-9a96-04fe82655e34'}, 'ts': 1725450637146, 'key': 'auto', 'basicConfig': {'general': {'objectName': 'tb-gateway', 'address': '0.0.0.0:47808', 'objectIdentifier': 599, 'maxApduLengthAccepted': 1476, 'segmentationSupported': 'segmentedBoth', 'vendorIdentifier': 15}, 'devices': [{'deviceName': 'BACnet Device ${objectName}', 'deviceType': 'default', 'address': 'IP-ADDR:47808', 'pollPeriod': 10000, 'attributes': [{'key': 'Außentemperatur Kessel 1', 'type': 'double', 'objectId': 'analogInput:239', 'propertyId': 'presentValue'}]}], 'logLevel': 'DEBUG', 'name': 'Bacnet', 'enableRemoteLogging': True, 'id': 'ac5e542d-623b-432a-9a96-04fe82655e34'}}} tb-gateway | 2024-09-04 11:50:37 - |DEBUG| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _handle_connector_configuration_update - 449 - Processing connectors configuration update... tb-gateway | 2024-09-04 11:50:37 - |DEBUG| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - create_configuration_file_backup - 757 - Backup file created for configuration file bacnet.json in /thingsboard_gateway/config/backup/bacnet.backup.1725450637.json tb-gateway | 2024-09-04 11:50:37 - |DEBUG| - [bacnet_connector.py] - bacnet_connector - scan_network - 226 - WhoIsRequest has been sent. tb-gateway | 2024-09-04 11:50:37 - |DEBUG| - [bacnet_connector.py] - bacnet_connector - run - 80 - WhoIsRequest has been sent. tb-gateway | 2024-09-04 11:50:37 - |DEBUG| - [bacnet_connector.py] - bacnet_connector - scan_network - 226 - WhoIsRequest has been sent. tb-gateway | 2024-09-04 11:50:37 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 204 - Configuration update request received. tb-gateway | 2024-09-04 11:50:37 - |DEBUG| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 205 - Got config update request: {'Bacnet': {'mode': 'basic', 'name': 'Bacnet', 'type': 'bacnet', 'enableRemoteLogging': True, 'logLevel': 'DEBUG', 'sendDataOnlyOnChange': False, 'configuration': 'bacnet.json', 'configurationJson': {'general': {'objectName': 'tb-gateway', 'address': '0.0.0.0:47808', 'objectIdentifier': 599, 'maxApduLengthAccepted': 1476, 'segmentationSupported': 'segmentedBoth', 'vendorIdentifier': 15}, 'devices': [{'deviceName': 'BACnet Device ${objectName}', 'deviceType': 'default', 'address': 'IP-ADDR:47808', 'pollPeriod': 10000, 'attributes': [{'key': 'Außentemperatur Kessel 1', 'type': 'double', 'objectId': 'analogInput:239', 'propertyId': 'presentValue'}]}], 'logLevel': 'DEBUG', 'name': 'Bacnet', 'enableRemoteLogging': True, 'id': 'ac5e542d-623b-432a-9a96-04fe82655e34'}, 'ts': 1725450637146, 'key': 'auto', 'basicConfig': {'general': {'objectName': 'tb-gateway', 'address': '0.0.0.0:47808', 'objectIdentifier': 599, 'maxApduLengthAccepted': 1476, 'segmentationSupported': 'segmentedBoth', 'vendorIdentifier': 15}, 'devices': [{'deviceName': 'BACnet Device ${objectName}', 'deviceType': 'default', 'address': 'IP-ADDR:47808', 'pollPeriod': 10000, 'attributes': [{'key': 'Außentemperatur Kessel 1', 'type': 'double', 'objectId': 'analogInput:239', 'propertyId': 'presentValue'}]}], 'logLevel': 'DEBUG', 'name': 'Bacnet', 'enableRemoteLogging': True, 'id': 'ac5e542d-623b-432a-9a96-04fe82655e34'}}}

tcpdump:

13:57:32.811805 IP iotgw.bacnet > IPADDR.bacnet: UDP, length 8 13:57:32.814702 IP iotgw.bacnet > IPADDR.bacnet: UDP, length 8

Can someone please help me to solve this problem.? Sorry, I´m not really a bacnet-specialist.

Versions (please complete the following information):

HarvUK commented 1 week ago

Try changing this IP address

{ "general": { "objectName": "tb-gateway", "address": "0.0.0.0:47808",

To be the IP address of the network interface of your TBGW.

Harv

mgruenberger21 commented 1 week ago

Hello,

thank you for your message. Still there is no answer of the Bacnet-Device. Looks like something is wrong with the request itself. In Wireshark I can see the request sent to bacnet-device, but nothing is sent back: grafik Some flags look differnet in yabe-request: grafik