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

TypeError: Can't instantiate abstract class Listener with abstract method on_message_received #69

Open
BaslyHedi opened this issue Nov 20, 2022 · 5 comments

Comments

@BaslyHedi
Copy link

BaslyHedi commented Nov 20, 2022

I'm using the Vector box VN1610, and i want to establish communication with an ECU to read a DID (service 0x22)
I get an exception when initializing the communication.
Uds_Channel = Uds(resId=BSC7_resId, reqId=BSC7_reqId, transportProtocol="CAN", interface="vector", appName="pythonUds", channel='0')
File "C:\Users\hba12\AppData\Roaming\Python\Python39\site-packages\uds\uds_communications\Uds\Uds.py", line 43, in init
self.tp = tpFactory(self.__transportProtocol, configPath=configPath, **kwargs)
File "C:\Users\hba12\AppData\Roaming\Python\Python39\site-packages\uds\uds_communications\TransportProtocols\TpFactory.py", line 37, in call
return CanTp(configPath=configPath, **kwargs)
File "C:\Users\hba12\AppData\Roaming\Python\Python39\site-packages\uds\uds_communications\TransportProtocols\Can\CanTp.py", line 96, in init
self.__connection = canConnectionFactory(self.callback_onReceive,
File "C:\Users\hba12\AppData\Roaming\Python\Python39\site-packages\uds\uds_communications\TransportProtocols\Can\CanConnectionFactory.py", line 52, in call
CanConnectionFactory.connections[connectionKey] = CanConnection(callback, filter,
File "C:\Users\hba12\AppData\Roaming\Python\Python39\site-packages\uds\uds_communications\TransportProtocols\Can\CanConnection.py", line 21, in init
listener = can.Listener()
TypeError: Can't instantiate abstract class Listener with abstract method on_message_received

Support is much appreciated

@BaslyHedi BaslyHedi changed the title Exception when using the uds-python lib with VN1610 TypeError: Can't instantiate abstract class Listener with abstract method on_message_received Nov 20, 2022
@BaslyHedi
Copy link
Author

@richClubb, Could you please take a look here and give me your analysis to the issue. Thanks in advance.
I'm using Python 3.9.

@BaslyHedi
Copy link
Author

BaslyHedi commented Nov 20, 2022

in Listener.py the abstract-method is implemented as follow

image

Could this be the root cause of the issue ?

There is no definition of on_message_received in Listener.py, i think it should be defined at least in one of the child-classes/sub-classes.

@AGUERY
Copy link

AGUERY commented Sep 26, 2023

Hello, any news about this issue ?
I have the same case

Thanks

@MarcoAzzolini
Copy link

hello,
i have the same case, do you have any suggestion?

thanks!

@davidsantos99mec
Copy link

Hello,

I had the same problem and found this issue with the same problem and some helpfull suggestions https://github.com/hardbyte/python-can/issues/900

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

No branches or pull requests

4 participants