Torque

Forums

Forums

Guest  

Show or hide header
Welcome Guest, posting in this forum require registration.




Torque » Torque OBD ECU Scanner » Torque Discussion / Ideas » Multiple serial streams?

Pages: [1]
Author Topic: Multiple serial streams?
toalan
Member
Posts: 9
Post Multiple serial streams?
on: June 8, 2017 (GMT)

Hi,

I would like to use arduino to supply torque with some data, while at the same time my ECU sends it’s data to torque, so that both sets of data are logged and displayed at the same time.

So would it be possible to use 2 serial streams at the same time?

Regards,

Alan To

moreause
Member
Posts: 637
Post Re: Multiple serial streams?
on: June 12, 2017 (GMT)

i don’t know if there is another way

what i did is put the arduino on the bus

in a custom pid a program a standard PID that normally the ecu doesn’t answer

arduino is monitoring that request and then respond in it’s place like the ecu would normally do it

torque doesn’t see any difference

moreause
Member
Posts: 637
Post Re: Multiple serial streams?
on: June 12, 2017 (GMT)

i don’t know if there is another way

what i did is put the arduino on the bus

in a custom pid a program a standard PID that normally the ecu doesn’t answer

arduino is monitoring that request and then respond in it’s place like the ecu would normally do it

torque doesn’t see any difference

here is an exemple of my code
/*********************************************************************
* Mechanic – Hacking your car
*
* Copyright (C) 2013 Joerg Pleumann
*
* This example is free software; you can redistribute it and/or
* modify it under the terms of the Creative Commons Zero License,
* version 1.0, as published by the Creative Commons Organisation.
* This effectively puts the file into the public domain.
*
* This example is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* LICENSE file for more details.
*/

#include

ObdInterface obd;
ObdMessage out;
ObdMessage in;

int SensorValue = 0;
float PsiValue = 0;
float Temp;
int ValuePID90xA;
int ValuePID90xB;
int ValuePID08xA;

void setup() {
Serial.begin(115200);
//while (!Serial);

Serial.println();
Serial.println();
Serial.println(” ADDR LN MO PI D0 D1 D2 D3 D4″);
Serial.println(“——– — — — — — — — –“);

obd.setSlow(false);
obd.setExtended(false);
obd.setDebug(false);
obd.setNoFilter(false); // Show all messages, not just ECU answers
obd.begin();
out.address = 0x7e8;
out.mode = 0x41;

}

void loop() {
if (obd.receiveMessage(in)) {
Serial.println(in);

if (in.pid == 0x90) { // Si pid est 90 envoie la valeur courante
Serial.println(“sending”);

Serial.print(” PID 0x90,Sensor “);Serial.print(SensorValue);
Serial.print(” Psi: “); Serial.print(PsiValue);
Serial.print(” A: “); Serial.print(ValuePID90xA);
Serial.print(” B: “); Serial.println(ValuePID90xB);

out.address = 0x7e8;
out.length = 0x4;
out.pid = 0x90;
out.values[0] = ValuePID90xA;
out.values[1] = ValuePID90xB;
obd.sendMessage(out);

}

if (in.pid == 0x08) { // Si pid est 08 envoie la valeur courante
Serial.println(“sending”);

Serial.print(” PID 0x08,Sensor “);Serial.print(SensorValue);
Serial.print(” A: “); Serial.println(ValuePID08xA);

out.address = 0x7e8;
out.length = 0x4;
out.pid = 0x08;
out.values[0] = ValuePID08xA;
out.values[1] = 0;
obd.sendMessage(out);

}

}
// Valeur pour PID 0x90
SensorValue = analogRead(A0) + 1;
PsiValue = (45.6125*SensorValue/1024) + 0.148721; // 5 Volts ou 1024 = 45.6125 Psi, 0.148721 il y a un leger offset dans les valeurs
ValuePID90xA = (int) PsiValue;
Temp = (PsiValue – ValuePID90xA) * 100;
ValuePID90xB = (int) Temp;
/*
Serial.print(” PID 0x90,Sensor “);Serial.print(SensorValue);
Serial.print(” Psi: “); Serial.print(PsiValue);
Serial.print(” A: “); Serial.print(ValuePID90xA);
Serial.print(” B: “); Serial.println(ValuePID90xB);
*/
// Valeur pour PID 0x08
ValuePID08xA = map(SensorValue,0,1024,0,256); // 5 Volts ou 1024 = 45.6125 Psi et modifier en 0 a 255 et envoye comme pid de short trim bank 2
/*
Serial.print(” PID 0x08,Sensor “);Serial.print(SensorValue);
Serial.print(” A: “); Serial.println(ValuePID08xA);
*/
delay(20);
}

toalan
Member
Posts: 9
Post Re: Multiple serial streams?
on: June 19, 2017 (GMT)

bump

moreause
Member
Posts: 637
Post Re: Multiple serial streams?
on: June 21, 2017 (GMT)

test for some reason i can’t my answer

toalan
Member
Posts: 9
Post Re: Multiple serial streams?
on: June 21, 2017 (GMT)

It says there are several responses to this thread, but when I click on the thread I only see just my posts. Are there actual responses? If so can someone PM me the responses?

LukaNZ
Member
Posts: 3
Post Re: Multiple serial streams?
on: June 28, 2017 (GMT)

Hi

I would also be interested in this feature.

I would like to get oil and water temperatures from the OBDII port and the Oil pressure I would like to add through a custom PCB.

Can Torque support two Bluetooth adapters at the same time?

LukaNZ
Member
Posts: 3
Post Re: Multiple serial streams?
on: July 11, 2017 (GMT)

Bump. Anyone?

Capp777
Member
Posts: 2993
Post Re: Multiple serial streams?
on: July 12, 2017 (GMT)

Have you looked at PLX iMFD devices? I
believe Ian has added support similar to
what you describe for these devices.

Search this forum for related threads.

https://torque-bhp.com/forums/?wpforumaction=viewtopic&t=5015.0

LukaNZ
Member
Posts: 3
Post Re: Multiple serial streams?
on: July 13, 2017 (GMT)

Thanks.

I have done a quick search before posting, but it seems that most of those products are now discontinued?

https://www.plxdevices.co.uk/product/Automotive/Kiwi/PLX-0089/kiwi_imfd/PLX-Kiwi-2-iMFD-Adapter

It’s really annoying because all I really want to add is oil pressure and nothing else.

toalan
Member
Posts: 9
Post Re: Multiple serial streams?
on: February 12, 2019 (GMT)

Still searching for the answer.

moreause
Member
Posts: 637
Post Re: Multiple serial streams?
on: February 14, 2019 (GMT)

you just have to send the data into the can bus with the arduino

and then read it with torque

i have done it a while ago

Pages: [1]
WP-Forum by: Fredrik Fahlstad, Version: 2.4
Page loaded in: 0.04 seconds.

  Follow me on twitter