I am trying to connect with a motor that uses CANopen through the PCAN-USB interface. once i try to connect a network from python with the command
network.connect(bustype='pcan', channel='PCAN_USBBUS1', bitrate=250000)
I get the following error
Code: Select all
1554993945.673387: ERROR: failed to scan directory (errno=2) '/sys/class/pcan'
1554993945.673405: ERROR: failed to open file (errno=2) '/sys/class/pcan/version'.
Traceback (most recent call last):
File "1CANopen_com.py", line 14, in <module>
network.connect(bustype='pcan', channel='PCAN_USBBUS1', bitrate=250000)
File "/home/felipe/.local/lib/python2.7/site-packages/canopen/network.py", line 109, in connect
self.bus = can.interface.Bus(*args, **kwargs)
File "/home/felipe/.local/lib/python2.7/site-packages/can/interface.py", line 127, in __new__
return cls(channel, *args, **config)
File "/home/felipe/.local/lib/python2.7/site-packages/can/interfaces/pcan/pcan.py", line 108, in __init__
raise PcanError(self._get_formatted_error(result))
can.interfaces.pcan.pcan.PcanError: The driver is not loaded
Code: Select all
1554993851.281737: ERROR: failed to scan directory (errno=2) '/sys/class/pcan'
1554993851.281785: ERROR: failed to open file (errno=2) '/sys/class/pcan/version'.
Segmentation fault (core dumped)
Please let me know if you know how to correct this error. Thanks in advance!!