Comments (2)
The library doesn't support that type of query using processPID(), but you can use it to get the data you want. Instead, use sendCommand(), and then parse the response in your code. The full response from ELM327 will be available to you in myELM327.payload after calling getResponse().
Include something like this in your loop() method:
myELM327.sendCommand("22242C");
if (myELM327.nb_rx_state == ELM_SUCCESS)
{
myELM327.getResponse();
// parse and process the values you want from myELM327.payload
}
else if (myELM327.nb_rx_state != ELM_GETTING_MSG)
{
myELM327.printError();
}
from elmduino.
IT WORKS.
I used this code:
DPF_KM = myELM327.processPID(34, 9556, 4, 4, 1, 0); //PID 222554; Equation: ((A256)+B)
if (myELM327.nb_rx_state == ELM_SUCCESS)
{
D = myELM327.responseByte_0;
C = myELM327.responseByte_1;
B = myELM327.responseByte_2;
A = myELM327.responseByte_3;
DPF_KM_calc = ((C256)+D);
obd_state= ENG_RPM;
}
and I retrieved the correct data (verified) in Arduino Serial Monitor:
Delimited found.
All chars received: 6225540139
Expected response header: 622554
Single response detected
64-bit response:
responseByte_0: 57
responseByte_1: 0
responseByte_2: 0
responseByte_3: 0
responseByte_4: 0
responseByte_5: 0
responseByte_6: 0
responseByte_7: 0
Service: 34
PID: 9556
Long query detected
Query string: 222554
Clearing input serial buffer
Sending the following command/query: 222554
Received char: 6
Received char: 2
Received char: 2
Received char: 5
Received char: 5
Received char: 4
Received char: 0
Received char: 1
Received char: 3
Received char: 9
Received char: \r
So, after conversion, the KM from last regeneration are 313.
Thanks a lot for your support!
from elmduino.
Related Issues (20)
- set a special pisd of ELMDUINO with header HOT 9
- Setting Protocol not working correctly HOT 6
- Problem querying data with ESP32 HOT 5
- custom pid no response HOT 1
- Sending false Command? HOT 5
- Crash on calling batteryVoltage() HOT 7
- ELM327::isPidSupported Error
- Custom PID, how it works HOT 9
- PID 70: Boost pressure control (Service 01) HOT 1
- Problem with flashing RPM value on OLED when using latest version of ELMduino HOT 8
- ESP32 not connecting to ELM327 HOT 5
- Protocol Data Point HOT 4
- Couldn't connect to OBD scanner (stucked) HOT 18
- First time Bluetooth pairing between ESP32 and ELM327 HOT 1
- custom pid for DPF HOT 17
- BT Pairing problem between ESP-32 and ELM327 HOT 6
- How to change OBD protocol HOT 5
- Response not detected HOT 28
- Error in getting Multiple PID's HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elmduino.