Skip to content

Commit

Permalink
Merge pull request #155 from openxc/64-bit-python-fix
Browse files Browse the repository at this point in the history
64 bit python fix
  • Loading branch information
pjt0620 committed Sep 30, 2020
2 parents 8f1eb8b + b8c00b9 commit 0a94f1c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.rst
Expand Up @@ -30,6 +30,8 @@ In addition to a port of the Android library API, the package also contains a
number of command-line tools for connecting to the CAN translator and
manipulating previously recorded vehicle data.

If you are getting the error "ValueError: No backend available" on windows please reinstall your libusb0 driver using https://github.com/openxc/vi-windows-driver if you are in a envirment where you can not use an unsigned driver please use https://zadig.akeo.ie/

Due to changes in signals.cpp openxc-python Version 2.0.0 must be used with vi-firmware 8.0.0 or greater.
Due to changes with large diagnostic responses Version 2.1.0 must be used with vi-firmware 8.1.0 or greater.

Expand Down
11 changes: 9 additions & 2 deletions openxc/sources/usb.py
@@ -1,9 +1,10 @@
"""A USB vehicle interface data source."""


import os
import logging
import usb.core
import usb.util
from usb.backend import libusb0

from .base import BytestreamDataSource, DataSourceError

Expand Down Expand Up @@ -58,8 +59,14 @@ def __init__(self, vendor_id=None, product_id=None, **kwargs):
product_id = int(product_id, 0)
self.product_id = product_id or self.DEFAULT_PRODUCT_ID

devices = usb.core.find(find_all=True, idVendor=self.vendor_id,
if os.name == 'nt':
be = libusb0.get_backend()
devices = usb.core.find(backend=be, find_all=True, idVendor=self.vendor_id,
idProduct=self.product_id)
else:
devices = usb.core.find(find_all=True, idVendor=self.vendor_id,
idProduct=self.product_id)

for device in devices:
self.device = device
try:
Expand Down

0 comments on commit 0a94f1c

Please sign in to comment.