-
Notifications
You must be signed in to change notification settings - Fork 854
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
'NoneType' object has no attribute 'upper' #432
Comments
Hi @io-r-ahmed , Thank you for your message it is a bug, I will fix it in new release. As a workaround you are able to add parameters |
Hello,
Thanks a lot for your reply.
I have done so where my final config file is:
{
"server": {
"name": "Modbus Default Server",
"type": "serial",
"method": "rtu",
"port": "/dev/ttyUSB0",
"baudrate": 9600,
"timeout": 35,
"devices": [
{
"unitId": 1,
"deviceName": "Serial Machine",
"attributesPollPeriod": 5000,
"timeseriesPollPeriod": 5000,
"sendDataOnlyOnChange": true,
"attributes": [
{
"wordorder": "LITTLE",
"byteOrder": "BIG",
"tag": "test",
"type": "long",
"functionCode": 4,
"registerCount": 1,
"address": 4
}
]
}
]
}
}
But the same error is still not solved.
Best Regards.
|
And Kindly check the attached log file on running thingsboard for more details.
Best Regards.
Hello,
Thanks a lot for your reply.
I have done so where my final config file is:
{
"server": {
"name": "Modbus Default Server",
"type": "serial",
"method": "rtu",
"port": "/dev/ttyUSB0",
"baudrate": 9600,
"timeout": 35,
"devices": [
{
"unitId": 1,
"deviceName": "Serial Machine",
"attributesPollPeriod": 5000,
"timeseriesPollPeriod": 5000,
"sendDataOnlyOnChange": true,
"attributes": [
{
"wordorder": "LITTLE",
"byteOrder": "BIG",
"tag": "test",
"type": "long",
"functionCode": 4,
"registerCount": 1,
"address": 4
}
]
}
]
}
}
But the same error is still not solved.
Best Regards.
""2020-12-01 13:06:58" - INFO - [tb_gateway_service.py] - tb_gateway_service - 72 - Gateway starting..."
""2020-12-01 13:06:58" - DEBUG - [tb_updater.py] - tb_updater - 69 - Checking for new version"
""2020-12-01 13:06:58" - INFO - [tb_gateway_service.py] - tb_gateway_service - 77 - ThingsBoard IoT gateway version: 2.5.4"
""2020-12-01 13:06:58" - DEBUG - [tb_client.py] - tb_client - 125 - connecting to ThingsBoard"
""2020-12-01 13:06:58" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 301 - Subscribed to * with id 1"
""2020-12-01 13:06:58" - INFO - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 176 - Subscribed to *|* with id 1"
""2020-12-01 13:06:58" - DEBUG - [tb_logger.py] - tb_logger - 37 - Added remote handler to log service"
""2020-12-01 13:06:58" - DEBUG - [tb_logger.py] - tb_logger - 37 - Added remote handler to log extension"
""2020-12-01 13:06:58" - DEBUG - [tb_logger.py] - tb_logger - 37 - Added remote handler to log converter"
""2020-12-01 13:06:58" - DEBUG - [tb_logger.py] - tb_logger - 37 - Added remote handler to log connector"
""2020-12-01 13:06:58" - DEBUG - [tb_logger.py] - tb_logger - 37 - Added remote handler to log tb_connection"
""2020-12-01 13:06:58" - DEBUG - [memory_event_storage.py] - memory_event_storage - 26 - Memory storage created with following configuration:
Max size: 100000
Read records per time: 100"
""2020-12-01 13:06:58" - DEBUG - [tb_utility.py] - tb_utility - 96 - ModuleSpec(name='ModbusConnector', loader=<_frozen_importlib_external.SourceFileLoader object at 0x757de030>, origin='/usr/local/lib/python3.7/dist-packages/thingsboard_gateway-2.5.4-py3.7.egg/thingsboard_gateway/connectors/modbus/modbus_converter.py')"
""2020-12-01 13:06:58" - DEBUG - [tb_utility.py] - tb_utility - 103 - <module 'ModbusConnector' from '/usr/local/lib/python3.7/dist-packages/thingsboard_gateway-2.5.4-py3.7.egg/thingsboard_gateway/connectors/modbus/modbus_converter.py'>"
""2020-12-01 13:06:58" - DEBUG - [tb_utility.py] - tb_utility - 96 - ModuleSpec(name='ModbusConnector', loader=<_frozen_importlib_external.SourceFileLoader object at 0x757358f0>, origin='/usr/local/lib/python3.7/dist-packages/thingsboard_gateway-2.5.4-py3.7.egg/thingsboard_gateway/connectors/modbus/modbus_connector.py')"
""2020-12-01 13:06:58" - DEBUG - [tb_utility.py] - tb_utility - 103 - <module 'ModbusConnector' from '/usr/local/lib/python3.7/dist-packages/thingsboard_gateway-2.5.4-py3.7.egg/thingsboard_gateway/connectors/modbus/modbus_connector.py'>"
""2020-12-01 13:06:58" - DEBUG - [tb_utility.py] - tb_utility - 107 - Import ModbusConnector from /usr/local/lib/python3.7/dist-packages/thingsboard_gateway-2.5.4-py3.7.egg/thingsboard_gateway/connectors/modbus."
""2020-12-01 13:06:58" - DEBUG - [tb_gateway_service.py] - tb_gateway_service - 686 - Saved connected devices."
""2020-12-01 13:06:58" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 147 - Connected device Serial Machine"
""2020-12-01 13:06:58" - INFO - [modbus_connector.py] - modbus_connector - 70 - Starting Modbus connector"
""2020-12-01 13:06:58" - DEBUG - [tb_gateway_service.py] - tb_gateway_service - 663 - Loaded devices:
{'Serial Machine': 'Modbus Default Server'}"
""2020-12-01 13:06:58" - DEBUG - [tb_gateway_service.py] - tb_gateway_service - 361 - Send data Thread has been started successfully."
""2020-12-01 13:06:58" - INFO - [tb_gateway_service.py] - tb_gateway_service - 135 - Gateway started."
""2020-12-01 13:06:58" - DEBUG - [modbus_connector.py] - modbus_connector - 237 - Modbus trying connect to Serial Machine"
""2020-12-01 13:06:58" - DEBUG - [modbus_connector.py] - modbus_connector - 239 - Modbus connected."
""2020-12-01 13:06:58" - DEBUG - [tb_client.py] - tb_client - 83 - TB client <paho.mqtt.client.Client object at 0x757357d0> connected to ThingsBoard"
""2020-12-01 13:06:58" - INFO - [tb_device_mqtt.py] - tb_device_mqtt - 141 - connection SUCCESS"
""2020-12-01 13:06:58" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 147 - Connected device Serial Machine"
""2020-12-01 13:06:58" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes - successfully completed."
""2020-12-01 13:06:58" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes/response - successfully completed."
""2020-12-01 13:06:58" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/rpc - successfully completed."
""2020-12-01 13:06:58" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 301 - Subscribed to * with id 2"
""2020-12-01 13:06:58" - INFO - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 176 - Subscribed to *|* with id 2"
""2020-12-01 13:06:59" - DEBUG - [tb_gateway_service.py] - tb_gateway_service - 233 - Received data: {}"
""2020-12-01 13:07:09" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 125 - Disconnected client: <paho.mqtt.client.Client object at 0x757357d0>, user data: None, result code: 1"
""2020-12-01 13:07:19" - DEBUG - [tb_client.py] - tb_client - 83 - TB client <paho.mqtt.client.Client object at 0x757357d0> connected to ThingsBoard"
""2020-12-01 13:07:19" - INFO - [tb_device_mqtt.py] - tb_device_mqtt - 141 - connection SUCCESS"
""2020-12-01 13:07:19" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 147 - Connected device Serial Machine"
""2020-12-01 13:07:19" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes - successfully completed."
""2020-12-01 13:07:19" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes/response - successfully completed."
""2020-12-01 13:07:19" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/rpc - successfully completed."
""2020-12-01 13:07:19" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 301 - Subscribed to * with id 3"
""2020-12-01 13:07:19" - INFO - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 176 - Subscribed to *|* with id 3"
""2020-12-01 13:07:29" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 125 - Disconnected client: <paho.mqtt.client.Client object at 0x757357d0>, user data: None, result code: 1"
""2020-12-01 13:07:33" - DEBUG - [modbus_connector.py] - modbus_connector - 301 - With result Modbus Error: [Input/Output] Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received)"
""2020-12-01 13:07:33" - DEBUG - [modbus_connector.py] - modbus_connector - 140 - Checking attributes for device Serial Machine"
""2020-12-01 13:07:33" - DEBUG - [modbus_connector.py] - modbus_connector - 142 - {'timeseries': {}, 'attributes': {'test': {'data_sent': {'wordorder': 'LITTLE', 'byteOrder': 'BIG', 'tag': 'test', 'type': 'long', 'functionCode': 4, 'registerCount': 1, 'address': 4, 'deviceName': 'Serial Machine'}, 'input_data': ModbusIOException(InvalidMessageReceivedException('Incomplete message received, expected at least 2 bytes (0 received)'), 4)}}}"
""2020-12-01 13:07:33" - ERROR - [bytes_modbus_uplink_converter.py] - bytes_modbus_uplink_converter - 84 - 'NoneType' object has no attribute 'upper'"
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/thingsboard_gateway-2.5.4-py3.7.egg/thingsboard_gateway/connectors/modbus/bytes_modbus_uplink_converter.py", line 48, in convert
word_endian_order = Endian.Little if word_order.upper() == "LITTLE" else Endian.Big
AttributeError: 'NoneType' object has no attribute 'upper'
""2020-12-01 13:07:33" - DEBUG - [bytes_modbus_uplink_converter.py] - bytes_modbus_uplink_converter - 85 - {'deviceName': 'Serial Machine', 'deviceType': 'default', 'telemetry': [], 'attributes': []}"
""2020-12-01 13:07:33" - DEBUG - [modbus_connector.py] - modbus_connector - 178 - Data has not been changed."
""2020-12-01 13:07:33" - DEBUG - [modbus_connector.py] - modbus_connector - 237 - Modbus trying connect to Serial Machine"
""2020-12-01 13:07:33" - DEBUG - [modbus_connector.py] - modbus_connector - 239 - Modbus connected."
""2020-12-01 13:07:39" - DEBUG - [tb_client.py] - tb_client - 83 - TB client <paho.mqtt.client.Client object at 0x757357d0> connected to ThingsBoard"
""2020-12-01 13:07:39" - INFO - [tb_device_mqtt.py] - tb_device_mqtt - 141 - connection SUCCESS"
""2020-12-01 13:07:39" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 147 - Connected device Serial Machine"
""2020-12-01 13:07:40" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes - successfully completed."
""2020-12-01 13:07:40" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes/response - successfully completed."
""2020-12-01 13:07:40" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/rpc - successfully completed."
""2020-12-01 13:07:40" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 301 - Subscribed to * with id 4"
""2020-12-01 13:07:40" - INFO - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 176 - Subscribed to *|* with id 4"
""2020-12-01 13:07:50" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 125 - Disconnected client: <paho.mqtt.client.Client object at 0x757357d0>, user data: None, result code: 1"
""2020-12-01 13:08:00" - DEBUG - [tb_client.py] - tb_client - 83 - TB client <paho.mqtt.client.Client object at 0x757357d0> connected to ThingsBoard"
""2020-12-01 13:08:00" - INFO - [tb_device_mqtt.py] - tb_device_mqtt - 141 - connection SUCCESS"
""2020-12-01 13:08:00" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 147 - Connected device Serial Machine"
""2020-12-01 13:08:00" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes - successfully completed."
""2020-12-01 13:08:00" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes/response - successfully completed."
""2020-12-01 13:08:00" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/rpc - successfully completed."
""2020-12-01 13:08:00" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 301 - Subscribed to * with id 5"
""2020-12-01 13:08:00" - INFO - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 176 - Subscribed to *|* with id 5"
""2020-12-01 13:08:08" - DEBUG - [modbus_connector.py] - modbus_connector - 301 - With result Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response"
""2020-12-01 13:08:08" - DEBUG - [modbus_connector.py] - modbus_connector - 140 - Checking attributes for device Serial Machine"
""2020-12-01 13:08:08" - DEBUG - [modbus_connector.py] - modbus_connector - 142 - {'timeseries': {}, 'attributes': {'test': {'data_sent': {'wordorder': 'LITTLE', 'byteOrder': 'BIG', 'tag': 'test', 'type': 'long', 'functionCode': 4, 'registerCount': 1, 'address': 4, 'deviceName': 'Serial Machine'}, 'input_data': ModbusIOException('No Response received from the remote unit/Unable to decode response', 4)}}}"
""2020-12-01 13:08:08" - ERROR - [bytes_modbus_uplink_converter.py] - bytes_modbus_uplink_converter - 84 - 'NoneType' object has no attribute 'upper'"
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/thingsboard_gateway-2.5.4-py3.7.egg/thingsboard_gateway/connectors/modbus/bytes_modbus_uplink_converter.py", line 48, in convert
word_endian_order = Endian.Little if word_order.upper() == "LITTLE" else Endian.Big
AttributeError: 'NoneType' object has no attribute 'upper'
""2020-12-01 13:08:08" - DEBUG - [bytes_modbus_uplink_converter.py] - bytes_modbus_uplink_converter - 85 - {'deviceName': 'Serial Machine', 'deviceType': 'default', 'telemetry': [], 'attributes': []}"
""2020-12-01 13:08:08" - DEBUG - [modbus_connector.py] - modbus_connector - 178 - Data has not been changed."
""2020-12-01 13:08:10" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 125 - Disconnected client: <paho.mqtt.client.Client object at 0x757357d0>, user data: None, result code: 1"
""2020-12-01 13:08:21" - DEBUG - [tb_client.py] - tb_client - 83 - TB client <paho.mqtt.client.Client object at 0x757357d0> connected to ThingsBoard"
""2020-12-01 13:08:21" - INFO - [tb_device_mqtt.py] - tb_device_mqtt - 141 - connection SUCCESS"
""2020-12-01 13:08:21" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 147 - Connected device Serial Machine"
""2020-12-01 13:08:21" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes - successfully completed."
""2020-12-01 13:08:21" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes/response - successfully completed."
""2020-12-01 13:08:21" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/rpc - successfully completed."
""2020-12-01 13:08:21" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 301 - Subscribed to * with id 6"
""2020-12-01 13:08:21" - INFO - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 176 - Subscribed to *|* with id 6"
""2020-12-01 13:08:31" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 125 - Disconnected client: <paho.mqtt.client.Client object at 0x757357d0>, user data: None, result code: 1"
""2020-12-01 13:08:41" - DEBUG - [tb_client.py] - tb_client - 83 - TB client <paho.mqtt.client.Client object at 0x757357d0> connected to ThingsBoard"
""2020-12-01 13:08:41" - INFO - [tb_device_mqtt.py] - tb_device_mqtt - 141 - connection SUCCESS"
""2020-12-01 13:08:41" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 147 - Connected device Serial Machine"
""2020-12-01 13:08:41" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes - successfully completed."
""2020-12-01 13:08:41" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes/response - successfully completed."
""2020-12-01 13:08:41" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/rpc - successfully completed."
""2020-12-01 13:08:42" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 301 - Subscribed to * with id 7"
""2020-12-01 13:08:42" - INFO - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 176 - Subscribed to *|* with id 7"
""2020-12-01 13:08:43" - DEBUG - [modbus_connector.py] - modbus_connector - 301 - With result Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response"
""2020-12-01 13:08:43" - DEBUG - [modbus_connector.py] - modbus_connector - 140 - Checking attributes for device Serial Machine"
""2020-12-01 13:08:43" - DEBUG - [modbus_connector.py] - modbus_connector - 142 - {'timeseries': {}, 'attributes': {'test': {'data_sent': {'wordorder': 'LITTLE', 'byteOrder': 'BIG', 'tag': 'test', 'type': 'long', 'functionCode': 4, 'registerCount': 1, 'address': 4, 'deviceName': 'Serial Machine'}, 'input_data': ModbusIOException('No Response received from the remote unit/Unable to decode response', 4)}}}"
""2020-12-01 13:08:43" - ERROR - [bytes_modbus_uplink_converter.py] - bytes_modbus_uplink_converter - 84 - 'NoneType' object has no attribute 'upper'"
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/thingsboard_gateway-2.5.4-py3.7.egg/thingsboard_gateway/connectors/modbus/bytes_modbus_uplink_converter.py", line 48, in convert
word_endian_order = Endian.Little if word_order.upper() == "LITTLE" else Endian.Big
AttributeError: 'NoneType' object has no attribute 'upper'
""2020-12-01 13:08:43" - DEBUG - [bytes_modbus_uplink_converter.py] - bytes_modbus_uplink_converter - 85 - {'deviceName': 'Serial Machine', 'deviceType': 'default', 'telemetry': [], 'attributes': []}"
""2020-12-01 13:08:43" - DEBUG - [modbus_connector.py] - modbus_connector - 178 - Data has not been changed."
""2020-12-01 13:08:52" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 125 - Disconnected client: <paho.mqtt.client.Client object at 0x757357d0>, user data: None, result code: 1"
""2020-12-01 13:09:02" - DEBUG - [tb_client.py] - tb_client - 83 - TB client <paho.mqtt.client.Client object at 0x757357d0> connected to ThingsBoard"
""2020-12-01 13:09:02" - INFO - [tb_device_mqtt.py] - tb_device_mqtt - 141 - connection SUCCESS"
""2020-12-01 13:09:02" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 147 - Connected device Serial Machine"
""2020-12-01 13:09:02" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes - successfully completed."
""2020-12-01 13:09:02" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes/response - successfully completed."
""2020-12-01 13:09:02" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/rpc - successfully completed."
""2020-12-01 13:09:02" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 301 - Subscribed to * with id 8"
""2020-12-01 13:09:02" - INFO - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 176 - Subscribed to *|* with id 8"
""2020-12-01 13:09:13" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 125 - Disconnected client: <paho.mqtt.client.Client object at 0x757357d0>, user data: None, result code: 1"
""2020-12-01 13:09:19" - DEBUG - [modbus_connector.py] - modbus_connector - 301 - With result Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response"
""2020-12-01 13:09:19" - DEBUG - [modbus_connector.py] - modbus_connector - 140 - Checking attributes for device Serial Machine"
""2020-12-01 13:09:19" - DEBUG - [modbus_connector.py] - modbus_connector - 142 - {'timeseries': {}, 'attributes': {'test': {'data_sent': {'wordorder': 'LITTLE', 'byteOrder': 'BIG', 'tag': 'test', 'type': 'long', 'functionCode': 4, 'registerCount': 1, 'address': 4, 'deviceName': 'Serial Machine'}, 'input_data': ModbusIOException('No Response received from the remote unit/Unable to decode response', 4)}}}"
""2020-12-01 13:09:19" - ERROR - [bytes_modbus_uplink_converter.py] - bytes_modbus_uplink_converter - 84 - 'NoneType' object has no attribute 'upper'"
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/thingsboard_gateway-2.5.4-py3.7.egg/thingsboard_gateway/connectors/modbus/bytes_modbus_uplink_converter.py", line 48, in convert
word_endian_order = Endian.Little if word_order.upper() == "LITTLE" else Endian.Big
AttributeError: 'NoneType' object has no attribute 'upper'
""2020-12-01 13:09:19" - DEBUG - [bytes_modbus_uplink_converter.py] - bytes_modbus_uplink_converter - 85 - {'deviceName': 'Serial Machine', 'deviceType': 'default', 'telemetry': [], 'attributes': []}"
""2020-12-01 13:09:19" - DEBUG - [modbus_connector.py] - modbus_connector - 178 - Data has not been changed."
""2020-12-01 13:09:23" - DEBUG - [tb_client.py] - tb_client - 83 - TB client <paho.mqtt.client.Client object at 0x757357d0> connected to ThingsBoard"
""2020-12-01 13:09:23" - INFO - [tb_device_mqtt.py] - tb_device_mqtt - 141 - connection SUCCESS"
""2020-12-01 13:09:23" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 147 - Connected device Serial Machine"
""2020-12-01 13:09:23" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes - successfully completed."
""2020-12-01 13:09:23" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/attributes/response - successfully completed."
""2020-12-01 13:09:23" - DEBUG - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 66 - Service subscription to topic v1/gateway/rpc - successfully completed."
""2020-12-01 13:09:23" - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 301 - Subscribed to * with id 9"
""2020-12-01 13:09:23" - INFO - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 176 - Subscribed to *|* with id 9"
|
Hi @io-r-ahmed , type long in your config equals to 32uint, but at the same time 32uint are take 2 registers, so the gateway cannot parse received data. Please try to change type parameter in your configuration file to 16uint and probably you will be able to read the value. |
Hi Gents, I am new in to Thingsboard(TB) and trying to connect TB CE into gateway and MQTT. Could you please help me crack the issue below: My TB-Gateway Restart Logs root@59d6703b21db:/thingsboard_gateway/config# python3 -c 'from thingsboard_gateway.gateway.tb_gateway_service import TBGatewayService; TBGatewayService("./tb_gateway.yaml")' |
@io-r-ahmed @ZBeacon Note that 'NoneType' object has no attribute 'upper' is one of the 2 parsing issues I experienced after tackling JSONDecoderError from MQTT.JSON config file. |
Situation: I have setup Thingsboard community edition (CE) in my local development environment and I want to connect Thingsboard CE to an external real-time messaging system (Pub/Sub or Kafka, etc.) Action: I have Thingsboard CE server running both locally and Demo instance. I used installation guide to configure a Thingsboard gateway that allow communication through MQTT connector and I have an MQTT client that simulate a device publishing topics and telemetry. The gateway provision is based on two files respectively tb-gateway.yaml (Contain Thingsboard CE server endpoint & redirect to mqtt.json) and mqtt.json (Contain all topic structure & endpoint to the Manager/MQTT) Results: On Thingsboard server screen, gateway device latest telemetry shows mqttbrokerconnectoreventproduced and mqttbrokerconnectoreventsent along eventproduced are 0 and logs/tb-connection.log shows subscription success to the targeted topic published by MQTT client. On gateway console, during gateway restart there’s a simple JSON decoder error. And “‘NoneType’ object has no attribute” (Being recreated). However, I am able to post telemetry from the gateway using curl API client as in hard coded and it appears On Thingsboard server screen as attribute and value of the gateway device latest telemetry. |
kindly note more logs for this ticket. cat /logs/connector.log
""2021-03-01 11:07:07" - INFO - [mqtt_connector.py] - mqtt_connector - 159 - Number of rejected mapping handlers: 0" |
Also kindly note below directory data/file content where I save the payload for each subscription to MQTT as per my tb_gateway.yaml configure the file is empty. root@containerid:/thingsboard_gateway/config# ls -al data/ |
Hi @malinglb , Thank you for your interest in ThingsBoard IoT gateway, but your question doesn't relate to the general topic of this issue. It looks like you have an issue with your payload from external broker - the gateway cannot parse it as a json, so it cannot convert the incoming value. Please check it and make sure that incoming data from external broker is json formatted. If you have different payload, you should use custom converter to parse data. |
@ZBeacon thank you for the feedback. Yes, I'm getting payload from an external broker and I formatted the message as json. Will try to publish to the custom converter. |
Describe the issue
Create description about your issue, and your actions to solve it.
I am having an issue integrating modbus serial with thingsboard gateway, where the device is created on thingsboard and modbus is connected but no attributes is being created providing at the log this error "'NoneType' object has no attribute 'upper'"
At first I was working with thingsboard gateway as a package the one at this link https://thingsboard.io/docs/iot-gateway/install/deb-installation/ then after following different issues I installed the latest version from source but the same error is still here, please help!
Configuration (Attach your configuration file)
Notate: Remove Access token from file if you wanna attach tb_gateway.yaml
Connector name (If you need help with some connector/converter):
[e.g. MQTT Connector]
Modbus Serial
Error traceback (If it was raised):
""2020-11-29 10:36:56" - INFO - [tb_device_mqtt.py] - tb_device_mqtt - 141 - connection SUCCESS"
""2020-11-29 10:36:56" - INFO - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 176 - Subscribed to | with id 110"
""2020-11-29 10:36:58" - ERROR - [bytes_modbus_uplink_converter.py] - bytes_modbus_uplink_converter - 84 - 'NoneType' object has no attribute 'upper'"
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/thingsboard_gateway-2.5.4-py3.7.egg/thingsboard_gateway/connectors/modbus/bytes_modbus_uplink_converter.py", line 48, in convert
word_endian_order = Endian.Little if word_order.upper() == "LITTLE" else Endian.Big
AttributeError: 'NoneType' object has no attribute 'upper'
""2020-11-29 10:36:58" - INFO - [tb_device_mqtt.py] - tb_device_mqtt - 141 - connection SUCCESS"
""2020-11-29 10:36:58" - INFO - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 176 - Subscribed to | with id 111"
""2020-11-29 10:37:01" - INFO - [tb_device_mqtt.py] - tb_device_mqtt - 141 - connection SUCCESS"
""2020-11-29 10:37:01" - INFO - [tb_gateway_mqtt.py] - tb_gateway_mqtt - 176 - Subscribed to | with id 112"
And here is the log file after enabling DEBUG
logfile.txt
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: