Hello guys . Pls can anyone give me a hand here. I try so hard but is so difficult
I have a smart 450 600cc 2000 model .
My last project is work with
1- elm327 ( Bluetooth)
I can see rpm , gear etc nice and good .
And
2- work with esp 32
Here I try to make connection with realdash and se only the fuel level
For esp32
At least now I can see it at realdash dashboard
I add it ,
Add-> adapters (can/lin) → realdash can ->bluetooth-> esp32
And at can description file I put mine xml.
Until now I see esp connect and at can monitor show
000000c8: e6 02 00 00 00 00 00 00
And all time the first . Numbers change all time
My problem is that I can’t see level fuel messurment .
I already find from my car fuel level sensor sender I make a good circuit to read there the data .
I think is all ok and just need find the way to see realdash the correct reading data. Can pls help me?
This is the .xml file
<?xml version="1.0" encoding="utf-8"?>And this is .ino
#include <BluetoothSerial.h>
BluetoothSerial SerialBT;
// Fuel level simulation from analog pin
int fuelSensorPin = 34;
float fuelLevel = 0;
void setup() {
Serial.begin(115200);
// Για debug μέσω USB
SerialBT.begin(“ESP32-Fuel”);
// Όνομα Bluetooth συσκευής για RealDash
delay(1000);
}
void loop() {
int rawValue = analogRead(fuelSensorPin);
// Ανάγνωση 0-4095
float voltage = rawValue * 3.3 / 4095.0;
// Μετατροπή σε τάση
fuelLevel = voltage / 3.3 * 100.0;
// Μετατροπή σε ποσοστό
// Πακέτο CAN για RealDash
byte buf[8] = {0};
unsigned int fuelValue = (unsigned int)(fuelLevel * 100); // π.χ. 63.25% γίνεται 6325
buf[0] = fuelValue & 0xFF;
buf[1] = (fuelValue >> 8) & 0xFF;
SendCANFrameToSerialBT(200, buf); // CAN ID = 0x00C8 = 200
delay(500);
}
void SendCANFrameToSerialBT(unsigned long canFrameId, const byte* frameData) {
const byte serialBlockTag[4] = { 0x44, 0x33, 0x22, 0x11 };
SerialBT.write(serialBlockTag, 4);
SerialBT.write((const byte*)&canFrameId, 4);
SerialBT.write(frameData, 8);
}
Can pls help me ?