python-can[canalystii] receives data but transmit messages time-out #1670
Unanswered
geir-opdahl
asked this question in
Q&A
Replies: 1 comment
-
You might have more luck asking here: https://github.com/projectgus/python-canalystii |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all. I have a Canalyst-II that I'm trying to connect to a CANopen based gearmotor but I'm having issues getting it to communicate. I can consistently read heartbeat messages from the device and was somehow able to get other unsolicited messages, however, when I try to send a message, it times out every time, no matter how long I make the timeout period. Any suggestions for what could cause this? I'm new to CAN bus so there's been a bit of a learning curve. Any advice would be much appreciated.
#Set up the interface and open the bus
import can
can.rc['interface'] = 'canalystii'
can.rc['bitrate'] = 500000
can.rc['channel'] = 0
from can.interface import Bus
bus = Bus()
#Start the notifier to print out bus messages
notifier = can.Notifier(bus, [can.Logger("recorded.log"), can.Printer()])
#Read values of index 6064, sub index 0 of motor with device ID 2
message = can.Message(arbitration_id=0x602, is_extended_id=False, data=[0x40, 0x64, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00])
#Send the message
bus.send(message, timeout=5)
#Console output
Timestamp: 8145.950500 ID: 0182 S Rx DL: 8 31 16 00 00 00 00 00 00 Channel: 0
Timestamp: 8146.683400 ID: 0702 S Rx DL: 1 05 Channel: 0
Timestamp: 8146.949200 ID: 0182 S Rx DL: 8 31 16 00 00 00 00 00 00 Channel: 0
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2023.1.2\plugins\python-ce\helpers\pydev\pydevconsole.py", line 364, in runcode
coro = func()
File "", line 4, in
File "C:\Users\geiro\PycharmProjects\eclipsevalve\venv\lib\site-packages\can\interfaces\canalystii.py", line 127, in send
raise CanTimeoutError(f"Send timed out after {timeout} seconds")
can.exceptions.CanTimeoutError: Send timed out after 5 seconds
Timestamp: 8147.948000 ID: 0182 S Rx DL: 8 31 16 00 00 00 00 00 00 Channel: 0
Timestamp: 8148.680800 ID: 0702 S Rx DL: 1 05 Channel: 0
Timestamp: 8148.946700 ID: 0182 S Rx DL: 8 31 16 00 00 00 00 00 00 Channel: 0
Beta Was this translation helpful? Give feedback.
All reactions