Skip to content

own_ca_producer ends in PcanCanOperationError #87

@TurirBarym

Description

@TurirBarym

Using the own_ca_producer example for a quick test, and when the time over, the script does not finish completely, but throws the following exception

`
Exception in thread j1939.ecu job_thread:
Traceback (most recent call last):
File "C:\Python3124\Lib\threading.py", line 1073, in _bootstrap_inner
self.run()

File "C:\Python3124\Lib\threading.py", line 1010, in run
self._target(*self._args, **self._kwargs)
File "c:\Users\xxx\venv\Lib\site-packages\j1939\electronic_control_unit.py", line 282, in _async_job_thread
next_wakeup = self.j1939_dll.async_job_thread(now)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\xxx\venv\Lib\site-packages\j1939\j1939_21.py", line 253, in async_job_thread
self.__send_tp_dt(buf['src_address'], buf['dest_address'], data)
File "c:\Users\xxx\venv\Lib\site-packages\j1939\j1939_21.py", line 429, in __send_tp_dt
self.__send_message(mid.can_id, True, data)
File "c:\Users\xxx\venv\Lib\site-packages\j1939\electronic_control_unit.py", line 240, in send_message
self._bus.send(msg)
File "c:\Users\xxx\venv\Lib\site-packages\can\interfaces\pcan\pcan.py", line 655, in send
raise PcanCanOperationError(
can.interfaces.pcan.pcan.PcanCanOperationError: Failed to send: A PCAN Channel has not been initialized yet or the initialization process has failed
`

Further test with adding a time.time(10) between ca.stop() and ecu.disconnect shows that the timed are not stopped but continue being set until ecu.disconnect closes the can connection leading to the exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions