GeekyDeaks / fanatec-pedal-emulator

Emulate Fanatec CSL Elite V2 Pedals
11 stars 1 forks source link

Why are my first and second step rx values ​​different? #1

Closed LoadingSky closed 1 month ago

LoadingSky commented 2 months ago

Hello, I use Arduino to try to send data to fanatec wheelbase rj12 rx interface, but the data received by Arduino is different from what you provided. I connected the control board to fanatec wheelbase through the line jumper to Arduino to get the data. At first I tried 115200 baud rate, and got the following data: wheelbase TX: 248 wheelbase TX: 248 wheelbase TX: 248 wheelbase TX: 248 wheelbase TX: 248 .... control board TX: 250 wheelbaseTX: 249 Here wheelbase will send data like in your code wheelbaseTX: { 0x7B, 0x02, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x7D, 0x7B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x7D, 0x7B, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x7D} But at this time the control board will send a random data, like this: {10,8,8,8,8,0,8,0,0,8} I intercepted 8 and 0 many times and sometimes they were the same, but most of the time there was no pattern. I tried to connect the Arduino directly to the wheelbase, and the results were different after I followed this process to RX 249. If I try to send data like this directly 0x7B, 0x05, 0x06, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6D, 0x7D then the wheelbase's tx is unlimited 248 Or follow the steps to send {10,8,8,8,8,0,8,0,0,8} and the result is the same. I studied it for a long time and thought that I needed an oscilloscope. The data obtained by Arduino was missing.

Actually, I saw your project a long time ago, but I don't know golang. Later, I found that the tx and rx data in your code were in the same format as the data I got. Then I followed your code and first captured the data at 250000 baud rate: wheelbaseTX:5 wheelbaseTX:5 wheelbaseTX:5 wheelbaseTX:5 ... control board TX: 29 wheelbaseTX: 2 This data is different from the code data you provided, and it has the same problem as the 115200 baud rate {10,8,8,8,8,0,8,0,0,8} became {29,0,0,0,0,0,0,0,128,0,0,128} and similar data, but I still ignored it, and tried many times with arduino, but I could never get to the third step I want to ask where I went wrong, is it because the data acquisition is incomplete, do I need to buy an oscilloscope? Or is it an Arduino problem? My native language is not English, I used Google Translate, maybe the grammar seems a little strange, but I hope you can help me, thank you very much

GeekyDeaks commented 2 months ago

Hi!

Did you spot that the baud rate has to change part way through the handshake?

It's not super clear in the code, especially if you are not familiar with golang, but it starts at 250000 and then switches to 115200.

If you don't respond to the initial handshake in time after the wheelbase is turned on, the wheelbase goes into a fallback mode, sending the same sequence of 3 bytes requesting the 7bit values for the throttle, brake and clutch. Also, I often found that the wheelbase would not properly complete the handshake if you connected the uart after the wheelbase was booted.

If you want to share your arduino code, I'm happy to take a look and see if I can offer any advice.

LoadingSky commented 2 months ago

Hi!

Did you spot that the baud rate has to change part way through the handshake?

It's not super clear in the code, especially if you are not familiar with golang, but it starts at 250000 and then switches to 115200.

If you don't respond to the initial handshake in time after the wheelbase is turned on, the wheelbase goes into a fallback mode, sending the same sequence of 3 bytes requesting the 7bit values for the throttle, brake and clutch. Also, I often found that the wheelbase would not properly complete the handshake if you connected the uart after the wheelbase was booted.

If you want to share your arduino code, I'm happy to take a look and see if I can offer any advice.

Thank you very much for your prompt reply.

I am happy to share my Arduino code and provide my thoughts.

I use python to get the data captured by two arduinos at 115200 baud rate. This is the data sent by the control board

1. 2024-08-17 01:40:24.658365 250
2. 2024-08-17 01:40:24.659365 251
3. 2024-08-17 01:40:24.672368 10
4. 2024-08-17 01:40:24.672368 0
5. 2024-08-17 01:40:24.672368 0
6. 2024-08-17 01:40:24.673369 8
7. 2024-08-17 01:40:24.673369 8
8. 2024-08-17 01:40:24.673369 0
9. 2024-08-17 01:40:24.673369 0
10. 2024-08-17 01:40:24.673369 8
11. 2024-08-17 01:40:24.673369 8
12. 2024-08-17 01:40:24.673369 0
13. 2024-08-17 01:40:24.673369 0
14. 2024-08-17 01:40:24.673369 8
15. 2024-08-17 01:40:24.673369 0
16. 2024-08-17 01:40:24.673369 8
17. 2024-08-17 01:40:24.673369 8
18. 2024-08-17 01:40:24.673369 8
19. 2024-08-17 01:40:24.673369 0
20. 2024-08-17 01:40:24.674369 240
21. 2024-08-17 01:40:24.676369 123
22. 2024-08-17 01:40:24.676369 1
23. 2024-08-17 01:40:24.676369 38
24. 2024-08-17 01:40:24.676369 0
25. 2024-08-17 01:40:24.676369 9
26. 2024-08-17 01:40:24.676369 0
27. 2024-08-17 01:40:24.676369 0
28. 2024-08-17 01:40:24.676369 0
29. 2024-08-17 01:40:24.676369 13
30. 2024-08-17 01:40:24.677370 0
31. 2024-08-17 01:40:24.677370 42
32. 2024-08-17 01:40:24.677370 125

This is the data sent by wheelbase

1. 2024-08-17 01:40:24.645360 248
2. 2024-08-17 01:40:24.659365 249
3. 2024-08-17 01:40:24.667367 123
4. 2024-08-17 01:40:24.667367 2
5. 2024-08-17 01:40:24.667367 255
6. 2024-08-17 01:40:24.667367 0
7. 2024-08-17 01:40:24.667367 0
8. 2024-08-17 01:40:24.667367 0
9. 2024-08-17 01:40:24.667367 0
10. 2024-08-17 01:40:24.667367 0
11. 2024-08-17 01:40:24.667367 0
12. 2024-08-17 01:40:24.667367 0
13. 2024-08-17 01:40:24.668367 38
14. 2024-08-17 01:40:24.669368 125
15. 2024-08-17 01:40:24.669368 123
16. 2024-08-17 01:40:24.669368 0
17. 2024-08-17 01:40:24.669368 0
18. 2024-08-17 01:40:24.669368 0
19. 2024-08-17 01:40:24.669368 0
20. 2024-08-17 01:40:24.669368 0
21. 2024-08-17 01:40:24.669368 0
22. 2024-08-17 01:40:24.669368 0
23. 2024-08-17 01:40:24.6693680
24. 2024-08-17 01:40:24.669368 0
25. 2024-08-17 01:40:24.670367 170
26. 2024-08-17 01:40:24.671368 125
27. 2024-08-17 01:40:24.671368 123
28. 2024-08-17 01:40:24.671368 3
29. 2024-08-17 01:40:24.671368 0
30. 2024-08-17 01:40:24.671368 0
31. 2024-08-17 01:40:24.671368 0
32. 2024-08-17 01:40:24.671368 0
33. 2024-08-17 01:40:24.671368 0
34. 2024-08-17 01:40:24.671368 0
35. 2024-08-17 01:40:24.671368 0
36. 2024-08-17 01:40:24.672368 0
37. 2024-08-17 01:40:24.672368 95
38. 2024-08-17 01:40:24.672368 125

It is easy to find the direct communication pattern between the control board and the wheelbase.

But the data starting from 10 sent by the control board is random, which I don't understand. I captured data many times and wanted to analyze its patterns.

3. 2024-08-17 01:40:24.672368 10
4. 2024-08-17 01:40:24.672368 0
5. 2024-08-17 01:40:24.672368 0
6. 2024-08-17 01:40:24.673369 8
7. 2024-08-17 01:40:24.673369 8
8. 2024-08-17 01:40:24.673369 0
9. 2024-08-17 01:40:24.673369 0
10. 2024-08-17 01:40:24.673369 8
11. 2024-08-17 01:40:24.673369 8
12. 2024-08-17 01:40:24.673369 0
13. 2024-08-17 01:40:24.673369 0
14. 2024-08-17 01:40:24.673369 8
15. 2024-08-17 01:40:24.673369 0
16. 2024-08-17 01:40:24.673369 8
17. 2024-08-17 01:40:24.673369 8
18. 2024-08-17 01:40:24.673369 8
19. 2024-08-17 01:40:24.673369 0
0080888008088088 0088008088088880 0080880088008800248 0080880888008800248 0080888008800808 0080888008800808 0080888008800808 0080888008800808 0080888008800808 0080888088088088 0080888088088808 0080888800808808 0088008088808808 0088008088808880240 0088008088808880248 0088008088808880248 0088008088808880248 0088800808880088248 0088808880080888240 8008088088808880248 8008088800808808 8008088800808880 8008088800880080 8008088800880080 8008088808808808 8008088808880880 8080888008088800 8088088808880880 8088800808880080 8088880080888008248 8800880080888008248 880808880080880248 0088008088800880240 0088008088800880248 8008800808880088240 0088008088808880248 8008088800880080 8088008088800888240 0088008088808880248 0880888088088088 0088008088808880248 008088088800808248 0888008088808880248 0088008088088808248 0088008088088808248 0088008800808880248 8088800808880880 8008088800880080 8088088800880080 0080888008800808 0088008088088800248 8088800808808880248 0088008088808880240 8008088808880080 008088088808808248 0080888008088808 8008088800880080 0888008800808880

I have no idea. But I still tested it in the order of 248>250>249>251 according to the python timestamp. After 251 is sent, it will send the same 3-byte sequence as you said, and keep sending 248. I tried to send {10,8,8,8,8,0,8,0,0,8} or {123,1,0,0,0,0,0,0,0,0,0,0,125} and it is invalid.

Just like what I said before, because I don't understand golang, many fanatec pedal projects use DIY control board to realize fanatec pedal running on PC. I thought your project was the same, but I saw 250000 baud rate, so I tried it and found different data, but still encountered the same problem, except that 248 became 5.

Later, I carefully read the README of your project and analyzed the project code. I found that it was the effect I wanted, but I used Arduino to achieve it. At first, I didn't know that CRC was needed. Although I found that the 11th bit of data at 115200 baud rate was changing, I thought it was just a random number.

This arduino code is what I modified by studying your project.

4. //make_crc_table
5. unsigned char crcTable[256];
6. void MAKE_CRC_TABLE(byte poly){
7. //  unsigned char table[256];
8.   for(int i = 0;i < 256; ++i){
9.     byte crc = (byte)i;
10.     for(int j = 0;j < 8; ++j){
11.       boolean bit_ = (crc & 0x01) != 0;
12.       crc = crc >> 1;
13.       if(bit_)
14.         crc = crc ^ poly;
15.     }
16.     crcTable[i] = crc;
17.   }
18. }
19. 
20. //get_crc_value
21. byte getCRC(byte input[],int leg){
22.   uint8_t crc = 0xff;
23.   for(int x = 0; x < leg; x++){
24.     int a = input[x]^crc;
25.     crc = crcTable[a];
26.   }
27.   return crc;
28. }

This crc function is modified by the crc.go file of your project. I have verified that it can be used.

STEP: 0
RX: 5
TX: 29
--------------
STEP: 1
RX: 5
--------------
STEP: 0
RX: 5
TX: 29
--------------
STEP: 1
RX: 5
--------------
STEP: 0
RX: 5
TX: 29
--------------
STEP: 1
RX: 5
--------------
STEP: 0
RX: 5
TX: 29
--------------
STEP: 1
RX: 5
--------------
STEP: 0
RX: 5
TX: 29
--------------
STEP: 1
RX: 5
--------------
STEP: 0
RX: 5
TX: 29
--------------
STEP: 1
RX: 5
--------------
STEP: 0
RX: 5
TX: 29
--------------
STEP: 1
RX: 5
--------------
STEP: 0
RX: 5
TX: 29
--------------
STEP: 1
RX: 5
--------------
STEP: 0
RX: 5
TX: 29
--------------
STEP: 1
RX: 5
--------------
STEP: 0
RX: 5
TX: 29
--------------

This is the result of Arduino running. It cannot run to step 2.

2024-08-20 12:24:47.020864 167813072:5
2024-08-20 12:24:47.124885 167916988:5
2024-08-20 12:24:47.228905 168021144:5
2024-08-20 12:24:47.332925 168125076:133
2024-08-20 12:24:47.436947 168229124:134
2024-08-20 12:24:47.540968 168333096:5
2024-08-20 12:24:47.644989 168437120:5
2024-08-20 12:24:47.749009 168541072:5
2024-08-20 12:24:47.853029 168645132:5
2024-08-20 12:24:47.957051 168749120:5
2024-08-20 12:24:48.061070 168853208:5
2024-08-20 12:24:48.165092 168957132:5
2024-08-20 12:24:48.269113 169061104:133
2024-08-20 12:24:48.271113 169063156:2
2024-08-20 12:24:48.278448 169070152:31
2024-08-20 12:24:48.279115 169070152:7
2024-08-20 12:24:48.279782 169070152:0
2024-08-20 12:24:48.280448 169070152:255
2024-08-20 12:24:48.281115 169070152:0
2024-08-20 12:24:48.281782 169070152:0
2024-08-20 12:24:48.283116 169070152:0
2024-08-20 12:24:48.283116 169070152:0
2024-08-20 12:24:48.283782 169070152:0
2024-08-20 12:24:48.283782 169070152:0
2024-08-20 12:24:48.283782 169070152:0
2024-08-20 12:24:48.285116 169070152:248
2024-08-20 12:24:48.285116 169070152:24
2024-08-20 12:24:48.285782 169070152:255
2024-08-20 12:24:48.286450 169070152:255
2024-08-20 12:24:48.287116 169070152:31
2024-08-20 12:24:48.287116 169070152:7
2024-08-20 12:24:48.287783 169070152:0
2024-08-20 12:24:48.287783 169070152:0
2024-08-20 12:24:48.289117 169070152:0
2024-08-20 12:24:48.289117 169070152:0
2024-08-20 12:24:48.289784 169070152:0
2024-08-20 12:24:48.289784 169070152:0
2024-08-20 12:24:48.291117 169070152:0
2024-08-20 12:24:48.291117 169070152:0
2024-08-20 12:24:48.291784 169070152:24
2024-08-20 12:24:48.291784 169070152:231
2024-08-20 12:24:48.293117 169070152:231
2024-08-20 12:24:48.293117 169070152:255

This is the code sent by the wheelbase captured at 250000 baud rate

2024-08-20 12:24:48.269113 157878224:29
2024-08-20 12:24:48.271113 157880284:18
2024-08-20 12:24:48.283782 157892388:29
2024-08-20 12:24:48.285116 157892388:0
2024-08-20 12:24:48.285116 157892388:0
2024-08-20 12:24:48.285782 157892388:0
2024-08-20 12:24:48.285782 157892388:0
2024-08-20 12:24:48.287116 157892388:0
2024-08-20 12:24:48.287116 157892388:0
2024-08-20 12:24:48.287783 157892388:0
2024-08-20 12:24:48.287783 157892388:128
2024-08-20 12:24:48.288450 157892388:128
2024-08-20 12:24:48.289117 157892388:0
2024-08-20 12:24:48.289784 157892388:0
2024-08-20 12:24:48.289784 157892388:0
2024-08-20 12:24:48.289784 157892388:0
2024-08-20 12:24:48.291117 157892388:0
2024-08-20 12:24:48.291117 157892388:0
2024-08-20 12:24:48.291784 157892388:0
2024-08-20 12:24:48.291784 157892388:0
2024-08-20 12:24:48.293117 157892388:0
2024-08-20 12:24:48.293117 157892388:0
2024-08-20 12:24:48.293784 157892388:0
2024-08-20 12:24:48.293784 157892388:0
2024-08-20 12:24:48.294451 157892388:0
2024-08-20 12:24:48.295118 157892388:128
2024-08-20 12:24:48.295785 157892388:0
2024-08-20 12:24:48.295785 157892388:0
2024-08-20 12:24:48.296451 157892388:0
2024-08-20 12:24:48.297118 157892388:0
2024-08-20 12:24:48.297118 157892388:0
2024-08-20 12:24:48.297785 157892388:0
2024-08-20 12:24:48.297785 157892388:0
2024-08-20 12:24:48.299119 157892388:0
2024-08-20 12:24:48.299119 157892388:128
2024-08-20 12:24:48.323789 157933108:31
2024-08-20 12:24:48.325123 157933108:231
2024-08-20 12:24:48.325789 157933108:231
2024-08-20 12:24:48.325789 157933108:24
2024-08-20 12:24:48.325789 157933108:0
2024-08-20 12:24:48.327124 157933108:24
2024-08-20 12:24:48.327790 157933108:0
2024-08-20 12:24:48.327790 157933108:0
2024-08-20 12:24:48.328457 157933108:0
2024-08-20 12:24:48.329124 157933108:0
2024-08-20 12:24:48.329791 157933108:248
2024-08-20 12:24:48.330457 157933108:231
2024-08-20 12:24:48.331791 157933108:255

This is the code sent by the control board captured at 250000 baud rate

So I send 29 in step0 verification 5 and 18 in setp1 verification 2. As a result, you can see that it only loops between step0 and step1.

GeekyDeaks commented 2 months ago

Ah, there is too much going on there.... can we focus on one thing at a time?

Because the wheelbase changes it's baudrate, trying to figure out what the protocol is from the output of the UART will be a frustrating exercise as you'll likely see no pattern when the baudrate is not correct. I used a storage scope to verify the baudrate at specific steps in the handshake.

Assuming you just want to get the handshake working from an arduino, I noticed that your step 0 and step 1 values differ from what I found:

You are doing the following:

step 0: RX 0x05, TX 0x1d step 1: RX 0x02, TX 0x12

This is very different to the handshake I have used:

step 0: RX 0x0a, TX 0x1a step 1: RX 0x05, TX 0x15

I'm guessing that you never see your wheelbase sending out 0x0a to begin with. Is that correct?

GeekyDeaks commented 2 months ago

I just re-read your first message and I can see that you mentioned seeing 0x05 as the first byte at 250000 baud. This might simply be because you are using a different wheelbase to me, but can I first double check that the 0x05 you see is the first byte sent after powering on the wheelbase?

LoadingSky commented 2 months ago

Well, I get the data by plugging and unplugging RJ12 to pause the data acquisition. Every time I plug it in, the wheelbase can accurately identify the pedal as a fanatec v3.

2024-08-20 15:36:04.951654 
2024-08-20 15:36:05.953574 
2024-08-20 15:36:06.954264 
2024-08-20 15:36:07.651736 3060074680:72
2024-08-20 15:36:08.663135 
2024-08-20 15:36:09.663827 
2024-08-20 15:36:10.664517 
2024-08-20 15:36:11.665069 
2024-08-20 15:36:12.679209 
2024-08-20 15:36:13.693348 
2024-08-20 15:36:14.707487 
2024-08-20 15:36:15.721626 
2024-08-20 15:36:16.735765 
2024-08-20 15:36:17.749905 
2024-08-20 15:36:18.515519 3070939324:5
2024-08-20 15:36:18.529550 3070953376:193
2024-08-20 15:36:18.536898 3070960328:31
2024-08-20 15:36:18.537566 3070960328:7
2024-08-20 15:36:18.537566 3070960328:0
2024-08-20 15:36:18.539571 3070960328:255
2024-08-20 15:36:18.539571 3070960328:0
2024-08-20 15:36:18.540907 3070960328:0
2024-08-20 15:36:18.541575 3070960328:0
2024-08-20 15:36:18.542243 3070960328:0
2024-08-20 15:36:18.542911 3070960328:0
2024-08-20 15:36:18.542911 3070960328:0
2024-08-20 15:36:18.543579 3070960328:0
2024-08-20 15:36:18.544247 3070960328:248
2024-08-20 15:36:18.544915 3070960328:24
2024-08-20 15:36:18.544915 3070960328:255
2024-08-20 15:36:18.545583 3070960328:255

I tried to capture data when the wheelbase was powered off and then restarted

This is the code sent by the wheelbase captured at 250000 baud rate

2024-08-20 15:36:07.651736 3060074680:72 This data is captured when I press the power button. The last time I tried it, its value was 128.

2024-08-20 15:36:18.515519 3070939324:5 This data was captured when the steering wheel screen lit up and the PC had a USB sound prompt.

2024-08-20 15:52:45.142067 
2024-08-20 15:52:46.156208 
2024-08-20 15:52:47.170351 
2024-08-20 15:52:48.184493 
2024-08-20 15:52:48.255308 4060740236:224
2024-08-20 15:52:49.260098 
2024-08-20 15:52:50.274244 
2024-08-20 15:52:51.288381 
2024-08-20 15:52:52.302523 
2024-08-20 15:52:53.316666 
2024-08-20 15:52:54.330807 
2024-08-20 15:52:55.344949 
2024-08-20 15:52:56.359091 
2024-08-20 15:52:57.373234 
2024-08-20 15:52:58.387375 
2024-08-20 15:52:59.121592 4071607068:5
2024-08-20 15:52:59.133618 4071619052:2
2024-08-20 15:52:59.140299 4071626032:159
2024-08-20 15:52:59.141635 4071626032:7
2024-08-20 15:52:59.142303 4071626032:0
2024-08-20 15:52:59.142303 4071626032:255
2024-08-20 15:52:59.143638 4071626032:0
2024-08-20 15:52:59.144307 4071626032:0
2024-08-20 15:52:59.145643 4071626032:0
2024-08-20 15:52:59.145643 4071626032:0
2024-08-20 15:52:59.146312 4071626032:0
2024-08-20 15:52:59.146979 4071626032:0
2024-08-20 15:52:59.147647 4071626032:0
2024-08-20 15:52:59.147647 4071626032:248
2024-08-20 15:52:59.148316 4071626032:24
2024-08-20 15:52:59.148984 4071626032:255
2024-08-20 15:52:59.149652 4071626032:255
2024-08-20 15:52:59.149652 4071626032:31

Another attempt at data

2024-08-20 15:55:44.331559 4236827736:5
2024-08-20 15:55:44.435310 4236931724:5
2024-08-20 15:55:44.539060 4237035756:5
2024-08-20 15:55:44.643481 4237139804:5
2024-08-20 15:55:44.747900 4237243812:5
2024-08-20 15:55:44.850983 4237347832:5
2024-08-20 15:55:44.955402 4237451804:5
2024-08-20 15:55:45.059153 4237555768:5
2024-08-20 15:55:45.164242 4237659828:5
2024-08-20 15:55:45.267324 4237763808:5
2024-08-20 15:55:45.371075 4237867804:5
2024-08-20 15:55:45.475495 4237971756:5
2024-08-20 15:55:45.579246 4238075772:5
2024-08-20 15:55:45.684336 4238179912:5
2024-08-20 15:55:45.787417 4238283760:5
2024-08-20 15:55:45.891168 4238387856:5
2024-08-20 15:55:45.995588 4238491784:5
2024-08-20 15:55:46.100009 4238595888:5
2024-08-20 15:55:46.203089 4238699880:5
2024-08-20 15:55:46.307510 4238803836:5
2024-08-20 15:55:46.411260 4238907836:5
2024-08-20 15:55:46.516351 4239011916:5
2024-08-20 15:55:46.619432 4239115892:5
2024-08-20 15:55:46.723187 4239219852:5
2024-08-20 15:55:46.828272 4239323960:5
2024-08-20 15:55:46.932022 4239427932:5
2024-08-20 15:55:47.035104 4239531912:5
2024-08-20 15:55:47.139524 4239635916:5
2024-08-20 15:55:47.243276 4239739912:5
2024-08-20 15:55:47.347026 4239843864:5
2024-08-20 15:55:47.452116 4239947968:5
2024-08-20 15:55:47.555197 4240051864:5
2024-08-20 15:55:47.659618 4240155900:5
2024-08-20 15:55:47.764037 4240259964:5
2024-08-20 15:55:47.867119 4240363944:5
2024-08-20 15:55:47.971538 4240467904:5
2024-08-20 15:55:48.075290 4240571940:5
2024-08-20 15:55:48.179042 4240675912:5
2024-08-20 15:55:48.283461 4240779936:5
2024-08-20 15:55:48.387211 4240883956:5
2024-08-20 15:55:48.490963 4240987928:5
2024-08-20 15:55:48.596053 4241092016:5
2024-08-20 15:55:48.699134 4241196044:5
2024-08-20 15:55:48.804223 4241300052:5
2024-08-20 15:55:48.907305 4241404016:5
2024-08-20 15:55:49.011056 4241508016:5
2024-08-20 15:55:49.116144 4241612056:5
2024-08-20 15:55:49.219227 4241716060:5
2024-08-20 15:55:49.322977 4241820048:5
2024-08-20 15:55:49.358453 4241855020:2
2024-08-20 15:55:49.363138 4241859120:64
2024-08-20 15:55:49.365147 4241861072:128
2024-08-20 15:55:49.369163 4241865020:192
2024-08-20 15:55:49.371841 4241868080:0
2024-08-20 15:55:49.375856 4241871080:96
2024-08-20 15:55:49.379203 4241874980:128
2024-08-20 15:55:49.381881 4241878128:192
2024-08-20 15:55:49.385229 4241881984:0
2024-08-20 15:55:49.387905 4241884984:96
2024-08-20 15:55:49.393260 4241889032:128
2024-08-20 15:55:49.395938 4241892020:192
2024-08-20 15:55:49.397946 4241895084:0

This data is obtained by unplugging a cable from the wheelbase to the control board and then plugging it back in. It still recognizes it as a fanatec v3 pedal, but the pedal data is messed up 屏幕截图 2024-08-20 160234 like this

In this case, re-plugging and re-plugging RJ12 does not work most of the time, and the wheelbase needs to be restarted

2024-08-20 16:08:26.645273 
2024-08-20 16:08:27.659417 
2024-08-20 16:08:27.724221 705298012:130
2024-08-20 16:08:27.827774 705402028:5
2024-08-20 16:08:27.931993 705506096:5
2024-08-20 16:08:28.036214 705610128:5
2024-08-20 16:08:28.139766 705713996:5
2024-08-20 16:08:28.243986 705818060:5
2024-08-20 16:08:28.348207 705922020:5
2024-08-20 16:08:28.451758 706026092:5
2024-08-20 16:08:28.555979 706130052:5
2024-08-20 16:08:28.660199 706234124:5
2024-08-20 16:08:28.763751 706338164:5
2024-08-20 16:08:28.867972 706442180:5
2024-08-20 16:08:28.971524 706546156:5
2024-08-20 16:08:28.973528 706548060:192
2024-08-20 16:08:28.981545 706555200:31
2024-08-20 16:08:28.982213 706555200:7
2024-08-20 16:08:28.982881 706555200:0
2024-08-20 16:08:28.983549 706555200:255
2024-08-20 16:08:28.984218 706555200:0
2024-08-20 16:08:28.984885 706555200:0
2024-08-20 16:08:28.985553 706555200:0
2024-08-20 16:08:28.986221 706555200:0
2024-08-20 16:08:28.986890 706555200:0
2024-08-20 16:08:28.986890 706555200:0
2024-08-20 16:08:28.987558 706555200:0
2024-08-20 16:08:28.988227 706555200:248
2024-08-20 16:08:28.988895 706555200:140
2024-08-20 16:08:28.988895 706555200:255
2024-08-20 16:08:28.989563 706555200:255
2024-08-20 16:09:50.972342 
2024-08-20 16:09:51.986485 
2024-08-20 16:09:52.013210 789593000:5
2024-08-20 16:09:52.117430 789697072:5
2024-08-20 16:09:52.222318 789801068:5
2024-08-20 16:09:52.326539 789905016:133
2024-08-20 16:09:52.430090 790009096:5
2024-08-20 16:09:52.533642 790113056:5
2024-08-20 16:09:52.637862 790217144:5
2024-08-20 16:09:52.742083 790321108:5
2024-08-20 16:09:52.846304 790425032:133
2024-08-20 16:09:52.949188 790529096:5
2024-08-20 16:09:53.054076 790633132:5
2024-08-20 16:09:53.157629 790737096:5
2024-08-20 16:09:53.262517 790841152:5
2024-08-20 16:09:53.264521 790843088:193
2024-08-20 16:09:53.271202 790850044:31
2024-08-20 16:09:53.271870 790850044:7
2024-08-20 16:09:53.272538 790850044:0
2024-08-20 16:09:53.273206 790850044:255
2024-08-20 16:09:53.273874 790850044:0
2024-08-20 16:09:53.274542 790850044:0
2024-08-20 16:09:53.275211 790850044:0
2024-08-20 16:09:53.276547 790850044:0
2024-08-20 16:09:53.276547 790850044:0
2024-08-20 16:09:53.277214 790850044:0
2024-08-20 16:09:53.277214 790850044:0
2024-08-20 16:09:53.277882 790850044:248
2024-08-20 16:09:53.278551 790850044:24
2024-08-20 16:09:53.279220 790850044:255
2024-08-20 16:09:53.279220 790850044:255

These two data were obtained by re-plugging and plugging RJ12

GeekyDeaks commented 2 months ago

oh boy... I tried to do a similar thing just with a couple of arduinos and it was a frustrating exercise as I didn't realise the baud rate changed. From looking at the traces, I suspect the same baud rate change is happening, but it's still tricky to know where.

Do you have access to a scope? The alternative might be to run both the arduinos on the same TX with one running at 250000 and the other running at 115200 to see if you start to see a better pattern.

Also, I would try and capture the traces from a complete restart. You always get a bit of noise at the start, but I found my wheelbase was a lot more predictable than when just unplugging and re-plugging the RJ12

LoadingSky commented 2 months ago

oh boy... I tried to do a similar thing just with a couple of arduinos and it was a frustrating exercise as I didn't realise the baud rate changed. From looking at the traces, I suspect the same baud rate change is happening, but it's still tricky to know where.

Do you have access to a scope? The alternative might be to run both the arduinos on the same TX with one running at 250000 and the other running at 115200 to see if you start to see a better pattern.

Also, I would try and capture the traces from a complete restart. You always get a bit of noise at the start, but I found my wheelbase was a lot more predictable than when just unplugging and re-plugging the RJ12

Thanks for your help. I found that I overlooked that the maximum speed of SoftwareSerial is 115200. My Arduino only has one serial port, so I can't get 250000 baud data from the wheelbase when connected to the PC. I have to buy an Arduino with multiple serial ports again, which takes a lot of time. If I encounter the problem again, I hope I can ask you again. Thanks again.