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.74k stars 844 forks source link

[HELP] I am trying to run thingsboard with snmp connector getting following error #377

Closed Sandhya-VA closed 4 years ago

Sandhya-VA commented 4 years ago

[STREAM ONLY] 2020-08-15 23:37:14,631 - ERROR - [tb_gateway_service.py] - tb_gateway_service - 285 - Error on loading connector: [STREAM ONLY] 2020-08-15 23:37:14,632 - ERROR - [tb_gateway_service.py] - tb_gateway_service - 286 - 'NoneType' object is not subscriptable Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\thingsboard_gateway\gateway\tb_gateway_service.py", line 276, in _load_connectors connector_class = TBUtility.check_and_import(connector["type"], self._default_connectors.get(connector["type"], connector.get("class"))) TypeError: 'NoneType' object is not subscriptable Collecting puresnmp Downloading puresnmp-1.9.1-py2.py3-none-any.whl (79 kB) |████████████████████████████████| 79 kB 290 kB/s Collecting typing Downloading typing-3.7.4.3.tar.gz (78 kB) |████████████████████████████████| 78 kB 617 kB/s Requirement already satisfied, skipping upgrade: six in c:\users\admin\appdata\local\programs\python\python37\lib\site-packages (from puresnmp) (1.15.0) Collecting ipaddress Downloading ipaddress-1.0.23-py2.py3-none-any.whl (18 kB) Collecting mock Downloading mock-4.0.2-py3-none-any.whl (28 kB) Collecting verlib Downloading verlib-0.1.tar.gz (4.7 kB) Collecting t61codec>=1.0.1 Downloading t61codec-1.0.1-py2.py3-none-any.whl (6.0 kB) Using legacy setup.py install for typing, since package 'wheel' is not installed. Using legacy setup.py install for verlib, since package 'wheel' is not installed. Installing collected packages: typing, ipaddress, mock, verlib, t61codec, puresnmp Running setup.py install for typing ... done Running setup.py install for verlib ... done Successfully installed ipaddress-1.0.23 mock-4.0.2 puresnmp-1.9.1 t61codec-1.0.1 typing-3.7.4.3 verlib-0.1 WARNING: You are using pip version 20.1.1; however, version 20.2.2 is available. You should consider upgrading via the 'C:\Users\Admin\AppData\Local\Programs\Python\Python37\python.exe -m pip install --upgrade pip' command. [STREAM ONLY] 2020-08-15 23:37:36,230 - ERROR - [tb_utility.py] - tb_utility - 105 - Import CustomSNMPConverter failed, path \var\lib\thingsboard_gateway\extensions\snmp doesn't exist [STREAM ONLY] 2020-08-15 23:37:36,235 - ERROR - [snmp_connector.py] - snmp_connector - 234 - 'NoneType' object is not callable Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\thingsboard_gateway\connectors\snmp\snmp_connector.py", line 231, in fill_converters device["uplink_converter"] = TBUtility.check_and_import("snmp", device.get('converter', self._default_converters["uplink"]))(device) TypeError: 'NoneType' object is not callable [STREAM ONLY] 2020-08-15 23:37:36,972 - ERROR - [snmp_connector.py] - snmp_connector - 70 - [Errno 13] Permission denied: 'C:\Program Files\thingsboard-gateway-master\thingsboard_gateway\config\connected_devices.json' Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\thingsboard_gateway\connectors\snmp\snmp_connector.py", line 67, in run self.process_data(device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\thingsboard_gateway\connectors\snmp\snmp_connector.py", line 147, in process_data self.collect_statistic_and_send(self.get_name(), converted_data) File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\thingsboard_gateway\connectors\snmp\snmp_connector.py", line 121, in collect_statistic_and_send self.__gateway.send_to_storage(connector_name, data) File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\thingsboard_gateway\gateway\tb_gateway_service.py", line 318, in send_to_storage {"connector": self.available_connectors[connector_name]}, wait_for_publish=True, device_type=data["deviceType"]) File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\thingsboard_gateway\gateway\tb_gateway_service.py", line 618, in add_device self.save_persistent_devices() File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\thingsboard_gateway\gateway\tb_gateway_service.py", line 666, in save_persistent_devices with open(self._config_dir + self.connected_devices_file, 'w') as config_file: PermissionError: [Errno 13] Permission denied: 'C:\Program Files\thingsboard-gateway-master\thingsboard_gateway\config\connected_devices.json' [STREAM ONLY] 2020-08-15 23:37:36,975 - ERROR - [snmp_connector.py] - snmp_connector - 145 - [WinError 10054] An existing connection was forcibly closed by the remote host Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\thingsboard_gateway\connectors\snmp\snmp_connector.py", line 139, in process_data response = self.__process_methods(method, common_parameters, datatype_config) File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\thingsboard_gateway\connectors\snmp\snmp_connector.py", line 156, in process_methods oid=oid) File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\puresnmp\api\pythonic.py", line 135, in get raw_value = raw.get(ip, community, oid, port, timeout=timeout) File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\puresnmp\api\raw.py", line 71, in get ip, community, [oid], port, timeout=timeout) File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\puresnmp\api\raw.py", line 97, in multiget response = transport.send(ip, port, to_bytes(packet)) File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\puresnmp\transport.py", line 84, in send response = sock.recv(self.buffer_size) ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host [STREAM ONLY] 2020-08-15 23:37:37,031 - ERROR - [snmp_connector.py] - snmp_connector - 145 - [WinError 10054] An existing connection was forcibly closed by the remote host

imbeacon commented 4 years ago

Hi @Sandhya-VA

You try to run the gateway on the Windows platform directly, but the gateway doesn't work stable on Windows now, if installed directly. Please try to install it using docker, because path for extension folder is designed for unix-based systems.