using ONE+ with custom data logging protcol

Inquiry and support for Freematics products
VWnut8392
Posts: 4
Joined: Wed Sep 26, 2018 10:19 am

using ONE+ with custom data logging protcol

Postby VWnut8392 » Thu Jan 10, 2019 1:51 pm

i bought a one+ six months ago and was looking forward to using with a custom audi motronic data logging protocol but im new to this so im not sure how to make the one + watch for the data. my ultimate goal is to either record to SD card or push the data over bluetooth to an android app.

the output from the ECU is rather simple. it sends 0xAA 0xBB than it starts sending data from the ECU's RAM and when it starts over at the beginning it sends 0xAA 0xBB again. this is running the moment the key is on regardless weather anything is watching or not.

the data being recorded from the driver that was made by another person to be used with a program called winlog. i modified this driver to have US based units of measure and be able to monitor wideband AFR controller through the ECU as well. Over all i dont know where to start to make this work but i know it can work. any help would be greatly appreciated. thanks!

// Calculates and sets data
void setData(unsigned char* buf, int len) {

// Boost chip
fielddata[0] = buf[0]/194.0*100; //N75
fielddata[1] = buf[1]/194.0*100; //N75 base
fielddata[2] = (buf[2] / 255.0 * 5 / 1.03515625*config.mapMult + config.mapOffset)*0.14503773800722 - 14.6959494; //PSI
fielddata[3] = buf[2] / 255.0 * 5 / 1.03515625*config.mapMult + config.mapOffset; //MAP
fielddata[4] = (buf[3] / 255.0 * 5 / 1.03515625*config.mapMult + config.mapOffset)*0.14503773800722 - 14.6959494; //PSI REQ
fielddata[5] = buf[3] / 255.0 * 5 / 1.03515625*config.mapMult + config.mapOffset; //MAP REQ
fielddata[6] = buf[4]*0.5; // KNOCK1
fielddata[7] = buf[5]*0.5; // KNOCK2
fielddata[8] = buf[6]*0.5; // KNOCK3
fielddata[9] = buf[7]*0.5; // KNOCK4
fielddata[10] = buf[8]*0.5; // KNOCK5
fielddata[11] = buf[9]*0.5; // KNOCKGLOB
fielddata[12] = buf[10]*0.5; // KNOCKDYN

// Fuel chip

fielddata[13] = (buf[31])*40; //RPM
fielddata[14] = (buf[30]*256+buf[29])/25.0; //LOAD
fielddata[15] = (buf[28])*0.068; //Battery voltage
fielddata[16] = (((buf[27])-70.0)*0.70)*9/5+32; //IAT (F)
fielddata[17] = (((buf[27])-70.0)*0.70); //IAT (C)
fielddata[18] = (((buf[26])-70.0)*0.70)*9/5+32; //ECT (F)
fielddata[19] = (((buf[26])-70.0)*0.70); //ECT (C)
fielddata[20] = (buf[25])*0.416; //TPS
fielddata[21] = 0.75*((buf[24])-(buf[23])); //Timing request
double ipw = 0.52*((buf[22]) + (buf[21])/256.0);
fielddata[22] = ipw; //IPW (effective)
fielddata[23] = (buf[20])*0.010667; // Injector dead time
fielddata[24] = ipw + fielddata[23]; // IPW (actual)
fielddata[25] = fielddata[24]*fielddata[13]/1200.0; // IDC
fielddata[26] = (((buf[19]*2)/1.609344)-0.621371)-2; //VSS MPH
fielddata[27] = buf[19]*2; //VSS KMH
fielddata[28] = ((buf[18]*0.0196078)-0.4)*2 +10; //Zetronix Wideband input
fielddata[29] = buf[17]; //MAF table cell

// Target AFR
double calcvalue = (buf[15]*256+buf[14])*pow(2.0, buf[13]);
unsigned char injconstant = buf[16] == 0 ? 1 : buf[16];
calcvalue = (128.0/injconstant)*calcvalue;
calcvalue = calcvalue == 0 ? 1 : calcvalue;
calcvalue = 1/(calcvalue/65536.0)*14.7;
fielddata[30] = calcvalue > 99.0 ? 99.00 : calcvalue;

// Knock including DYN and GLOB
fielddata[31] = fielddata[6] + fielddata[11] + fielddata[12]; // KNOCKOUT1
fielddata[32] = fielddata[7] + fielddata[11] + fielddata[12]; // KNOCKOUT2
fielddata[33] = fielddata[8] + fielddata[11] + fielddata[12]; // KNOCKOUT3
fielddata[34] = fielddata[9] + fielddata[11] + fielddata[12]; // KNOCKOUT4
fielddata[35] = fielddata[10] + fielddata[11] + fielddata[12]; // KNOCKOUT5
fielddata[36] = (fielddata[31] + fielddata[32] + fielddata[33] + fielddata[34] + fielddata[35])/5; // KNOCKOUTAVG

// Ignition angle output
fielddata[37] = fielddata[21] - fielddata[31]; //IGNOUT1
fielddata[38] = fielddata[21] - fielddata[32]; //IGNOUT2
fielddata[39] = fielddata[21] - fielddata[33]; //IGNOUT3
fielddata[40] = fielddata[21] - fielddata[34]; //IGNOUT4
fielddata[41] = fielddata[21] - fielddata[35]; //IGNOUT5

Return to “Freematics Products”

Who is online

Users browsing this forum: No registered users and 2 guests