Closed Ming-Shu closed 2 years ago
Hi,@zbeacon
I did some tests,have been observed in all test. so far,the best stable version is 2.2.2.1,because do the same test as above that two.json and A.json and B.json and C.json read value is same and time is same too.But test is no OK about restart opcua server and 60 nodes in IPC. Maybe for your reference. : )
Notes: If use "Fix for #262 Bug was with subscriptions behavior model 355212d " on localhost opcua server test is so perfect,but only for this.
Hi @Ming-Shu
Thank you for your feedback, but I have not solved this problem yet, I will write to you when it is fixed and you can check.
That's OK.Thank you for your reply,I hope everything is going well with you. : )
Hi @Ming-Shu
I wonder which version of TB are you using to test with TB Gateway 2.2.4.
I encounter a problem when using TB 2.4.2 with TB Gateway 2.2.4.1. Although the TB Gateway is able to connect to the mqtt port 1883 of TB successfully, it fails to subscribe any of the mqtt topics:
tb-gateway_1 | ''2020-04-17 13:33:01' - INFO - tb_gateway_service - 52 - Gateway starting...'
tb-gateway_1 | ''2020-04-17 13:33:01' - INFO - tb_gateway_service - 54 - ThingsBoard IoT gateway version: 2.2.4.1'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_client - 115 - connecting to ThingsBoard'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_device_mqtt - 360 - Subscribed to * with id 1'
tb-gateway_1 | ''2020-04-17 13:33:01' - INFO - tb_gateway_mqtt - 176 - Subscribed to *|* with id 1'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_logger - 37 - Added remote handler to log service'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_logger - 37 - Added remote handler to log storage'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_logger - 37 - Added remote handler to log extension'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_logger - 37 - Added remote handler to log converter'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_logger - 37 - Added remote handler to log connector'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_logger - 37 - Added remote handler to log tb_connection'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - memory_event_storage - 26 - Memory storage created with following configuration:
tb-gateway_1 | Max size: 100000
tb-gateway_1 | Read records per time: 100'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_utility - 70 - ModuleSpec(name='MqttConnector', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f837901a4e0>, origin='/usr/lib/python3/dist-packages/thingsboard_gateway/connectors/mqtt/json_mqtt_uplink_converter.py')'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_utility - 77 - <module 'MqttConnector' from '/usr/lib/python3/dist-packages/thingsboard_gateway/connectors/mqtt/json_mqtt_uplink_converter.py'>'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_utility - 70 - ModuleSpec(name='MqttConnector', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f837901af28>, origin='/usr/lib/python3/dist-packages/thingsboard_gateway/connectors/mqtt/mqtt_connector.py')'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_utility - 77 - <module 'MqttConnector' from '/usr/lib/python3/dist-packages/thingsboard_gateway/connectors/mqtt/mqtt_connector.py'>'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_utility - 81 - Import MqttConnector from /usr/lib/python3/dist-packages/thingsboard_gateway/connectors/mqtt.'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_gateway_service - 551 - Loaded devices:
tb-gateway_1 | {}'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_gateway_service - 296 - Send data Thread has been started successfully.'
tb-gateway_1 | ''2020-04-17 13:33:01' - INFO - tb_gateway_service - 112 - Gateway started.'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_client - 75 - TB client <paho.mqtt.client.Client object at 0x7f837b150b00> connected to ThingsBoard'
tb-gateway_1 | ''2020-04-17 13:33:01' - INFO - tb_device_mqtt - 195 - connection SUCCESS'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_device_mqtt - 196 - <paho.mqtt.client.Client object at 0x7f837b150b00>'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes - successfully completed.'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes/response - successfully completed.'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/rpc - successfully completed.'
tb-gateway_1 | ''2020-04-17 13:33:01' - INFO - tb_client - 82 - TB client <paho.mqtt.client.Client object at 0x7f837b150b00> has been disconnected. Current client for connection is: <paho.mqtt.client.Client object at 0x7f837b150b00>'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_device_mqtt - 180 - Disconnected client: <paho.mqtt.client.Client object at 0x7f837b150b00>, user data: None, result code: 1'
tb-gateway_1 | ''2020-04-17 13:33:01' - INFO - mqtt_connector - 138 - MQTT Broker Connector connected to mytb:1883 - successfully.'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - mqtt_connector - 139 - Client <paho.mqtt.client.Client object at 0x7f8378fc5470>, userdata None, flags {'session present': 1}, extra_params ()'
tb-gateway_1 | ''2020-04-17 13:33:01' - INFO - mqtt_connector - 162 - Connector "MQTT Broker Connector" subscribe to /sensor/data'
tb-gateway_1 | ''2020-04-17 13:33:01' - INFO - mqtt_connector - 162 - Connector "MQTT Broker Connector" subscribe to /sensor/+/data'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_utility - 70 - ModuleSpec(name='CustomMqttUplinkConverter', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f8378fc5be0>, origin='/usr/lib/python3/dist-packages/thingsboard_gateway/connectors/mqtt/json_mqtt_uplink_converter.py')'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_utility - 77 - <module 'CustomMqttUplinkConverter' from '/usr/lib/python3/dist-packages/thingsboard_gateway/connectors/mqtt/json_mqtt_uplink_converter.py'>'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_utility - 70 - ModuleSpec(name='CustomMqttUplinkConverter', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f837901a4e0>, origin='/usr/lib/python3/dist-packages/thingsboard_gateway/connectors/mqtt/mqtt_connector.py')'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_utility - 77 - <module 'CustomMqttUplinkConverter' from '/usr/lib/python3/dist-packages/thingsboard_gateway/connectors/mqtt/mqtt_connector.py'>'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_utility - 70 - ModuleSpec(name='CustomMqttUplinkConverter', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f8378fd3240>, origin='/usr/lib/python3/dist-packages/thingsboard_gateway/connectors/mqtt/mqtt_uplink_converter.py')'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_utility - 77 - <module 'CustomMqttUplinkConverter' from '/usr/lib/python3/dist-packages/thingsboard_gateway/connectors/mqtt/mqtt_uplink_converter.py'>'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_utility - 70 - ModuleSpec(name='CustomMqttUplinkConverter', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f8378fd33c8>, origin='/var/lib/thingsboard_gateway/extensions/mqtt/custom_mqtt_uplink_converter.py')'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_utility - 77 - <module 'CustomMqttUplinkConverter' from '/var/lib/thingsboard_gateway/extensions/mqtt/custom_mqtt_uplink_converter.py'>'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - tb_utility - 81 - Import CustomMqttUplinkConverter from /var/lib/thingsboard_gateway/extensions/mqtt.'
tb-gateway_1 | ''2020-04-17 13:33:01' - DEBUG - mqtt_connector - 146 - Custom converter for topic /custom/sensors/+ - found!'
tb-gateway_1 | ''2020-04-17 13:33:01' - INFO - mqtt_connector - 162 - Connector "MQTT Broker Connector" subscribe to /custom/sensors/+'
tb-gateway_1 | ''2020-04-17 13:33:01' - ERROR - mqtt_connector - 190 - "MQTT Broker Connector" subscription failed to topic /sensor/data subscription message id = 1'
tb-gateway_1 | ''2020-04-17 13:33:01' - ERROR - mqtt_connector - 190 - "MQTT Broker Connector" subscription failed to topic /sensor/+/data subscription message id = 2'
tb-gateway_1 | ''2020-04-17 13:33:01' - ERROR - mqtt_connector - 190 - "MQTT Broker Connector" subscription failed to topic /custom/sensors/+ subscription message id = 3'
tb-gateway_1 | ''2020-04-17 13:33:01' - ERROR - mqtt_connector - 190 - "MQTT Broker Connector" subscription failed to topic sensor/connect subscription message id = 4'
tb-gateway_1 | ''2020-04-17 13:33:01' - ERROR - mqtt_connector - 190 - "MQTT Broker Connector" subscription failed to topic sensor/+/connect subscription message id = 5'
tb-gateway_1 | ''2020-04-17 13:33:01' - ERROR - mqtt_connector - 190 - "MQTT Broker Connector" subscription failed to topic sensor/disconnect subscription message id = 6'
tb-gateway_1 | ''2020-04-17 13:33:01' - ERROR - mqtt_connector - 190 - "MQTT Broker Connector" subscription failed to topic sensor/+/disconnect subscription message id = 7'
Thanks!
Hi @chad007
I suggest that you could check json file at config folder : )
@Ming-Shu Thank you for your suggestion. I checked "config/tb_gateway.yaml" and found that I was using the mqtt connector in the TB Gateway for a modbus gateway configured in TB. I switched the connector from mqtt to modbus, and the error described above resolved.
Hi @Ming-Shu, there are fixes for the OPC-UA speed, so you can update your Gateway to the newest version via the master branch and retest it.
Hi @zbeacon
I am done some test result below:
Unfortunately, IPC opcua server is completely different than localhost opcua server. I create 5 opcua.json(to same opcua server) that set read_records_count: 1,max_records_count: 100 and enable on tb_gateway.yaml.
one.json is 60 nodes,two.json is 10 nodes, A.json nodes is 8,and B.json is 12 ,C.json nodes is 15 .
result: one.json is very long time to connect thingsboard web at first time,it about 35 minutes. two.json to connect thingsboard web about 4.5 minutes. A.json to connect thingsboard web about 4 minutes. B.json to connect thingsboard web about 4 minutes. C.json to connect thingsboard web about 6 minutes.
but all don't do reconnect when opcua server restart on this version.
I have some picture about log below:
The terminal value and web value are the same and time is too(T0101 is 4222).
The terminal value and web value are not the same. ( terminal T0101 is 4228,web T0101 is 4222).
attritubes value get empty
one.json terminal value is 5731,one.json web value is 4222 and two.json web value is 5128.
The above is my test result for you : )