From 4ed583a65f51bc15d4a77b3349857bbf15b3cf4f Mon Sep 17 00:00:00 2001 From: Felix Divo Date: Mon, 12 Feb 2018 02:20:41 +1100 Subject: [PATCH] fix #219 (cherry picked from commit 0c588b3) --- can/interfaces/usb2can/usb2canInterface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/can/interfaces/usb2can/usb2canInterface.py b/can/interfaces/usb2can/usb2canInterface.py index 9d9a68fc6..57c2b330c 100644 --- a/can/interfaces/usb2can/usb2canInterface.py +++ b/can/interfaces/usb2can/usb2canInterface.py @@ -114,14 +114,14 @@ def __init__(self, channel, *args, **kwargs): br = kwargs["bitrate"] # max rate is 1000 kbps - baudrate = max(1000, int(br/1000)) + baudrate = min(1000, int(br/1000)) # set default value else: baudrate = 500 connector = format_connection_string(deviceID, baudrate) - self.handle = self.can.open(connector, enable_flags) + self.handle = self.can.open(connector.encode('utf-8'), enable_flags) def send(self, msg, timeout=None): tx = message_convert_tx(msg)