hardbyte / hardbyte/python-can

'ixxat' interface not detected

オープン
#1,164 コメント 9 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。