View Single Post
Old 02-25-2022, 01:31 AM   #159
Stephane3296
Junior Member
 
Join Date: Feb 2022
Drives: 2014 Scion FRS
Location: Ontario, Canada
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Hey everyone, I was wondering if anyone managed to get Can-bus data using a raspberry pi and a PiCAN shield. I am able to use the Cansniffer can0 to see the data, however, using it in a program is where I'm running into trouble. I am encountering a problem with the PIDs having a value greater than 256 (a byte), which gives me an error with the python-can module of:

self.data = bytearray(data)
ValueError: byte must be in range(0, 256)

I am aware this has more to do with the coding side of working with Can-bus data than what the post has mostly talked about, however, I have been stumped on it for a while and thought I'd ask here to see if anyone has done it.

Thank you all for your time, if you have any questions about the code or anything please let me know.

The code I am trying to get working:
[URL="https://github.com/blupants/chupacarbrah"]
Stephane3296 is offline   Reply With Quote