Page 1 of 2

Android App talking to the Freematics v2

Posted: Sat Jun 21, 2014 9:51 am
by gdpwork
Hi, I'd like to create an Android app which can talk to the Freematics V2 OBD II adapter. Has anyone tried that?
I know how to create a bluetooth connection from Android, but then, how can I get OBD data, GPS positions, data fro accelerometers, etc directly from the adapter and/or from the SD Card over bluetooth?
Thanks in advance!!

Re: Android App talking to the Freematics v2

Posted: Wed Jun 25, 2014 9:52 pm
by stanley
Take a look in the sample data logger sketch for Freematics OBD-II adapter. It's very easy to let your phone get all those data.
https://github.com/stanleyhuangyc/Freem ... datalogger

Re: Android App talking to the Freematics v2

Posted: Thu Jun 26, 2014 8:25 am
by orpheus88
Yeah just enable data streaming in the configuration file and than you can use a Bluetooth Terminal App to see what's transmitted and with that info you can think of an app to process it all.

Re: Android App talking to the Freematics v2

Posted: Thu Jun 26, 2014 5:51 pm
by stanley
Yes, just make sure the baud rate matches. ;-)

Re: Android App talking to the Freematics v2

Posted: Wed Jul 30, 2014 5:34 am
by gdpwork
Stanley,
I've downloaded the project https://github.com/pires/android-obd-reader which is a reader for Android. Is works perfect on Android Studio with the ELM327 OBD-II reader connected to the Freematics OBD-II Emulator using 500K, 11-bit and ISO 14230).
When I try it with the Freematics OBD-II reader , it doesn't work, I've debug it and I found that in the method readRawData(InputStream in) of the class ObdCommand the following is showing just squares for res variable in the watch dialog of Android Studio, where the ELM327 shows readable letters, Do you happen to know why or what can be wrong? Same protocol is being used for both.

// read until '>' arrives
while ((char) (b = (byte) in.read()) != '>')
res.append((char) b);

Thanks in advance!

Re: Android App talking to the Freematics v2

Posted: Wed Jul 30, 2014 5:38 am
by gdpwork
Same configuration was used, baud rate, protocol, etc

Re: Android App talking to the Freematics v2

Posted: Fri Aug 01, 2014 11:28 pm
by stanley
Please be very aware that Freematics OBD-II adapter is NOT a ELM327 bluetooth reader.

Re: Android App talking to the Freematics v2

Posted: Sat Aug 02, 2014 12:00 am
by gdpwork
Ok, I understand now that the Freematics outputs binary and not strings as ELM327. I'll leave how to emulate the ELM327 with Freematics for others:

The stock firmware outputs data in binary form. If you want it work as an ELM327, please download the following sketch.
https://github.com/stanleyhuangyc/Freem ... /elm327emu

Anyways, I don't get quite well, how to interact with the Feematics from Android and I'll explain why:
From Android Studio, I'm opening a connection using Bluetooth, now, What I'm not understanding is:
1) I have a connection established
2) I have the socket object listening (which will be fine if using ELM327, but I'm not)

I know the responses are binary for Freematics, but, How can I request something to it? Should I create some kind of freematics object in Android side so I can call its methods like:

freematics.initGPS()? Should I import any library into the Android project?
And How I can read it?

Since you have an iOS app already done, It would be great if you can post just a really simple example of how to connect, request 1 thing and read the response, in iOS or Android, that will unblock me and anyone else having the same problem.

I didn't find that kind of information here: http://freematics.com/pages/products/fr ... d-adapter/

Thanks in advance!

Re: Android App talking to the Freematics v2

Posted: Fri Apr 24, 2015 4:47 pm
by linigers
Hi,
did anybody manage to get a connection to an Android device? I would like to get some PIDs (for example PID_RPM, PID_SPEED) and send them to an Android device.

Thanks in advance.

Re: Android App talking to the Freematics v2

Posted: Sat Apr 25, 2015 11:15 am
by stanley
For just testing, you can use a android serial terminal app.