You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sent messages are being received on the listener #136
I am using the cyclic example to send a few periodic messages. I also want to read messages at the same time on the same channel; however, all the messages I am sending are being received on the listener. Is there a way to disable this?
import can
can.rc['interface'] = 'virtual'
from can.interfaces.interface import Bus
bus = Bus()
msg1 = can.Message(arbitration_id=0x219, extended_id=False, data=[0, 0, 0, 0, 0, 0, 0, 0])
bus.send(msg1)
m = bus.recv(5)
if m is not None:
print(m)
Activity
hardbyte commentedon Jan 31, 2017
Since you're using socketcan you should be able to set this at the device level. Something like this should do it:
I'd recommend reading through the socketcan docs - perhaps there is a flag we could set when we create the bus?
Also in your example you shouldn't create a new notifier and buffered reader inside your recv loop:
altran-git commentedon Feb 1, 2017
Thanks. I get an Operation not supported when I use loopback off .
prices commentedon Oct 5, 2017
The virtual interface also has this problem:
Returns:
Timestamp: 1507205077.501877 ID: 0219 000 DLC: 8 00 00 00 00 00 00 00 00
Is there any way to turn this off? I am having trouble writing unit tests because of this.
christiansandberg commentedon Oct 5, 2017
The virtual interface should be fixed in the latest 2.0 pre-release (see #166).
prices commentedon Oct 5, 2017
Thanks. That does indeed fix my problem.