Skip to content
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

[BUG] version 3.6.2 #1624

Open
pro100805 opened this issue Dec 17, 2024 · 13 comments · Fixed by #1625
Open

[BUG] version 3.6.2 #1624

pro100805 opened this issue Dec 17, 2024 · 13 comments · Fixed by #1625
Assignees
Labels

Comments

@pro100805
Copy link

After configuring the gateway and adding the connector, nothing happens for some time. The devices described in the connector do not appear on the TB server.

some time later, the following message appears

Dec 17 13:09:24 tesssst-24-04 python3[1822]: File "/var/lib/thingsboard_gateway/venv/lib/python3.12/site-packages/thingsboard_gateway/connectors/modbus/modbus_connector.py", line 204, in __add_slaves
Dec 17 13:09:24 tesssst-24-04 python3[1822]: self.__add_slave(slave_config)
Dec 17 13:09:24 tesssst-24-04 python3[1822]: File "/var/lib/thingsboard_gateway/venv/lib/python3.12/site-packages/thingsboard_gateway/connectors/modbus/modbus_connector.py", line 195, in __add_slave
Dec 17 13:09:24 tesssst-24-04 python3[1822]: slave = Slave(self, self.__log, slave_config)
Dec 17 13:09:24 tesssst-24-04 python3[1822]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 17 13:09:24 tesssst-24-04 python3[1822]: File "/var/lib/thingsboard_gateway/venv/lib/python3.12/site-packages/thingsboard_gateway/connectors/modbus/slave.py", line 39, in init
Dec 17 13:09:24 tesssst-24-04 python3[1822]: config['host']) + ":" + str(config['port']) + ' ' + config['deviceName']
Dec 17 13:09:24 tesssst-24-04 python3[1822]: ~~~~~~^^^^^^^^
Dec 17 13:09:24 tesssst-24-04 python3[1822]: KeyError: 'host'
Dec 17 13:09:24 tesssst-24-04 python3[1822]: 2024-12-17 13:09:24 - |INFO| - [tb_gateway_service.py] - tb_gateway_service - __connect_with_connectors - 1022 - Cannot find separated report strategy for connector 'Serial'. The main report strategy will be used as a connector report strategy.

  • OS: Ubuntu 24.04
  • Thingsboard IoT Gateway version 3.6.2
  • Python version 3.12.3
@samson0v
Copy link
Contributor

Hi, @pro100805, thanks for your interest in ThingsBoard IoT Gateway!
We will fix this bug as soon as possible.

@samson0v samson0v linked a pull request Dec 18, 2024 that will close this issue
@samson0v
Copy link
Contributor

samson0v commented Dec 18, 2024

@pro100805 fix is available in the master branch. If something goes wrong, let us know.

@pro100805
Copy link
Author

Thank you for your prompt reply.
I am using DEB package for my installation. Please give instructions how to integrate your modified MASTER BRANCH into my installation. If possible, thank you in advance

@tangchengxiang666
Copy link

@pro100805修复已在 master 分支中提供。如果出现问题,请告知我们。

After modification according to the fix file, __get_master in modbus_connector.py file will show slave. host as None. Is this an error?
Snipaste_2024-12-18_16-37-42

@samson0v samson0v reopened this Dec 18, 2024
@pro100805
Copy link
Author

pro100805 commented Dec 18, 2024

Thank you, you've given me an idea and I think these are the changes that need to be made.
GW

7c78245

@pro100805
Copy link
Author

I'll make the changes and let you know what the result is.

@samson0v
Copy link
Contributor

@tangchengxiang666, it is ok

@pro100805
Copy link
Author

It's not as easy as I thought. It's possible that you need to rebuild something after the changes. I don't think I can do it without help.

@samson0v
Copy link
Contributor

@pro100805 deb file with the latest changes:

python3-thingsboard-gateway.deb.zip

@pro100805
Copy link
Author

The devices described in the connector do not appear on the TB server.

the following message appears

Dec 18 11:11:34 tesssst-24-04 python3[1005]: File "/usr/lib/python3.12/asyncio/events.py", line 88, in _run
Dec 18 11:11:34 tesssst-24-04 python3[1005]: self._context.run(self._callback, *self._args)
Dec 18 11:11:34 tesssst-24-04 python3[1005]: File "/var/lib/thingsboard_gateway/venv/lib/python3.12/site-packages/thingsboard_gateway/connectors/modbus/modbus_connector.py", line 223, in __process_requests
Dec 18 11:11:34 tesssst-24-04 python3[1005]: await self.__poll_device(slave)
Dec 18 11:11:34 tesssst-24-04 python3[1005]: File "/var/lib/thingsboard_gateway/venv/lib/python3.12/site-packages/thingsboard_gateway/connectors/modbus/modbus_connector.py", line 254, in __poll_device
Dec 18 11:11:34 tesssst-24-04 python3[1005]: self.__log.error('Failed to poll %s device: %s', slave, exc_info=e)
Dec 18 11:11:34 tesssst-24-04 python3[1005]: File "/var/lib/thingsboard_gateway/venv/lib/python3.12/site-packages/thingsboard_gateway/tb_utility/tb_logger.py", line 158, in error
Dec 18 11:11:34 tesssst-24-04 python3[1005]: super(TbLogger, self).error(msg, *args, **kwargs)
Dec 18 11:11:34 tesssst-24-04 python3[1005]: Message: 'Failed to poll %s device: %s'
Dec 18 11:11:34 tesssst-24-04 python3[1005]: Arguments: (<Slave(Modbus slave processor for unit 1 on port /dev/ttyUSB0 Reboot, started daemon 139179801446080)>,)

@tangchengxiang666
Copy link

@tangchengxiang666,沒有關係

After repairing it using the file you provided, it is still not available for serial cases

@imbeacon imbeacon reopened this Dec 19, 2024
@imbeacon
Copy link
Member

@samson0v Please assist.

@Jonnik84
Copy link

Jonnik84 commented Jan 10, 2025

Seems to be linked with my Issue
#1648 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants