# CAN data stream not stable



## ozaibaq (2 mo ago)

Hi all.

I'm working on Tesla model 3 with direct connection with the CAN bus.
I'm using python3 pyserial package.

While I was trying to read the speed (ID 0x257) (filtering incoming data with b'\x08\x00\x00\x02\x57'), I found that so many packets make no sense. Most of the packets are not real speed, not sure what exactly are they. However I was able to catch some reasonable values that represent the real speed.


Here is a sample data:
Notes:

Real data (representing real speed) are marked with the symbol '>' at the beginning of the line.
I only printed the data field (8 bytes).
Each byte is printed in binary and decimal.


```
>01111000 120    01001110 78    00011111 31    00000111 7    00000000 0    00000000 0    00001000 8    00000000 0
>speed_decoded: 0.0

>01110010 114    01001000 72    00011111 31    00000000 0    00000010 2    10100000 160    00000111 7    00000000 0
>speed_decoded: 0.0

>01110111 119    01001101 77    00011111 31    00000000 0    00000010 2    10100000 160    00000111 7    00000000 0
>speed_decoded: 0.0

00001000 8    00000000 0    00000000 0    00000111 7    00000000 0    00001000 8    00000000 0    00000000 0
speed_decoded: -40.0

>10100101 165    01100110 102    00100001 33    00000010 2    00000010 2    00000111 7    00000000 0    00000000 0
>speed_decoded: 2.7200000000000046

>10101010 170    01101011 107    00100001 33    00000010 2    00000010 2    00000111 7    00000000 0    00001000 8
>speed_decoded: 2.7200000000000046

>10101100 172    01100101 101    00100001 33    00000010 2    00000111 7    00000000 0    00000000 0    00001000 8
>speed_decoded: 2.7200000000000046

>11011000 216    10001000 136    00100001 33    00000011 3    00000111 7    00000000 0    00001000 8    00000000 0
>speed_decoded: 2.8800000000000012

>11010111 215    10000111 135    00100001 33    00000111 7    00000000 0    00001000 8    00000000 0    00000000 0
>speed_decoded: 2.8800000000000012

11011111 223    10001111 143    00000111 7    00000000 0    00000000 0    00001000 8    00000000 0    00000000 0
speed_decoded: -30.400000000000002

11010011 211    00001000 8    00000000 0    00000000 0    00000111 7    00000000 0    00001000 8    00000000 0
speed_decoded: -40.0

00000111 7    00000000 0    00000000 0    00000001 1    00001000 8    00000000 0    00000000 0    00001000 8
speed_decoded: -40.0

10100001 161    00001000 8    00000000 0    00000111 7    00000000 0    00000000 0    00001000 8    00000000 0
speed_decoded: -40.0

10101000 168    00000111 7    00000000 0    00000000 0    00000001 1    00001000 8    00000000 0    00000000 0
speed_decoded: -40.0

01110101 117    00001000 8    00000000 0    00000111 7    00000000 0    00000000 0    00001000 8    00000000 0
speed_decoded: -40.0

>10110000 176    01001101 77    00011111 31    00000001 1    00000010 2    11011000 216    00000100 4    00000000 0
>speed_decoded: 0.0

>10011010 154    01000111 71    00011111 31    00000001 1    00000010 2    00000100 4    00000000 0    00000111 7
>speed_decoded: 0.0

10000000 128    01000110 70    00000100 4    00000000 0    00001000 8    00000000 0    00000000 0    00000111 7
speed_decoded: -34.56

00000111 7    00000000 0    00000000 0    00000001 1    00001000 8    00000000 0    00000000 0    00001000 8
speed_decoded: -40.0
```

This is not only happening when trying to read the speed. It happens in so many IDs such as 0x102 for door status.

Is there some way to filter these unneeded data?
Also, Sometimes, suddenly vehicle stops sending speed data for ~10 seconds or more.

I've been struggling for days. If anyone has ever seen similar behavior, please let me know.


----------

