hardbyte / hardbyte/python-can

'ixxat' interface not detected

未关闭
#1,164 9 条评论 0 个 reaction 已指派 1 人 已被 @marcel-kanter 认领 在 GitHub 查看
backend:ixxat bug
主要语言
Python
星标
1.6k
派生
697
PR 合并指标
30 天内没有已合并 PR

描述

The 'ixxat' interface is not detected with `python-can 3.3.4` :

```python
import can

can.interface.detect_available_configs()

Kvaser canlib is unavailable.
fcntl not available on this platform
libc is unavailable
failed to fetch opened can devices: [WinError 2] Le fichier spécifié est introuvable
Failed to load NI-CAN driver: [WinError 126] Le module spécifié est introuvable
Failed to load IS-CAN driver: [WinError 126] Le module spécifié est introuvable
Could not import vxlapi: [WinError 126] Le module spécifié est introuvable
Cannot load SYSTEC ucan library: [WinError 126] Le module spécifié est introuvable.
The SYSTEC ucan library has not been initialized.

[{'interface': 'virtual', 'channel': 'channel-3439'},
{'interface': 'neovi', 'serial': '120216'}]
```

If I loop on all interfaces, I can detect it though :

```python
# List possible CAN adapters (from 'python-can')
l_dict_valid = {}
l_list_cards = list(can.interfaces.BACKENDS.keys())
l_list_cards.sort()

# Drivers for supported cards :
# 'canalystii' : http
# 'iscan' : http
# 'ixxat' : https://www.ixxat.com/docs/librariesprovider8/ixxat-english-new/pc-can-interfaces/windows-drivers/vci-v4-windows-10-8-7.zip?sfvrsn=9ceb48d7_75
# 'kvaser' : http
# 'neovi' : https://cdn.intrepidcs.net/updates/files/RP1210KitInstall.zip
# old driver (https://cdn.intrepidcs.net/updates/files/ICSDrivers.zip)
# 'nican' : http
# 'pcan' : http
# 'serial' : http
# 'slcan' : http
# 'socketcan' : http
# 'systec' : http
# 'usb2can' : http
# 'vector' : http
# 'virtual' : http

# Virtual in an useless stub
l_list_cards.remove('virtual')

print(f"=== Loading CAN drivers ===")
for loop_str_card in l_list_cards:
# Try all l_list_cards
print(f"\n... Loading '{loop_str_card}' ...")
for loop_int_chan in range(4):
# Try only first 4 channels
for loop_str_baud, loop_int_baud in dict_CANP_CARD__BAUD.items():
# Try all bauds (1m, 500k, 250k, 125k)
try:
# Try connecting
with can.interface.Bus(
bustype = str(loop_str_card),
channel = str(loop_int_chan),
bitrate = int(loop_int_baud)
) as l_obj_bus:
# Register the combination as valid
try:
l_dict_valid[loop_str_card]
# - except KeyError -
try:
l_dict_valid[loop_str_card][loop_int_chan]
# - except KeyError -
try:
l_dict_valid[loop_str_card][loop_int_chan][loop_str_baud]
# - except KeyError -
# Register baudrate
raise KeyError
except KeyError:
l_dict_valid[loop_str_card][loop_int_chan][loop_str_baud] = loop_int_baud
except KeyError:
l_dict_valid[loop_str_card][loop_int_chan] = {loop_str_baud: loop_int_baud}
except KeyError:
l_dict_valid[loop_str_card] = {loop_int_chan: {loop_str_baud: loop_int_baud}}
except:
# Connection failed
pass
```

```batch
C:\Program Files\Spyder\Python>enaml-run "c:\Users\dkoch\Downloads\CAN\canp\canp_card_view.enaml"
=== Loading CAN drivers ===

... Loading 'canalystii' ...

... Loading 'iscan' ...
Failed to load IS-CAN driver: [WinError 126] Le module spécifié est introuvable

... Loading 'ixxat' ...

... Loading 'kvaser' ...
Kvaser canlib is unavailable.

... Loading 'neovi' ...
Error: set_bit_rate(): icsneoSetBitRate() Failed
Error: set_bit_rate(): icsneoSetBitRate() Failed
Error: set_bit_rate(): icsneoSetBitRate() Failed
Error: set_bit_rate(): icsneoSetBitRate() Failed
Error: set_bit_rate(): icsneoSetBitRate() Failed
Error: set_bit_rate(): icsneoSetBitRate() Failed
Error: set_bit_rate(): icsneoSetBitRate() Failed
Error: set_bit_rate(): icsneoSetBitRate() Failed

... Loading 'nican' ...
Failed to load NI-CAN driver: [WinError 126] Le module spécifié est introuvable

... Loading 'pcan' ...

... Loading 'serial' ...

... Loading 'slcan' ...

... Loading 'socketcan' ...
fcntl not available on this platform
libc is unavailable

... Loading 'systec' ...
Cannot load SYSTEC ucan library: [WinError 126] Le module spécifié est introuvable.

... Loading 'usb2can' ...

... Loading 'vector' ...
Could not import vxlapi: [WinError 126] Le module spécifié est introuvable
```

Yet trying all channels and all baud-rates pretty much hurts the CAN bus a lot (if not resilient to such invasion).

Regards.

_Originally posted by @Kochise in https://github.com/hardbyte/python-can/issues/303#issuecomment-964886754_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。