Python 2.7 ctypes for send_periodic with 32 Bit CPU

Issue #90 new
peter romero created an issue

send_periodic is just supported with Python 2.7 were ctypes have to be used for 64 bit CPUs !?

related issues: https://bitbucket.org/hardbyte/python-can/issues/60/problem-using-cyclic-message https://bitbucket.org/hardbyte/python-can/issues/58/sending-periodically-doesnt-work-even

i have been using a PCAN-USB (IPEH-002021) http://www.peak-system.com/PCAN-USB.199.0.html

It works on OpenSuse13.2 3.16.7-42-desktop #1 SMP PREEMPT Tue Jun 28 12:20:57 UTC 2016 (35ab731) x86_64 x86_64 x86_64 GNU/Linux and fails on OpenSuse13.2 3.16.7-53-desktop #1 SMP PREEMPT Fri Dec 2 13:19:28 UTC 2016 (7b4a1f9) i686 i686 i386 GNU/Linux

Debuging on python_can-1.5.2

strace short WORKING

socket(PF_CAN, SOCK_DGRAM, 2) = 3 sendto(3, "\1\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 72, MSG_TRUNC|MSG_DONTWAIT|MSG_EOR|MSG_WAITALL|MSG_SYN|MSG_CMSG_CLOEXEC|0xade0010, NULL, 0) = 72

strace short FAILED

socket(PF_CAN, SOCK_DGRAM, 2) = 3 send(3, "\1\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\206\1\0\201\1\0\0"..., 52, MSG_OOB|MSG_PEEK|MSG_DONTROUTE|MSG_CTRUNC|MSG_WAITALL|MSG_SYN|MSG_ERRQUEUE|MSG_NOSIGNAL|MSG_MORE|MSG_FASTOPEN|0x97620000) = -1 EINVAL (Invalid argument)

down the site-packages/can/interfaces/socketcan_ctypes.py class CyclicSendTask(SocketCanCtypesBCMBase, CyclicSendTaskABC): def _tx_setup(self): bytes_sent = libc.send(self.bcm_socket, ctypes.byref(frame), ctypes.sizeof(frame))

Does any one know why send gets turned to sendto (see above ## strace short WORKING) ?

Does anyone have it running on a 32bit CPU ?

Comments (0)

  1. Log in to comment