Android Question Can somebody HELP ?

SoyEli

Active Member
Licensed User
Longtime User
Hello:





I'm working on a obd2 project and need some help:
With the "at ma"
I get:
8A EA 29 20 A7 00 30
AA EB 60 20 A7 00 E7
E8 FF 10 03 B3
88 25 29 07 00 97
68 49 10 10 56 90
E8 FF 60 03 98
88 3B 10 43 80 0D
48 FF 40 06 03 AC
8A EA 40 A0 9E 50 26
AA EB 60 A0 9E 50 2E
8A EA 10 A0 8C 00 65
8A EA 10 20 8C 00 A5
88 53 10 04 C4
8A EA 10 A0 8C 00 65
4A EA 40 20 91 00 6B
48 FF 40 06 03 AC

What I need to do is find out which is the pid, data etc.
I have been looking at the " en.wikipedia.org/wiki/OBD-II_PIDs‎"
Can't make heads or tails :-(

Can you please HELP ? :(
 

SoyEli

Active Member
Licensed User
Longtime User
Hello:





I'm working on a obd2 project and need some help:
With the "at ma"
I get:
8A EA 29 20 A7 00 30
AA EB 60 20 A7 00 E7
E8 FF 10 03 B3
88 25 29 07 00 97
68 49 10 10 56 90
E8 FF 60 03 98
88 3B 10 43 80 0D
48 FF 40 06 03 AC
8A EA 40 A0 9E 50 26
AA EB 60 A0 9E 50 2E
8A EA 10 A0 8C 00 65
8A EA 10 20 8C 00 A5
88 53 10 04 C4
8A EA 10 A0 8C 00 65
4A EA 40 20 91 00 6B
48 FF 40 06 03 AC

What I need to do is find out which is the pid, data etc.
I have been looking at the " en.wikipedia.org/wiki/OBD-II_PIDs‎"
Can't make heads or tails :-(

Can you please HELP ? :(

Thank you for your HELP !

Well I made some head way:
With the one request: 01 05
I can get the info I need, I know which is the pid and the data: but I need to use the "ATMA"
and I'm a little lost:

Settings= at L1,at H1,at S1,at AL,at SP0

With the "at ma"
I get:
8A EA 29 20 A7 00 30
AA EB 60 20 A7 00 E7
E8 FF 10 03 B3
88 25 29 07 00 97
68 49 10 10 56 90
E8 FF 60 03 98
88 3B 10 43 80 0D
48 FF 40 06 03 AC
8A EA 40 A0 9E 50 26
AA EB 60 A0 9E 50 2E
8A EA 10 A0 8C 00 65
8A EA 10 20 8C 00 A5
88 53 10 04 C4
8A EA 10 A0 8C 00 65
4A EA 40 20 91 00 6B
48 FF 40 06 03 AC

What I need to do is find out which byte(s) is the pid, data etc.
I have been looking at the " en.wikipedia.org/wiki/OBD-II_PIDs‎"
Can't make heads or tails :-(

Can you please HELP ? :(
 
Upvote 0

terryn

Member
Licensed User
Longtime User
SoyEli,
The ATMA command is "monitor all", meaning it will read all raw data on the bus. It relies on a lot of other parameters and I think you need to know which type of bus you are connected to to interpret it correctly.

I suggest you take a look at the ELM327 data sheet
http://elmelectronics.com/DSheets/ELM327DSH.pdf
This takes quite a lot of study. I hope you have enough time.

Terry
 
Upvote 0

SoyEli

Active Member
Licensed User
Longtime User
SoyEli,
The ATMA command is "monitor all", meaning it will read all raw data on the bus. It relies on a lot of other parameters and I think you need to know which type of bus you are connected to to interpret it correctly.

I suggest you take a look at the ELM327 data sheet
http://elmelectronics.com/DSheets/ELM327DSH.pdf
This takes quite a lot of study. I hope you have enough time.

Terry
Thank you for the help Terry:
I have looked at the information, can not get the wright settings,
for example:
What settings do I set to get:
Live readings for RPM, Fuel pressure, O2 sensors voltage etc. at the same time or automatically ?
I can get them one by one with (at 01 05,at 0C), but if I put a timer to do this, it does not work to good.
can you give any suggestions ?

Thank you again:
 
Upvote 0

terryn

Member
Licensed User
Longtime User
SoyEli,
I insert the commands that I want to send, into a list and use a thread in a class to send from the list. The same thread has a "NewData" event sub which notifies the main thread of incoming data. When data is received on the main thread, it is interpreted in a long Select sub and displayed by the guages.
Each command must be sent one by one because it is only a serial connection but on most vehicles it is so fast that it looks continuous.
The maximum delay should only be 200ms.
I find this works OK with minimum delay to the UI.

Terry
 
Upvote 0

SoyEli

Active Member
Licensed User
Longtime User
SoyEli,
I insert the commands that I want to send, into a list and use a thread in a class to send from the list. The same thread has a "NewData" event sub which notifies the main thread of incoming data. When data is received on the main thread, it is interpreted in a long Select sub and displayed by the guages.
Each command must be sent one by one because it is only a serial connection but on most vehicles it is so fast that it looks continuous.
The maximum delay should only be 200ms.
I find this works OK with minimum delay to the UI.

Terry
Thank you for the help:
Would it be to much if I asked for an example of your project ?
I have a lot of ?,s of your explanation above, and don.t want to keep bugging you.
I don't want somebody else to wright the program for me, but I have been on the computer for 3 days and can not find a forum or any help with this.

Thank you !
 
Upvote 0

terryn

Member
Licensed User
Longtime User
I sympathise with you because I was in the same position about a year ago.
I have been on the computer for 3 days
Three days is a mear blink of the eye, I spent six months searching, studying and experimenting. I am on version 24 and still nowhere near finished.
I have included the full INCOMPLETE project. The code is very scatty and may be hard to follow but you could use the OBDService module without much modification.

I think you might have a busy weekend ahead!

Please compile and test the project before using any of the code because I have'nt worked on this for a while and may have inadvertantly changed something.

Terry
 

Attachments

  • digidash.zip
    40.3 KB · Views: 271
Last edited:
Upvote 0

terryn

Member
Licensed User
Longtime User
SoyEli,
I forgot to put this file in for you.
Its a very crude ELM327 emulator for PC with Bluetooth, that I made one day when I got fed up with going to the car in the rain.
You will have to alter the file paths in "commands.ini" and/or make your own PID's.

Hope this helps
Terry
 

Attachments

  • Elm327em.zip
    450.2 KB · Views: 256
Upvote 0

SoyEli

Active Member
Licensed User
Longtime User
I sympathise with you because I was in the same position about a year ago.

Three days is a mear blink of the eye, I spent six months searching, studying and experimenting. I am on version 24 and still nowhere near finished.
I have included the full INCOMPLETE project. The code is very scatty and may be hard to follow but you could use the OBDService module without much modification.

I think you might have a busy weekend ahead!

Please compile and test the project before using any of the code because I have'nt worked on this for a while and may have inadvertantly changed something.

Terry
THANK YOU !!!
It is people like you that make a deference in this world.
:):):)
 
Upvote 0

Dale Lin

Member
Licensed User
Longtime User
I sympathise with you because I was in the same position about a year ago.

Three days is a mear blink of the eye, I spent six months searching, studying and experimenting. I am on version 24 and still nowhere near finished.
I have included the full INCOMPLETE project. The code is very scatty and may be hard to follow but you could use the OBDService module without much modification.

I think you might have a busy weekend ahead!

Please compile and test the project before using any of the code because I have'nt worked on this for a while and may have inadvertantly changed something.

Terry

Hi terryn,

I tested this program, it is work.
But I have a problem:
In OBDService:
BT.ConnectInsecure(Admin,Device,1), this code can connect a smart phone (4.4.2) and work, but can't connect Idea TabA1000-A tablet (4.1.2)
so, I change this code to BT.Connect(Device), and it is work.

Why?

Thank you.

Dale
 
Upvote 0

terryn

Member
Licensed User
Longtime User
Hi terryn,

I tested this program, it is work.
But I have a problem:
In OBDService:
BT.ConnectInsecure(Admin,Device,1), this code can connect a smart phone (4.4.2) and work, but can't connect Idea TabA1000-A tablet (4.1.2)
so, I change this code to BT.Connect(Device), and it is work.

Why?

Thank you.

Dale

Hi Dale,
I think it is a bit hit and miss with either connect method but there is a good explanation here http://www.b4x.com/android/forum/threads/serial-bluetooth.37964/

The best way to connect would be :-
Try BT.Connect
If that fails
Try BT.ConnectInsecure and iterate through say the first five ports


Terry
 
Upvote 0

Dale Lin

Member
Licensed User
Longtime User
Upvote 0

terryn

Member
Licensed User
Longtime User
Hi Dale,
You could try something like this.

B4X:
Sub Process_Globals
Dim Admin As BluetoothAdmin
Dim BT As Serial
Dim Step As Int
Dim Device As String
End Sub
 
Sub Activity_Resume
Step = 0
BT.Connect(Device)
End Sub
 
Sub BT_Connected(Success As Boolean)
If Success Then
    'Start communication
Else
    Step = Step + 1
    If Step > 4 Then Return
    BT.ConnectInsecure(Admin,Device,Step)
End If
End Sub

Terry
 
Upvote 0

Dale Lin

Member
Licensed User
Longtime User
Hi Dale,
You could try something like this.

B4X:
Sub Process_Globals
Dim Admin As BluetoothAdmin
Dim BT As Serial
Dim Step As Int
Dim Device As String
End Sub

Sub Activity_Resume
Step = 0
BT.Connect(Device)
End Sub

Sub BT_Connected(Success As Boolean)
If Success Then
    'Start communication
Else
    Step = Step + 1
    If Step > 4 Then Return
    BT.ConnectInsecure(Admin,Device,Step)
End If
End Sub

Terry
Hi Terry,

Thanks for your help.
It works well.

Finally, I have a question, the RCOMM channel always 1 to 4?

Dale
 
Upvote 0

terryn

Member
Licensed User
Longtime User
Dale,
I have read that there are up to 60 ports for use in RFCOMM.
The device will allocate the lowest port first so unless your device is using many ports in other coonections, it is unlikely to be more than four or five.
It would also be a very slow process to try more than a few ports.

Terry
 
Upvote 0

Dale Lin

Member
Licensed User
Longtime User
Dale,
I have read that there are up to 60 ports for use in RFCOMM.
The device will allocate the lowest port first so unless your device is using many ports in other coonections, it is unlikely to be more than four or five.
It would also be a very slow process to try more than a few ports.

Terry
Hi Terry,

Thank you for giving so much help, so I learned a lot.

Dale
 
Upvote 0

Anastasios Michaelides

Member
Licensed User
Longtime User
Hello terryn,
I am trying to use your code to connect with obdii in my car with no success.
The phone connected with the device but don't sends or receive any data.
When I connect the phone with your windows test application connects fine and
exchange data correctly.
I know that I am asking a lot but it is possible for you to guide me through so I can
find a solution?
Ether way I want to thank you for sharing your code with us, you helped me a lot.
 
Upvote 0

terryn

Member
Licensed User
Longtime User
Hi Anastasios,
Sorry it has taken so long to reply.
Have you tried any other real devices?
Is the device ELM327 compatible?
Maybe install a Bluetooth terminal App to make sure that you can talk and get a response.

Terry
 
Upvote 0
Top