i am trying right now to read my can-data with a python code:
`import can
import time
def read_can_message():
bus = can.interface.Bus(channel=’COM3′, bustype=’serial’)
while True:
message = bus.recv()
if message.arbitration_id == 0x276:
print(f"ID: {message.arbitration_id}, Data: {message.data.hex()}")
if name == “main“:
read_can_message()`
when im starting the code there isn’t a error but just nothing appears in the terminal. i also defined the channel and bustype correctly, otherwise there would be an error.
please help
i tried numerous codes / approaches, but i never got any respond
Oliver is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.