Closed jean-louis closed 2 weeks ago
With the code in master branch, the error is no longer there, but the custom ts is not taken into account.
PR https://github.com/thingsboard/thingsboard-gateway/pull/1582 fixes this problem
Hi @jean-louis,
Please try the version from the master branch, I also have checked your PR and should notice that it will properly work only if ts key configuration will be the very first in timeseries configuration array. Please try our variant of implementation and let us know about the results or any issues.
Hi @imbeacon ,
with te new commit on master branch I get this error:
For sliced
tb-gateway | 2024-11-06 10:28:12 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 227 - Configuration update request received.
tb-gateway | 2024-11-06 10:28:12 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 227 - Configuration update request received.
tb-gateway | 2024-11-06 10:28:12 - |INFO| - [tb_loader.py] - tb_loader - import_module - 69 - Import FTPConnector from /thingsboard_gateway/connectors/ftp.
tb-gateway | 2024-11-06 10:28:12 - |INFO| - [ftp_connector.py] - ftp_connector - __init__ - 83 - FTP Connector started.
tb-gateway | 2024-11-06 10:28:12 - |INFO| - [tb_gateway_service.py] - tb_gateway_service - __connect_with_connectors - 1001 - Cannot find separated report strategy for connector 'Test ftp bug - sliced - Connector'. The main report strategy will be used as a connector report strategy.
tb-gateway | 2024-11-06 10:28:12 - |INFO| - [ftp_connector.py] - ftp_connector - __connect - 131 - Connected to FTP server
tb-gateway | 2024-11-06 10:28:12 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 227 - Configuration update request received.
tb-gateway | 2024-11-06 10:28:12 - |ERROR| - [ftp_uplink_converter.py] - ftp_uplink_converter - _convert_slices_view_data - 164 - Error in converter, for config:
tb-gateway | {"delimiter": ",", "devicePatternName": "Test ftp bug - sliced new master", "devicePatternType": "Device", "timeseries": [{"type": "int", "key": "ts", "value": "[0:1]"}, {"type": "int", "key": "x1", "value": "[1:2]"}, {"type": "int", "key": "x2", "value": "[2:3]"}, {"type": "int", "key": "x3", "value": "[3:4]"}, {"type": "int", "key": "x4", "value": "[4:5]"}, {"type": "int", "key": "x5", "value": "[5:6]"}], "attributes": [], "txt_file_data_view": "SLICED", "reportStrategy": null}
tb-gateway | and message:
tb-gateway | 1726830069221,11,12,13,14,15
tb-gateway | list indices must be integers or slices, not str
tb-gateway | 2024-11-06 10:28:12 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 187 - Converted data: ConvertedData(deviceName=Test ftp bug - sliced new master, deviceType=Device, telemetry=[], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 10:28:12 - |ERROR| - [ftp_uplink_converter.py] - ftp_uplink_converter - _convert_slices_view_data - 164 - Error in converter, for config:
tb-gateway | {"delimiter": ",", "devicePatternName": "Test ftp bug - sliced new master", "devicePatternType": "Device", "timeseries": [{"type": "int", "key": "ts", "value": "[0:1]"}, {"type": "int", "key": "x1", "value": "[1:2]"}, {"type": "int", "key": "x2", "value": "[2:3]"}, {"type": "int", "key": "x3", "value": "[3:4]"}, {"type": "int", "key": "x4", "value": "[4:5]"}, {"type": "int", "key": "x5", "value": "[5:6]"}], "attributes": [], "txt_file_data_view": "SLICED", "reportStrategy": null}
tb-gateway | and message:
tb-gateway | 1726830069267,21,22,23,24,25
tb-gateway | list indices must be integers or slices, not str
tb-gateway | 2024-11-06 10:28:12 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 187 - Converted data: ConvertedData(deviceName=Test ftp bug - sliced new master, deviceType=Device, telemetry=[], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 10:28:12 - |ERROR| - [ftp_uplink_converter.py] - ftp_uplink_converter - _convert_slices_view_data - 164 - Error in converter, for config:
tb-gateway | {"delimiter": ",", "devicePatternName": "Test ftp bug - sliced new master", "devicePatternType": "Device", "timeseries": [{"type": "int", "key": "ts", "value": "[0:1]"}, {"type": "int", "key": "x1", "value": "[1:2]"}, {"type": "int", "key": "x2", "value": "[2:3]"}, {"type": "int", "key": "x3", "value": "[3:4]"}, {"type": "int", "key": "x4", "value": "[4:5]"}, {"type": "int", "key": "x5", "value": "[5:6]"}], "attributes": [], "txt_file_data_view": "SLICED", "reportStrategy": null}
tb-gateway | and message:
tb-gateway | 1726830069313,31,32,33,34,35
tb-gateway | list indices must be integers or slices, not str
tb-gateway | 2024-11-06 10:28:12 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 187 - Converted data: ConvertedData(deviceName=Test ftp bug - sliced new master, deviceType=Device, telemetry=[], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 10:28:12 - |ERROR| - [ftp_uplink_converter.py] - ftp_uplink_converter - _convert_slices_view_data - 164 - Error in converter, for config:
tb-gateway | {"delimiter": ",", "devicePatternName": "Test ftp bug - sliced new master", "devicePatternType": "Device", "timeseries": [{"type": "int", "key": "ts", "value": "[0:1]"}, {"type": "int", "key": "x1", "value": "[1:2]"}, {"type": "int", "key": "x2", "value": "[2:3]"}, {"type": "int", "key": "x3", "value": "[3:4]"}, {"type": "int", "key": "x4", "value": "[4:5]"}, {"type": "int", "key": "x5", "value": "[5:6]"}], "attributes": [], "txt_file_data_view": "SLICED", "reportStrategy": null}
tb-gateway | and message:
tb-gateway | 1726830069359,41,42,43,44,45
tb-gateway | list indices must be integers or slices, not str
tb-gateway | 2024-11-06 10:28:12 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 187 - Converted data: ConvertedData(deviceName=Test ftp bug - sliced new master, deviceType=Device, telemetry=[], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 10:28:12 - |ERROR| - [ftp_uplink_converter.py] - ftp_uplink_converter - _convert_slices_view_data - 164 - Error in converter, for config:
tb-gateway | {"delimiter": ",", "devicePatternName": "Test ftp bug - sliced new master", "devicePatternType": "Device", "timeseries": [{"type": "int", "key": "ts", "value": "[0:1]"}, {"type": "int", "key": "x1", "value": "[1:2]"}, {"type": "int", "key": "x2", "value": "[2:3]"}, {"type": "int", "key": "x3", "value": "[3:4]"}, {"type": "int", "key": "x4", "value": "[4:5]"}, {"type": "int", "key": "x5", "value": "[5:6]"}], "attributes": [], "txt_file_data_view": "SLICED", "reportStrategy": null}
tb-gateway | and message:
tb-gateway | 1726830069405,51,52,53,54,55
tb-gateway | list indices must be integers or slices, not str
tb-gateway | 2024-11-06 10:28:12 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 187 - Converted data: ConvertedData(deviceName=Test ftp bug - sliced new master, deviceType=Device, telemetry=[], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 10:28:12 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 187 - Converted data: None
tb-gateway | 2024-11-06 10:37:36 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 227 - Configuration update request received.
tb-gateway | 2024-11-06 10:37:36 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 227 - Configuration update request received.
tb-gateway | 2024-11-06 10:37:36 - |INFO| - [ftp_connector.py] - ftp_connector - close - 202 - FTP Connector stopped.
For table:
tb-gateway | 2024-11-06 10:39:16 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 227 - Configuration update request received.
tb-gateway | 2024-11-06 10:39:16 - |INFO| - [ftp_connector.py] - ftp_connector - __init__ - 83 - FTP Connector started.
tb-gateway | 2024-11-06 10:39:16 - |INFO| - [tb_gateway_service.py] - tb_gateway_service - __connect_with_connectors - 1001 - Cannot find separated report strategy for connector 'Test ftp bug - table - Connector'. The main report strategy will be used as a connector report strategy.
tb-gateway | 2024-11-06 10:39:16 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 227 - Configuration update request received.
tb-gateway | 2024-11-06 10:39:16 - |INFO| - [ftp_connector.py] - ftp_connector - __connect - 131 - Connected to FTP server
tb-gateway | 2024-11-06 10:39:17 - |ERROR| - [ftp_uplink_converter.py] - ftp_uplink_converter - _convert_table_view_data - 108 - Error in converter, for config:
tb-gateway | {"delimiter": ",", "devicePatternName": "Test ftp bug - table new master", "devicePatternType": "Device", "timeseries": [{"type": "int", "key": "ts", "value": "${ts}"}, {"type": "int", "key": "x1", "value": "${x1}"}, {"type": "int", "key": "x2", "value": "${x2}"}, {"type": "int", "key": "x3", "value": "${x3}"}, {"type": "int", "key": "x4", "value": "${x4}"}, {"type": "int", "key": "x5", "value": "${x5}"}], "attributes": [], "txt_file_data_view": "TABLE", "reportStrategy": null}
tb-gateway | and message:
tb-gateway | 1726830069221,11,12,13,14,15
tb-gateway | list indices must be integers or slices, not str
tb-gateway | 2024-11-06 10:39:17 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 187 - Converted data: ConvertedData(deviceName=Test ftp bug - table new master, deviceType=Device, telemetry=[], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 10:39:17 - |ERROR| - [ftp_uplink_converter.py] - ftp_uplink_converter - _convert_table_view_data - 108 - Error in converter, for config:
tb-gateway | {"delimiter": ",", "devicePatternName": "Test ftp bug - table new master", "devicePatternType": "Device", "timeseries": [{"type": "int", "key": "ts", "value": "${ts}"}, {"type": "int", "key": "x1", "value": "${x1}"}, {"type": "int", "key": "x2", "value": "${x2}"}, {"type": "int", "key": "x3", "value": "${x3}"}, {"type": "int", "key": "x4", "value": "${x4}"}, {"type": "int", "key": "x5", "value": "${x5}"}], "attributes": [], "txt_file_data_view": "TABLE", "reportStrategy": null}
tb-gateway | and message:
tb-gateway | 1726830069267,21,22,23,24,25
tb-gateway | list indices must be integers or slices, not str
tb-gateway | 2024-11-06 10:39:17 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 187 - Converted data: ConvertedData(deviceName=Test ftp bug - table new master, deviceType=Device, telemetry=[], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 10:39:17 - |ERROR| - [ftp_uplink_converter.py] - ftp_uplink_converter - _convert_table_view_data - 108 - Error in converter, for config:
tb-gateway | {"delimiter": ",", "devicePatternName": "Test ftp bug - table new master", "devicePatternType": "Device", "timeseries": [{"type": "int", "key": "ts", "value": "${ts}"}, {"type": "int", "key": "x1", "value": "${x1}"}, {"type": "int", "key": "x2", "value": "${x2}"}, {"type": "int", "key": "x3", "value": "${x3}"}, {"type": "int", "key": "x4", "value": "${x4}"}, {"type": "int", "key": "x5", "value": "${x5}"}], "attributes": [], "txt_file_data_view": "TABLE", "reportStrategy": null}
tb-gateway | and message:
tb-gateway | 1726830069313,31,32,33,34,35
tb-gateway | list indices must be integers or slices, not str
tb-gateway | 2024-11-06 10:39:17 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 187 - Converted data: ConvertedData(deviceName=Test ftp bug - table new master, deviceType=Device, telemetry=[], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 10:39:17 - |ERROR| - [ftp_uplink_converter.py] - ftp_uplink_converter - _convert_table_view_data - 108 - Error in converter, for config:
tb-gateway | {"delimiter": ",", "devicePatternName": "Test ftp bug - table new master", "devicePatternType": "Device", "timeseries": [{"type": "int", "key": "ts", "value": "${ts}"}, {"type": "int", "key": "x1", "value": "${x1}"}, {"type": "int", "key": "x2", "value": "${x2}"}, {"type": "int", "key": "x3", "value": "${x3}"}, {"type": "int", "key": "x4", "value": "${x4}"}, {"type": "int", "key": "x5", "value": "${x5}"}], "attributes": [], "txt_file_data_view": "TABLE", "reportStrategy": null}
tb-gateway | and message:
tb-gateway | 1726830069359,41,42,43,44,45
tb-gateway | list indices must be integers or slices, not str
tb-gateway | 2024-11-06 10:39:17 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 187 - Converted data: ConvertedData(deviceName=Test ftp bug - table new master, deviceType=Device, telemetry=[], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 10:39:17 - |ERROR| - [ftp_uplink_converter.py] - ftp_uplink_converter - _convert_table_view_data - 108 - Error in converter, for config:
tb-gateway | {"delimiter": ",", "devicePatternName": "Test ftp bug - table new master", "devicePatternType": "Device", "timeseries": [{"type": "int", "key": "ts", "value": "${ts}"}, {"type": "int", "key": "x1", "value": "${x1}"}, {"type": "int", "key": "x2", "value": "${x2}"}, {"type": "int", "key": "x3", "value": "${x3}"}, {"type": "int", "key": "x4", "value": "${x4}"}, {"type": "int", "key": "x5", "value": "${x5}"}], "attributes": [], "txt_file_data_view": "TABLE", "reportStrategy": null}
tb-gateway | and message:
tb-gateway | 1726830069405,51,52,53,54,55
tb-gateway | list indices must be integers or slices, not str
tb-gateway | 2024-11-06 10:39:17 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 187 - Converted data: ConvertedData(deviceName=Test ftp bug - table new master, deviceType=Device, telemetry=[], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 10:39:17 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 187 - Converted data: None
tb-gateway | 2024-11-06 10:39:17 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 227 - Configuration update request received.
Hi @jean-louis, Yes, my bad, passed wrong configuration object to parsing, please try now.
Hi @imbeacon ,
now sliced works fine, but table does not correctly take the value of ts:
tb-gateway | 2024-11-06 11:46:50 - |INFO| - [ftp_connector.py] - ftp_connector - __connect - 131 - Connected to FTP server
tb-gateway | 2024-11-06 11:46:50 - |INFO| - [ftp_connector.py] - ftp_connector - __process_paths - 202 - Converted data for device Test ftp bug - table new master 2 with type Device, attributes: 0, telemetry: 5
tb-gateway | 2024-11-06 11:46:50 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 206 - Converted data: ConvertedData(deviceName=Test ftp bug - table new master 2, deviceType=Device, telemetry=[TelemetryEntry(ts=${ts}, metadata={}, values={DatapointKey(key=x1, report_strategy=None): '11', DatapointKey(key=x2, report_strategy=None): '12', DatapointKey(key=x3, report_strategy=None): '13', DatapointKey(key=x4, report_strategy=None): '14', DatapointKey(key=x5, report_strategy=None): '15'})], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 11:46:50 - |DEBUG| - [ftp_connector.py] - ftp_connector - __send_data - 217 - Data to ThingsBoard: ConvertedData(deviceName=Test ftp bug - table new master 2, deviceType=Device, telemetry=[TelemetryEntry(ts=${ts}, metadata={}, values={DatapointKey(key=x1, report_strategy=None): '11', DatapointKey(key=x2, report_strategy=None): '12', DatapointKey(key=x3, report_strategy=None): '13', DatapointKey(key=x4, report_strategy=None): '14', DatapointKey(key=x5, report_strategy=None): '15'})], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 11:46:50 - |INFO| - [ftp_connector.py] - ftp_connector - __process_paths - 202 - Converted data for device Test ftp bug - table new master 2 with type Device, attributes: 0, telemetry: 5
tb-gateway | 2024-11-06 11:46:50 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 206 - Converted data: ConvertedData(deviceName=Test ftp bug - table new master 2, deviceType=Device, telemetry=[TelemetryEntry(ts=${ts}, metadata={}, values={DatapointKey(key=x1, report_strategy=None): '21', DatapointKey(key=x2, report_strategy=None): '22', DatapointKey(key=x3, report_strategy=None): '23', DatapointKey(key=x4, report_strategy=None): '24', DatapointKey(key=x5, report_strategy=None): '25'})], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 11:46:50 - |DEBUG| - [ftp_connector.py] - ftp_connector - __send_data - 217 - Data to ThingsBoard: ConvertedData(deviceName=Test ftp bug - table new master 2, deviceType=Device, telemetry=[TelemetryEntry(ts=${ts}, metadata={}, values={DatapointKey(key=x1, report_strategy=None): '21', DatapointKey(key=x2, report_strategy=None): '22', DatapointKey(key=x3, report_strategy=None): '23', DatapointKey(key=x4, report_strategy=None): '24', DatapointKey(key=x5, report_strategy=None): '25'})], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 11:46:50 - |INFO| - [ftp_connector.py] - ftp_connector - __process_paths - 202 - Converted data for device Test ftp bug - table new master 2 with type Device, attributes: 0, telemetry: 5
tb-gateway | 2024-11-06 11:46:50 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 206 - Converted data: ConvertedData(deviceName=Test ftp bug - table new master 2, deviceType=Device, telemetry=[TelemetryEntry(ts=${ts}, metadata={}, values={DatapointKey(key=x1, report_strategy=None): '31', DatapointKey(key=x2, report_strategy=None): '32', DatapointKey(key=x3, report_strategy=None): '33', DatapointKey(key=x4, report_strategy=None): '34', DatapointKey(key=x5, report_strategy=None): '35'})], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 11:46:50 - |DEBUG| - [ftp_connector.py] - ftp_connector - __send_data - 217 - Data to ThingsBoard: ConvertedData(deviceName=Test ftp bug - table new master 2, deviceType=Device, telemetry=[TelemetryEntry(ts=${ts}, metadata={}, values={DatapointKey(key=x1, report_strategy=None): '31', DatapointKey(key=x2, report_strategy=None): '32', DatapointKey(key=x3, report_strategy=None): '33', DatapointKey(key=x4, report_strategy=None): '34', DatapointKey(key=x5, report_strategy=None): '35'})], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 11:46:50 - |INFO| - [ftp_connector.py] - ftp_connector - __process_paths - 202 - Converted data for device Test ftp bug - table new master 2 with type Device, attributes: 0, telemetry: 5
tb-gateway | 2024-11-06 11:46:50 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 206 - Converted data: ConvertedData(deviceName=Test ftp bug - table new master 2, deviceType=Device, telemetry=[TelemetryEntry(ts=${ts}, metadata={}, values={DatapointKey(key=x1, report_strategy=None): '41', DatapointKey(key=x2, report_strategy=None): '42', DatapointKey(key=x3, report_strategy=None): '43', DatapointKey(key=x4, report_strategy=None): '44', DatapointKey(key=x5, report_strategy=None): '45'})], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 11:46:50 - |DEBUG| - [ftp_connector.py] - ftp_connector - __send_data - 217 - Data to ThingsBoard: ConvertedData(deviceName=Test ftp bug - table new master 2, deviceType=Device, telemetry=[TelemetryEntry(ts=${ts}, metadata={}, values={DatapointKey(key=x1, report_strategy=None): '41', DatapointKey(key=x2, report_strategy=None): '42', DatapointKey(key=x3, report_strategy=None): '43', DatapointKey(key=x4, report_strategy=None): '44', DatapointKey(key=x5, report_strategy=None): '45'})], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 11:46:50 - |INFO| - [ftp_connector.py] - ftp_connector - __process_paths - 202 - Converted data for device Test ftp bug - table new master 2 with type Device, attributes: 0, telemetry: 5
tb-gateway | 2024-11-06 11:46:50 - |DEBUG| - [ftp_connector.py] - ftp_connector - __process_paths - 206 - Converted data: ConvertedData(deviceName=Test ftp bug - table new master 2, deviceType=Device, telemetry=[TelemetryEntry(ts=${ts}, metadata={}, values={DatapointKey(key=x1, report_strategy=None): '51', DatapointKey(key=x2, report_strategy=None): '52', DatapointKey(key=x3, report_strategy=None): '53', DatapointKey(key=x4, report_strategy=None): '54', DatapointKey(key=x5, report_strategy=None): '55'})], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 11:46:50 - |DEBUG| - [ftp_connector.py] - ftp_connector - __send_data - 217 - Data to ThingsBoard: ConvertedData(deviceName=Test ftp bug - table new master 2, deviceType=Device, telemetry=[TelemetryEntry(ts=${ts}, metadata={}, values={DatapointKey(key=x1, report_strategy=None): '51', DatapointKey(key=x2, report_strategy=None): '52', DatapointKey(key=x3, report_strategy=None): '53', DatapointKey(key=x4, report_strategy=None): '54', DatapointKey(key=x5, report_strategy=None): '55'})], attributes=Attributes(values={}), metadata={})
tb-gateway | 2024-11-06 11:46:51 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 227 - Configuration update request received.
you can see:
telemetry=[TelemetryEntry(ts=${ts}
ok, now both work fine
thanks for your work @imbeacon
I will close the PR because it is no longer necessary
Describe the bug Using the ftp connector in sliced or table mode, you get an error if the ts attribute is present. The device is not created and the data is not sent to the ThingsBoard (cloud) platform.
Attached are the configuration files and related logs.
I will open a PR with the fixes I am using locally.
Connector name: FTP Connector
Error traceback:
Versions (please complete the following information):
sliced_connector.json sliced_connector.log table_connector.json table_connector.log