File "./myFile.py", line 27, in send_one
bus = can.interface.Bus()
File "/usr/local/lib/python2.7/dist-packages/can/interfaces/interface.py", line 72, in __new__
return cls(channel, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/can/interfaces/pcan.py", line 80, in __init__
self.m_objPCANBasic = PCANBasic()
File "/usr/local/lib/python2.7/dist-packages/can/interfaces/PCANBasic.py", line 46, in __init__
self.__m_dllBasic = windll.LoadLibrary("PCANBasic")
NameError: global name 'windll' is not defined
Can anyone tell me please, why i do not get the linux sources with „pip install python-can“?
If i look into the installed file "/usr/local/lib/python2.7/dist-packages/can/interfaces/PCANBasic.py", I can see there is really a missing option to load "libpcanbasic.so". There is only the option for self.__m_dllBasic = windll.LoadLibrary("PCANBasic").
Thank you very much for your response. It is running now. :)
I add your suggested channel description “PCAN_USBBUS”, but I cannot see any documentation for that. Google search for “PCAN_USBBUS“ gets only one hit.
I would like to ask a second question:
I use the send_one()-example with my PCAN. A second one at this physical bus will cat me every message.
If I start send_one(), I see no message on the bus.
If I add a second “bus.send(msg)” to the function send_one(), I see two identical messages on the bus.
Otherwise if I only add “bus.rec()”, I also see my desired message on the second one.
Closing the bus with “bus.shutdown()” will not solve my problem. I there anything I should care about to prevent buffering on my hardware (or anything else?)?.