Skip to content

Using kvaser revealed issues with connect. #2015

Open

Description

@crane491

bus = can.interface.Bus(interface='kvaser', channel=0, bitrate=500000)
when run this report error

File "\Lib\site-packages\can\interfaces\kvaser\canlib.py", line 563, in init
canIoCtlInit(
~~~~~~~~~~~~^
^^^^^^^^^^^^^^^^^^
...<2 lines>...
1,
^^
)
^
File "\Lib\site-packages\can\interfaces\kvaser\canlib.py", line 102, in __check_status_operation
raise CANLIBOperationError(function, result, arguments)
can.interfaces.kvaser.canlib.CANLIBOperationError: Function canIoCtl failed - Error in parameter [Error Code -1]

examining the original files of canlib, there is no longer a definition for canIOCTL_SET_LOCAL_TXACK.

so I commented out the following code, and it works fine now.

    # enable canMSG_LOCAL_TXACK flag in received messages

    # canIoCtlInit(
    #     self._read_handle,
    #     canstat.canIOCTL_SET_LOCAL_TXACK,
    #     ctypes.byref(ctypes.c_byte(local_echo)),
    #     1,
    # )

Activity

  1. plerenius commented on Mar 10, 2026

    @plerenius

    I have the same issue. Above seemed to solve it for me too. However, it's not working when using pyinstaller to build a application. So I had to go back to 4.5.0, which works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions