gasparian / obd_elm327_vehicle_speed Goto Github PK
View Code? Open in Web Editor NEWC script for talking to OBD-II port via elm327 controller on Linux
C script for talking to OBD-II port via elm327 controller on Linux
How you doing!
I'm trying to set up my obd interface which is actually not the elm327 but instead the OBSLink SX. I read the manual and it said that it's compatible with all elm327 AT, ST, and OBD commands. I configured the serial communication parameters and was able to run the code all the way to the if ifelse statements within the main function on line 58, where it called the answer_check(answer, "410D", 4). I turned on some debugging comments and this is what I got when ran in the terminal:
+----------------------------------------------------------------------+
| Serial Port Read/Write |
+----------------------------------------------------------------------+
/dev/ttyUSB0 Opened Successfully!
Parameter set:
BaudRate = 115200
StopBits = 1
Parity = none
VMIN = 18
VTIME = 2
Inside elm read:
Kts0
OK
In comparison function: 2; 0
Answer:
'OK'
'OK' (2)
'OK' (2)
Inside elm read:
4OPPED
STOPPED
In comparison function: 4; 31
Answer:
'STOPPED'
'STOP' (4)
'410D' (4)
I can't pin point the issue as I'm not an experienced enough programmer. My assumption is that elm_talk function asked for the vehicle speed it returned the string "STOPPED" and when checked with "410D" it didn't match up. So if you could inform me on what is going on, I would really appreciate it. Now I was stopped in the car haha but I was waiting the terminal to print out "ready to talk" then was gonna figure it out from there. I'm just trying to figure out the protocols for this obd2 interface and what 410D is.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.