Getting different data from SD and over Bluetooth
Posted: Tue Sep 09, 2014 12:58 am
Hi, I'm working with an Android project which reads over Bluetooth what the Freematics OBD II adapter v2 is sending. What's weird is that I can see the logged data into the SD different from what I can see when I read it in Android.
What I can see in SD card is something like:
$GPRMC,131200.569,V,,,,,0.00,0.00,080914,,,N*42
11791,F020,-1632,420,16956
125,10C,9687
$GPRMC,131201.669,V,,,,,0.00,0.00,080914,,,N*40
23,F020,-1696,376,16932
150,10D,247
$GPGGA,131201.869,,,,,0,0,,,M,,M,,*4F
And when I read the stream in Android I get something like this:
F020,-1744,400,16396
104,71
$GPRMC,144735.301,V,,,,,0.00,241.26,080914,,,N*48
F020,-1660,376,16336
111,81
F020,-1620,376,16312
10E,-21
$GPRMC,144735.601,V,,,,,0.00,241.26,080914,,,N*4D
To read the stream in Android I'm using something like:
So, over Bluetooth I'm not seeing the time since the previous read and many times I move the knob in the OBD emulator (v1) and the value I get over Bluetooth doesn't change (it changes in the logged values in the SD card)
Why is the difference? How can I make them the same?
What I can see in SD card is something like:
$GPRMC,131200.569,V,,,,,0.00,0.00,080914,,,N*42
11791,F020,-1632,420,16956
125,10C,9687
$GPRMC,131201.669,V,,,,,0.00,0.00,080914,,,N*40
23,F020,-1696,376,16932
150,10D,247
$GPGGA,131201.869,,,,,0,0,,,M,,M,,*4F
And when I read the stream in Android I get something like this:
F020,-1744,400,16396
104,71
$GPRMC,144735.301,V,,,,,0.00,241.26,080914,,,N*48
F020,-1660,376,16336
111,81
F020,-1620,376,16312
10E,-21
$GPRMC,144735.601,V,,,,,0.00,241.26,080914,,,N*4D
To read the stream in Android I'm using something like:
Code: Select all
protected void readRawData(InputStream in) throws IOException {
byte b = 0;
StringBuilder res = new StringBuilder();
while ((char) (b = (byte) in.read()) != '\n') {
res.append((char) b);
}
}
So, over Bluetooth I'm not seeing the time since the previous read and many times I move the knob in the OBD emulator (v1) and the value I get over Bluetooth doesn't change (it changes in the logged values in the SD card)
Why is the difference? How can I make them the same?