Using clone ELM327 Bluetooth OBDII adapter with Leaf

My Nissan Leaf Forum

Help Support My Nissan Leaf Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Turbo3 said:
firetrax said:
Does this version now read "true" Gids from the EV-CAN if selected?

Also, it's probably updating your 1st post to link to this version.


Don't understand the second sentence.

--------------------------------------------

Sorry, I meant to say that it's probably worth updating your first post to link to the current version of the app.
 
firetrax said:
Turbo3 said:
firetrax said:
Does this version now read "true" Gids from the EV-CAN if selected?

Also, it's probably updating your 1st post to link to this version.


Don't understand the second sentence.

--------------------------------------------

Sorry, I meant to say that it's probably worth updating your first post to link to the current version of the app.
The very first line of the post has the link. That was done yesterday when I released the code. So there is nothing to update.
 
A neat idea for testing is that it's been confirmed that using Parallels 8 on OSX you can run an Android 4 virtual machine with Bluetooth support so the app works!
 
Turbo3, cosmetic problem with Leaf Battery app 0.24

Stoaty noticed a problem with one of the screenshots I took. It appears the app truncates the word reset directly after the Wh display on screen 3.

screenshot-1368838189919.png


I tried to see if there was a font setting in Android, but didn't see anything of note.
This is on

Verizon Droid (Original Droid)
CyanagenMod 7
Android Gingerbread v 2.3.7
 
Scaling of the fonts happens outside my app based on your screen size.

However, I can make the field longer so for those devices that have a problem with scaling there will be extra room.

Here is what it looks like on a Sony XperiaV. The screen is 720x1280. It got the graphic right (boxes) but the font was scaled up too much.

At this point I do not know how to fix that without a device to play around with. Note that the bottom section looks ok (v0.23 and the red Not box).

screenshot2013051510550.png
 
I'm curious... at the development level, what APIs are you working with here? Is this all Android stock native stuff? Or are you importing any third party libraries to build the user interface, OBD/Bluetooth/ELM interface, etc...? It seems like a lot of the stuff is kinda disconnected from the "native" way I see a lot of apps presenting data... which I would assume is contributing to the display weirdness. Since I'm also interested (but not involved - though I'd love to be) in Android programming, I'd love to look up and research the APIs/libraries you're using. :)
 
1. Is it possible that the fonts you are using do not exist
on these "other" phones, and the substitute font is not
fully scalable?

2. Using older data from the car on the new v24 and 24b,
the bar Graph data does not match the max, ave, min.

3. The data on the histogram does not match its
min, ave, max, and does not match the bar Graph data either.

4. The min, ave, max on the histogram does not match the
max, ave, and min on the Bars.

5. Shouldn't both of these graphs, and their min, ave, and max
be derived from the SAME set of (saved) CP voltages?

6. The histogram shows min, max, and Average in increasing
sequence, which matches the histogram data, lowest on the
left. The label under the bar Graph is max, ave, min (decreasing).
Could you change the Bars label to be min, ave, max to match
the histogram?

7. The left axis "... Scale" label on the bar graph could have ", Shunts 1248"
appended so we can better try to make sense of the highlighted "shunts".
We had 8421, and now we have 1248, but I am thinking that 4812 might
be better, but I still have not seen enough data, and now I can't tell
which encoding I am seeing in somebody's picture. Or, possibly better,
a choice of orders, or a setting of the orders, in the Setup Debug section?

8. Or, like I am seeing different data in bars and histograms, is it possible
that the shunts data that we read does not actually go with the CP date
that we just read? Maybe the Shunt data needs to be read right after
the CP data, or one needs to synchronize getting this data with a pause
in the BMS's process of re-reading the CP data?

9. Sometimes the app seems to get confused and not turn Off Bluetooth
as it exits. Maybe a checkbox in the System part of Settings to
"Force BT Off"?
 
garygid said:
1. Is it possible that the fonts you are using do not exist
on these "other" phones, and the substitute font is not
fully scalable?

2. Using older data from the car on the new v24 and 24b,
the bar Graph data does not match the max, ave, min.

3. The data on the histogram does not match its
min, ave, max, and does not match the bar Graph data either.

4. The min, ave, max on the histogram does not match the
max, ave, and min on the Bars.

5. Shouldn't both of these graphs, and their min, ave, and max
be derived from the SAME set of (saved) CP voltages?

6. The histogram shows min, max, and Average in increasing
sequence, which matches the histogram data, lowest on the
left. The label under the bar Graph is max, ave, min (decreasing).
Could you change the Bars label to be min, ave, max to match
the histogram?

7. The left axis "... Scale" label on the bar graph could have ", Shunts 1248"
appended so we can better try to make sense of the highlighted "shunts".
We had 8421, and now we have 1248, but I am thinking that 4812 might
be better, but I still have not seen enough data, and now I can't tell
which encoding I am seeing in somebody's picture. Or, possibly better,
a choice of orders, or a setting of the orders, in the Setup Debug section?

8. Or, like I am seeing different data in bars and histograms, is it possible
that the shunts data that we read does not actually go with the CP date
that we just read? Maybe the Shunt data needs to be read right after
the CP data, or one needs to synchronize getting this data with a pause
in the BMS's process of re-reading the CP data?

9. Sometimes the app seems to get confused and not turn Off Bluetooth
as it exits. Maybe a checkbox in the System part of Settings to
"Force BT Off"?
Version 0.24c has fixes for most of these. Please download and confirm fixes.
1. In B4A there are only 4 choices
--Default (which is what I use)
--SANS_SEFIF
--SERIF
--NONSPACE
2. The Y-axis was rounded so it just looked like the data did not match. Adjusted Y-axis labels to be correct for data.
3. X-axis was rounded to 2 significant digits so it just looked off. Adjust X-axis labels to better match data
4. Seems like 3 above but there was also an error that caused the min to be off by 0.001 volt. That has been fixed.
5. Yes, same data same min/avg/max except for bug that made min on Histogram off by 0.001
6. Done
7. Done
8. Shunt data is requested just before CP voltages. But there is no sync with when display is updated. But if the shunts stays the same for two updates then it must match the data (although which data gets highlighted could still be off ( 1248 8421 2184 .....?)
9. I haved added a check box in System to force BT off. But you will have to confirm that it fixes your issue. The flag that gets set when BT is enabled and is used to shutdown BT on exit is never cleared. That is there is a sinlge statement BTON=True but nowhere in the code is there a statement BTON=false. So I don't have much hope that adding this force bit will help.
 
I was able to somewhat easily get Androind running on VirtualBox and Windows.

Installed VirtualBox and the extensions for USB 2 support.
Setup a VM which connected to my USB Bluetooth device, network,
and storage, etc.
Then I mapped the latest Android-x86-4.2-dev live CD from http://www.android-x86.org/download" onclick="window.open(this.href);return false; and installed it and went through the SD card creation.

Was able to install the app, connect to the ELM, get data, and navigate around the app with the mouse.

It's too bad but the 12 volt voltage was all over the place but when measured at the battery it was very stable.

Has anyone had an issue of clicking a
few times a second from the passenger side wheel well? This happened while connected watching the car charge with the car off, after the charging completed. The ELM green light was blinking to the clicking and it stopped when I unplugged it.

Don't have my GIDMeter to compare but 100% charge gave me 93% SOC and capacity is 97% after 2 years and 16k miles with only handful of DCQC and 5 days a week of 80% charging.
 
Turbo3 said:
....
1. In B4A there are only 4 choices
--Default (which is what I use)
--SANS_SEFIF
--SERIF
--NONSPACE....

hello,
with b4a you can also use any ttf font you like.
it works like this:
you select a ttf font and you copy it in the "Files" folder of your project.

and you adapt your program:
Sub Globals
...
Dim MyFont As Typeface
End Sub

Sub Activity_Create(FirstTime As Boolean)
....
MyFont = Typeface.LoadFromAssets("MicrogrammaDMedExt.ttf")
End Sub

Sub Activity_Resume
....
L_soc.Typeface = MyFont
L_V.Typeface = MyFont
L_A.Typeface = MyFont
...
End Sub
 
Okay, couple things.
(oh, don't all long posts start off this way? Go grab a drink and come back. It's not (all) bad. :lol: )

1: Bluetooth gripe.
Please do not ever touch system controls unless there's a settings option to disable this functionality on a case-by-case basis. Oh man, this is a huge one for me. I want apps to have Apple-like control of my Android - because with iOS, it doesn't allow apps to control things unless specifically instructed/allowed. Hundreds of apps, no problem - always goes home when I hit "home", always has the system given complete control of everything. On my phone, everything competes because apps do things I don't expect or want them to.

(disclaimer: I have never owned an iPhone, and the iPhone I had been using for work was returned half a year ago - so I've been using nothing but Android with a single bright spot of iOS along the way)

So when I hear that "bluetooth isn't turning off when I close the app" or that "should pausing turn off BT", etc.., I get the feeling the app is supposed to be interacting with my main Bluetooth operation (i.e. switching the adapter on/off) which I *never* want turned on or off by an app. Usually because I'm also playing music while in the car - and by trying to enable or disable it, it's probably tripping over the active BT connection. I've got a pull-down status-bar option for turning BT on or off (and I usually leave it on). And that presents another problem, which leads us to...

2: UI suggestions
Full-screen sucks here. It removes the pull-down status/notification bar in Android (Gingerbread here - though I could switch all the way up to Jelly Bean if I want with the stock OS). Which keeps me from accessing the time, status, notifications, device options, etc., that make my phone a phone. If I'm sitting safely away from traffic while using this, I shouldn't have to go Home to get my status bar back. Jus' sayin'. ;)

The driving window is blindingly bright on the screen by default, which is why I hadn't used it much in traffic. But after driving at night, I changed it to a night scheme with a black background and off-blue text. On an OLED screen like mine, black is "off", i.e. pixels using zero power. So the screen is pitch black with words engraved in it - which is visually stunning and an awesome "night mode" option. Maybe just query the sunset time function (I think that's common in Java, right?) for the system, use that as night mode, query sunrise, use that as day mode. Thoughts?

3: Am I missing something?
Seriously, we're at 115+ pages now, and I jumped in around 98. I'm so lost. What's this about the EV-CAN bus I'm missing? I know it can't access it with a stock BT adapter, and I know what pins need to be swapped to make it work (and even have a plan to modify my stubby adapter, even with the pins mounted straight to the PCB). But what I don't understand is what does this offer that's not already there? I think motor amps and battery amps is missing - is that it? What's about this braking thing I keep hearing about? Because I imagine with an app that can process that information that quickly, it could make a graphical expansion of the regen system and hugely improve my driving efficiency. If there's a beta for that, I *SO* want in. ;) I've got a ton of experience trying to tune my braking on this thing, but I miss a lot of power to harder stops planned too late for regen. A little visual cue like in the app could make this app a "must-have" for a lot of people.

4: The first page. Oh god, the first page!
Okay, forums suffer a tragic flaw: they're horrible at archiving. Only because I'm really into this stuff, I got myself up-to-date pretty easily. But without combining information from recent pages (from what date/page is up to the viewer's dedication to the subject...), all a person has to go on is the first post. And right now, the multi-page first post is pretty overwhelming for something as well-designed as this app. I think you can just consolidate the first post to a brief description, a link to the Dropbox folder (specifically for this app's relevant files - not sure what the other files are in there), and a link to the Amazon item I'm using that's cheap and works quite well: http://amzn.com/B008U1MOM8" onclick="window.open(this.href);return false; - that way people know what it is, where to get it, and the one piece they probably don't already own. Everything else can be explained in a "FAQ" style format below. That makes troubleshooting and further information much easier to navigate. Maintain a list of key posts just below that. And a link to the Wiki. But the rest of it is just *really* complicated-sounding for what's really a very well-designed and intuitive app. Just a little page from Apple's rather well-written book :)

5: Oh yeah, and what's up with Wh?
On my trip today, my last charge ended with a rather strange result. After I unplugged the car, the Wh kept counting down into the negatives. I unplugged it shortly after going negative - but it kept going even after unplugging, ticking one off per second as it had been doing during the charge. I assumed around that time (and the corresponding 92% SOC and the 12th bar having just appeared), it was actually adding more power to the battery than it had when I left. An understandable variance for a battery of this size. But even when I turned the car back on (from "run" as it had been during the charge, straight to "ready", without dropping the stereo/accessories), it kept ticking into the negatives. Only once the motor power was applied to back out of the space, the count stopped and it started running forward again. Bug? Is that value calculated based on other averages, or is that actual number counts from the CAN bus itself?

And now, the good news. It's accurately helped me make the first, longest, least-charger-populated part of my Fresno-to-San Mateo trip today. Sitting here in Los Banos charging now, while I dutifully strolled into the campgrounds on "Very Low Battery" without a doubt in my mind I'd make it. The accuracy and usefulness of this app for predicting range and deciding when the charge will be sufficient is absolutely unparalleled. I'd buy this app. :cool:

Maybe to solve most of the first-page and "catch me up" detail, start a Facebook page for the app? I'd be all over that. :D
 
v24c has (using the default test data):

1. fixed the Min, Max, Ave issues, and the Bars now display correctly

2. the histogram, when the data is all within the scale, shows the
data one mv too high.

3. When some of the histogram data is off-screen, the scale adapts
to see all the data, but the low tic placement seems wrong, and that
one data point might be positioned correctly (but the low tic is one mv too
high), while the rest of the histogram bars are still one mv too far right.

4. The Bars no longer show data that goes off-graph to the bottom,
but still allows the off-graph data to the top to draw to the top of
the screen. Probably should be clipped at the graph boundary?

5. When CP mv data is off-graph, the histogram scale adapts,
but the scale for the Bars does not. Is that intentional?

6. If one is looking at well-behaved CP Bar data on the 50 mv scale,
and the cells all decrease in voltage, as expected while driving,
would all the data just move off-graph?
The user selects the range of the scale, and you do not really
need to be auto-ranging like the histogram, since you gave
the user an easy way to increase or decrease the range.
However, it appears, at least from the test data, that
sliding the scale (adaptive min axis point) does not
happen. Is that intentional? If the data starts to go off-graph,
the "zero-point" needs to adjust, perhaps by re-centering the
max and min data, and even selecting a wider range, but only
if necessary to see all the data.

7. Without using the new "Force off BT" checkbox, I did not experience
the failure to turn BT off that I occasionally see on the Vizio
Android tablet (v3.2.1 OS). I will watch for it. Since you do not
turn the BT flag off, either it did not get set (most likely), or
there was a way around the test for the flag when you exit
(less likely, but possible).

8. Thanks for showing the 1248.

9. It would be very nice to be able to set an integer value, like 4812,
perhaps in the Debug section, to choose the shunt-bit display order.
We have tried 8421 and some 1248, but 4812 (and maybe 2184) is
another likely candidate.

100. Thanks for all your great work. :D :D
 
I will attempt some answers:

1: Bluetooth gripe.
Please do not ever touch system controls unless there's a settings option to disable this functionality on a case-by-case basis. Oh man, this is a huge one for me. I want apps to have Apple-like control of my Android - because with iOS, it doesn't allow apps to control things unless specifically instructed/allowed. Hundreds of apps, no problem - always goes home when I hit "home", always has the system given complete control of everything. On my phone, everything competes because apps do things I don't expect or want them to.

^^ Many apps take control of system functions, otherwise they cannot function.
In some cases, like GPS, Android apparently makes the app ask the user to
turn the GPS on.

So when I hear that "bluetooth isn't turning off when I close the app" or that "should pausing turn off BT", etc.., I get the feeling the app is supposed to be interacting with my main Bluetooth operation (i.e. switching the adapter on/off) which I *never* want turned on or off by an app. Usually because I'm also playing music while in the car - and by trying to enable or disable it, it's probably tripping over the active BT connection. I've got a pull-down status-bar option for turning BT on or off (and I usually leave it on).

^^The default for this app is to turn BT on, only if it was off, and turn BT off only
if this app turned it on. So, if you have BT on before you enter this app, it will
(should, nirmally) remain on when this app exits. With the new checkbox feature,
those of us who want to make sure BT goes off, can do so.

2: UI suggestions
Full-screen sucks here. It removes the pull-down status/notification bar in Android (Gingerbread here - though I could switch all the way up to Jelly Bean if I want with the stock OS). Which keeps me from accessing the time, status, notifications, device options, etc., that make my phone a phone. If I'm sitting safely away from traffic while using this, I shouldn't have to go Home to get my status bar back. Jus' sayin'. ;)

^^Agree, and the app's Settings shows the Android status bar.
Perhaps there could be a Settings option to show the status on some
or all of the screens, but at least you do not have to use Home
to see the status bar. Paticularly on the graphics screens,
many of us would want an option to NOT see the status bar.

The driving window is blindingly bright on the screen by default, which is why I hadn't used it much in traffic. But after driving at night, I changed it to a night scheme with a black background and off-blue text. On an OLED screen like mine, black is "off", i.e. pixels using zero power. So the screen is pitch black with words engraved in it - which is visually stunning and an awesome "night mode" option. Maybe just query the sunset time function (I think that's common in Java, right?) for the system, use that as night mode, query sunrise, use that as day mode. Thoughts?

^^You can choose the color scheme in Settings now.
However, it would be nice to be able to set the colors
for at least 2 modes, day and night.
Indeed, color schemes for shadow and sunlight
modes might also be nice.
Then comes switching (or user selecting) the Skin, and
when to do so automatically.
These features will come eventually, I expect.

3: Am I missing something?
Seriously, we're at 115+ pages now, and I jumped in around 98. I'm so lost. What's this about the EV-CAN bus I'm missing? I know it can't access it with a stock BT adapter, and I know what pins need to be swapped to make it work (and even have a plan to modify my stubby adapter, even with the pins mounted straight to the PCB).

^^The EV bus has Real GIDs, and Pack current.
The CAR bus has the Braking information.
For now, it appears that the Requested information can be
obtained from either bus.

But what I don't understand is what does this offer that's not already there? I think motor amps and battery amps is missing - is that it? What's about this braking thing I keep hearing about? Because I imagine with an app that can process that information that quickly, it could make a graphical expansion of the regen system and hugely improve my driving efficiency. If there's a beta for that, I *SO* want in. ;) I've got a ton of experience trying to tune my braking on this thing, but I miss a lot of power to harder stops planned too late for regen. A little visual cue like in the app could make this app a "must-have" for a lot of people.

^^Using the Mechanical and Regen info from the CAR CAN bus, Turbo3 is
working on such a screen. However, using this simple ELM327-type device
to both Request information AND read one CAN Message type at the same
time appears to be difficult, and he is working on switching between the
Listen for one Message ID mode and the Request a paragraph mode.
Have patience, it is being worked on.

4: The first page. Oh god, the first page!
Okay, forums suffer a tragic flaw: they're horrible at archiving.

^^Not really true, I believe.

Only because I'm really into this stuff, I got myself up-to-date pretty easily. But without combining information from recent pages (from what date/page is up to the viewer's dedication to the subject...), all a person has to go on is the first post.

^^No, you have the growing wiki, and recently some related threads.

And right now, the multi-page first post is pretty overwhelming for something as well-designed as this app. I think you can just consolidate the first post to a brief description, a link to the Dropbox folder (specifically for this app's relevant files - not sure what the other files are in there), and a link to the Amazon item I'm using that's cheap and works quite well: http://amzn.com/B008U1MOM8" onclick="window.open(this.href);return false; - that way people know what it is, where to get it, and the one piece they probably don't already own.

^^How many devices have you bought and extensively tested from this source?
This one is a mini size, slightly difficult to remove, difficult to open to modify,
difficult to modify, and almost impossible to add a 2-CAN selector slide switch
inside the enclosure. Asside from those concerns, it is good that the one that
you got actually works well for you. I have two of them in my collection of
over 2 dozen, most of which are the "stubby" type that are easy to modify.

Everything else can be explained in a "FAQ" style format below. That makes troubleshooting and further information much easier to navigate. Maintain a list of key posts just below that. And a link to the Wiki. But the rest of it is just *really* complicated-sounding for what's really a very well-designed and intuitive app. Just a little page from Apple's rather well-written book :)

^^Sounds like a great project for you, if you want to contribute time, starting and
maintaining a User Manual or FAQ thread for this great app. :D

5: Oh yeah, and what's up with Wh?
On my trip today, my last charge ended with a rather strange result. After I unplugged the car, the Wh kept counting down into the negatives. I unplugged it shortly after going negative - but it kept going even after unplugging, ticking one off per second as it had been doing during the charge. I assumed around that time (and the corresponding 92% SOC and the 12th bar having just appeared), it was actually adding more power to the battery than it had when I left. An understandable variance for a battery of this size. But even when I turned the car back on (from "run" as it had been during the charge, straight to "ready", without dropping the stereo/accessories), it kept ticking into the negatives. Only once the motor power was applied to back out of the space, the count stopped and it started running forward again. Bug? Is that value calculated based on other averages, or is that actual number counts from the CAN bus itself?

^^It appears that the car's sensors, or data, or our interpretation of the data
leads to inaccurate energy, power, or current values that tend to indicate that
the car is charging the battery slightly when it is actually using energy.

And now, the good news. It's accurately helped me make the first, longest, least-charger-populated part of my Fresno-to-San Mateo trip today. Sitting here in Los Banos charging now, while I dutifully strolled into the campgrounds on "Very Low Battery" without a doubt in my mind I'd make it. The accuracy and usefulness of this app for predicting range and deciding when the charge will be sufficient is absolutely unparalleled. I'd buy this app. :cool:

^^Very nice, indeed. :D

Maybe to solve most of the first-page and "catch me up" detail, start a Facebook page for the app?

^^Perhaps another place to stuff information, but I do not use Facebook, and
do not have any good understanding of what benefit it offers in this case,
except perhaps acting like a rather uncontrolled blog or mini-forum.

I'd be all over that. :D[/quote]
 
priusfan said:
hello,
with b4a you can also use any ttf font you like.
it works like this:
you select a ttf font and you copy it in the "Files" folder of your project.
batteryproblemmnl


Thanks for mentioning that. Will this approach embed the font in the application bundle?
 
Back
Top