How is vehicle speed determined from CAN in RealDash using Arduino and ESP32?

Hi everyone,

I would like to understand how RealDash determines vehicle speed from the CAN bus using Arduino and ESP32, similar to how CANalyzer works. For example, you select the car’s CAN bus speed, like 250 kbps, in RealDash, and it connects automatically.

My code is already functional and can read any vehicle, but currently, I have to manually change the speed in the code. I want to know how to make RealDash read the native CAN speed directly without changing it in the Arduino code.

Thanks in advance!

This is the part of the code I have to modify for every car:

int currentBaud = 250;  // initial speed

bool autoDetectCANSpeed() {
int speeds = {500, 95, 125, 250, 150, 800, 1000};
twai_message_t msg;


You use different CAN XML file for each vehicle to describe for RealDash where each data in CAN frames are located.

Can you share the code and diagram?

Sorry, but the project is closed — both the Arduino and the ESP32 versions.

I think you didn’t understand — I already have the code fully working on Arduino and ESP32, with the XML and everything, for the Palio and other vehicles.
But the CAN speed (for example, 50 kbps on the Palio and 500 kbps on the Honda Civic) is something I have to change in the code.
How can I switch the CAN speed directly from RealDash, using Arduino and ESP32?

Would you like me to also explain how you could make RealDash change the CAN baud rate dynamically (for example, by sending a command through serial or Bluetooth to the Arduino/ESP32)?

<!-- FRAME 0x011 - Configuração de Velocidade CAN -->
<frame id="0x011" ext="false">
  <value name="CAN Speed Config" offset="0" length="2" endianness="big"/>
</frame>
?????

To change CAN speed, use the “67 config frame”:

RealDash-extras/RealDash-CAN/realdash-can-protocol.md at master · janimm/RealDash-extras

To change serial baud rate of the custom device, there is no such option in RealDash.

Thank you for your reply! I did the following: I created an auto-scan for the vehicle’s CAN speed, and in about 3 seconds it tests all speeds from 5 kbps to 1000 kbps. It then stores the last successful connection, and if it doesn’t connect, it retries automatically.
I implemented this on the ESP32 using BLE, Classic Bluetooth, and USB Serial.