No Movement on Gauges in ReadDash?

Hello,

I am not sure what I am doing wrong? This did work at one time.

I have an Arduino that is outputting through Bluetooth. (Verified output)

I have also uploaded my XML file to RealDash as well.

I am fairly new to RealDash and Arduino, but I have a great head start on this project.

I would upload my XML file, but I cannot because I an new to foum.

Thanks in advance.

Things to check:

  • Use CAN connection ‘CAN Monitor’ option to verify that you are receiving data from your Arduino.
  • Use ‘Settings->Application->Debug->Debug Data View’ to see what values are actually written by the connection.

Hello realdashdev,

Thank you for the response. I have made some progress.

  1. I used the Can Monitor to verify that I am receiving information from the Arduino (through Bluetooth) to Real Dash. I did not have this before when I made the post, so now I at least have information being received in a readable format by RealDash.

  2. I was not aware of the Debug Data View. This is very helpful! Thank you for this.

  3. I am getting some values, but they are not the right values. The Serial Print on the Arduino is producing the right values, but the translation is lost to Real Dash; this makes me believe that the XML is wrong.

Actually I think I figured it out, but it is probably not pretty… and definitely not optimized!

float readVolt;
byte sendThis[8];
unsigned int waterVal, speedoVal, tachVal, egtVal, boostVal, fuelVal, oilVal;
unsigned long startTime, endTime, ndebounceTime = 0, ncurrentTime, debounceTime = 0, currentTime, previousSensorTime, currentSensorTime;
const unsigned long serialBlockTag = 0x11223344;
bool toothDetect = false;
char debounce = 0, ndebounce = 0;

#include <max6675.h>    // Library for communicating with thermocouple
#include <SoftwareSerial.h>

SoftwareSerial HM10(2, 3); // RX, TX


// ThermoCouple
#define thermo_gnd_pin 45
#define thermo_vcc_pin 47
#define thermo_so_pin 53
#define thermo_cs_pin 51
#define thermo_sck_pin 49
  
MAX6675 thermocouple(thermo_sck_pin, thermo_cs_pin, thermo_so_pin);

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);             //open the hardware serial port
  HM10.begin(9600);              //Set blutooth baud rate to 9600
//  pinMode(thermo_vcc_pin, OUTPUT);
//  pinMode(thermo_gnd_pin, OUTPUT);
//  digitalWrite(thermo_vcc_pin, HIGH);
//  digitalWrite(thermo_gnd_pin, LOW);
  pinMode(A0,INPUT);
  pinMode(A1,INPUT);
  pinMode(A2,INPUT);
  pinMode(A3,INPUT);
  pinMode(A4,INPUT);
  pinMode(A5,INPUT);
}


void loop() {
  fastUpdate();
  currentSensorTime = millis();
  if((currentSensorTime - previousSensorTime) > 1000){
    slowUpdate();
    previousSensorTime = currentSensorTime;
  }
  delay(5);
}

//-------------------------------------------------------------------------------------------------------------------------

void sendFrame(unsigned long canFrameID, const byte* frameData) { // Used to serially send a CAN frame for each sensor

  HM10.write((const byte*) & serialBlockTag, 4);
  HM10.write((const byte*) & canFrameID, 4);
  HM10.write(frameData, 8);

}

//--------------------------------------------------------------------------------------------------------------------------

void slowUpdate(){
  //WaterTemp
    readVolt = analogRead(A0);
    readVolt = readVolt*5/1024;     // Converts from bit representation of voltage to actual voltage
    waterVal = -80.46*log(readVolt)+134.36;     // Finding temp value from given voltage
    sendThis[0] = (waterVal >> 8);
    sendThis[1] = waterVal;
  
  //EGT
    readVolt = thermocouple.readCelsius();
    egtVal = readVolt;
    sendThis[2] = (egtVal >> 8);
    sendThis[3] = egtVal;
  
  //Fuel
    readVolt = analogRead(A4);
    readVolt = readVolt*5/1024;
    fuelVal = (readVolt*244/5)-32;
    sendThis[4] = (fuelVal >> 8);
    sendThis[5] = fuelVal;

  //OilPress
    readVolt = analogRead(A5);
    readVolt = readVolt*5/1024;
    oilVal = (readVolt-.5)*25;      // Converting from volts to psi
    sendThis[6] = (oilVal >> 8);
    sendThis[7] = oilVal;
  
    sendFrame(3200, &sendThis[0]);
}

void fastUpdate(){
  //Speedo
    readVolt = analogRead(A1);
    sendThis[0] = (speedoVal >> 8);
    sendThis[1] = speedoVal;

  //Tach
    readVolt = analogRead(A2);
    readVolt = readVolt*5/1024;
  
    if ((readVolt < 4.9) && (toothDetect == false)) {   // Checks for sensor reading and for double positive reading
      if (debounce == 0){           // Debounce == 0 means not enough time has passed since the last positive reading
        currentTime = millis();
        if (debounceTime == 0){
          debounceTime = currentTime;
        }
        if (currentTime - debounceTime >= 50){      // Once 50 ms have passed a positive reading can be sent again
          debounce = 1;
        }
      }
      else if (debounce == 1){        // If debounce time and voltage requirements are met, the rate of positive readings per minute
        debounce = 0;                 // is output as rpm and scaled to the gauge range. Then all limiting variables are reset
        debounceTime = 0;      
        endTime = millis();
        tachVal = 60000/(endTime - startTime);
        startTime = endTime;
        toothDetect = true;
      }
    }
    else if (readVolt > 4.9) {      // Same as above if statement, except for negative readings
      if (ndebounce == 0){
        ncurrentTime = millis();
        if (ndebounceTime == 0){
          ndebounceTime = ncurrentTime;
        }
        if (ncurrentTime - ndebounceTime >= 50){
          ndebounce = 1;
        }
      }
      else if (ndebounce == 1){
        ndebounce = 0;
        ndebounceTime = 0;  
        toothDetect = false;
      }  
    }
    sendThis[2] = (tachVal >> 8);
    sendThis[3] = tachVal;
    
  //Boost
    readVolt = analogRead(A3);
    readVolt = readVolt*5/1024;
    boostVal = (readVolt-.5)*25;    // Converting from volts to psi
    sendThis[4] = (boostVal >> 8);
    sendThis[5] = boostVal;
    
    sendFrame(3201, &sendThis[0]);
}
<?xml version="1.0" encoding="utf-8"?>
<!-- RealDash CAN XML description file, version 2 Requires RealDash version 1.5.8 or newer -->
<RealDashCAN version="2">
  <frames>
    
    <frame id="3200" endianess="big">
      <value targetId="14" offset="0" length="2"></value> <!-- Water Temps target -->
      <value targetId="27" offset="2" length="2"></value> <!-- EGT target -->
      <value targetId="170" offset="4" length="2"></value> <!-- Fuel Level target -->
      <value targetId="151" offset="6" length="2"></value> <!-- Oil Pressure target -->
    </frame>

    <frame id="3201" endianess="big">
      <value targetId="64" offset="0" length="2"></value> <!-- Speedo target -->
      <value targetId="37" offset="2" length="2"></value> <!-- Tach/RPM target -->
      <value targetId="270" offset="4" length="2"></value> <!-- Boost target -->
    </frame>

  </frames>
</RealDashCAN>

Would appreciate any feedback on this though!

Looks good to me :thumbs: