from can.interface import Bus
from can.message import Message
import time

bus = Bus(bustype='bmcan', channel=0, bitrate=500000, data_bitrate=2000000, tres=True)

msg = Message(arbitration_id=0x29E,
              data=bytes([0x80, 0x10, 0, 0, 0, 0, 0, 0]),
              is_extended_id=False, is_fd=False)
while True:
    print('Start sending')
    task = bus.send_periodic(msg, 1)
    time.sleep(2)
    print('Stop sending')
    task.stop()
    time.sleep(1)