Leaf Spy and Leaf Spy Pro

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.
I will need to do a test drive tomorrow to see if a fix I put in for an end of trip bug works. For some reason the Power Switch is occasionally being detected as off for once cycle while driving. This causes one trip to be logged as two. I am logging the raw Power Switch data byte as well as requiring the Power Switch to be off for at least two cycles before declaring an end of trip. That should fix the problem as well as log what state the data byte is actually in when this happens.

If the fix works I should be able to release test versions tomorrow evening. Lots of new stuff for testing.

If you tap the upper right corner it brings up the Menu (OBDII Select, Settings, About, Exit). Useful for those who have the newer phones without a dedicated Menu key.

Here is the finished help overlay for screen 4. You just press and hold down the upper right corner to bring this up.
0EJn5R.png


After some testing it should be ready to release to everyone else.
 
Just uploaded the latest test versions of Leaf Spy. Give it the usual 90 minutes before you can see/download them.

0.29.20 Leaf Spy Lite
0.32.39 Leaf Spy
0.34.56 Leaf Spy Pro

Here is the change log for Leaf Spy & Leaf Spy Pro. Lite is a subset of this.

- To support Android devices that no longer have a dedicated Menu key added a soft Menu key to the upper right corner of the screen (indicated by three dashes). Tapping this area brings up the Select OBDII, Settings, About & Help and Exit list.

- Added a Help overlay feature that highlights touch sensitive areas on the current screen. By pressing and holding down the upper right corner of the screen the screen will be overlaid with help information specific to the current screen. The golden rectangles are single tap areas while the green areas have both a short and long tap function.

- Added a Trip recorder function that records both Trip and charging information to a log file. The information saved includes date, time, duration energy change and many other items. The file is named TripChrgLog_partialVIN_partialAndriodID.csv and can be imported into excel for viewing.

- Added Trip timer to top of screen 4.

- Added miles/km countdown counter to screen 4. Starting distance configured in Settings menu. Initialize counter through a long tap of the distance to event field.

- The Wh counter can be configured to display only energy usage during driving while excluding charge events.

- Added displaying a "relative" Ah value and battery pack voltage to screen 3. The "relative" Ah value is calculated by multiplying the battery pack rated Ah number by the current SOC % value.

- Keep Service module running unless switching between a Bluetooth and Wifi OBDII adapter.This is the way the app worked before Wifi support was added.

- Added a retry timer to the status area which runs while waiting for the Leaf to respond.

- Hide the version number string if there is insufficient room to display the entire string.

- GPS accuracy limit changed from 10 meters to 30 meters allowing graphing of elevation and speed data under weaker GPS signal conditions.

- Fixed bug in Range calculation when ambient and/or battery temperatures go below 70 degrees Fahrenheit

- Fixed two crashes caused by a null pointer and an index out of range error.

- Improved cell pair graph and histogram when displaying cells with a large range of values and with a large difference between minimum and maximum voltages.
 
Just uploaded new test versions of Leaf Spy. Give it the usual 90 minutes before you can see/download them.

0.29.21 Leaf Spy Lite
0.32.40 Leaf Spy
0.34.57 Leaf Spy Pro

Two changes.

- Block logging a charge with zero energy change. This could happen when you plug in your Leaf with timer set. The Leaf charger turns on for a couple of seconds and then turns off.

- Prevent getting stuck in the "Connect to ELM" state by forcing the reconnect timer to run. The reconnect timer can be viewed on screen 4 in the Selectable data area right after the Gids used/gained value. It will only show when the timer is running.
 
The next version will add the ability to view the Trip log from within Leaf Spy by tapping the trip timer on the top of screen 4.

I will probably rearrange some of the columns so the most interesting information is visible without the need to scroll (at least in landscape mode). I will also shorted some of the titles which will also help get more information on the screen.

Suggestions for data order are welcome if you can make them in the next day or so.

ZC6LkP.png
 
Turbo3 said:
The next version will add the ability to view the Trip log from within Leaf Spy by tapping the trip timer on the top of screen 4.

I will probably rearrange some of the columns so the most interesting information is visible without the need to scroll (at least in landscape mode). I will also shorted some of the titles which will also help get more information on the screen.

Suggestions for data order are welcome if you can make them in the next day or so.

ZC6LkP.png

How about change in elevation (+ or -) for the trip?
 
Vicki, Good idea, I will add elevation change to the trip data.

Here it is with shorter titles. By tapping a cell you can highlight the row which makes it easier to follow the row data when you need to scroll left/right.
xOo5bS.png
 
Here is what I have so far. Moved duration, dist mi, elv ft, energy, and gid change all together. Also deleted the three debug information columns at the end as they are not needed anymore.

Since I have changed the columns the current tester's trip logs will not match. Best to delete just before you install this version so the data and headers match. Otherwise the view will give strange results.

You could also modify your current log file to match by opening it with Excel then rearrange, delete columns and update header titles then saving it back to your android device. But deleting and starting fresh is the safest.

qizCRA.png
 
Here is a test run down the hill and back (-75 down, 59 up). Elevation change down and up is not the same but within the accuracy of GPS.

Note the -11 watt energy gain at 11:25:04 PM. This was when the Leaf was plugged back in with the timer set so it closed the relay then opened it for just a 2 second charge. Not sure if I should leave this type of record in or filter it out. Right now the filter is set at anything less than ABS 5 watts gets dropped.

I would also really like to separate days by a thicker separation line. But that is not as simple as it looks as there are really no lines. What you are seeing is the background red color showing through between all the little blocks of data. So either the blocks after a day change need to be moved down a little (makes for very messy code) or the height of the last day row needs to be made a little shorter so more red shows at the bottom.

5GLidK.png


(Ok, I see I screwed up the odo mi and Duration data at the end. Actually the earlier data was moved around in excel and resaved and the new data came from the app that I did not update to match.)
 
Here is a cleaned up log file with everything in the correct columns and the fixed formatting that Excel removed when I saved it restored to the way the app originally saved it.

It is not a good idea to modify the log file with excel and save it back to the android device because the default Excel format will mess up the fixed formatting the app uses (1234.0 will change to 1234) unless you manually go into excel and set the columns format before you save it.

So testers it is best if you just delete the current trip log file before install this next version.

PgBZ5k.png
 
Turbo3 said:
Here is a cleaned up log file with everything in the correct columns and the fixed formatting that Excel removed when I saved it restored to the way the app originally saved it.

It is not a good idea to modify the log file with excel and save it back to the android device because the default Excel format will mess up the fixed formatting the app uses (1234.0 will change to 1234) unless you manually go into excel and set the columns format before you save it.

So testers it is best if you just delete the current trip log file before install this next version.

PgBZ5k.png

What I'm finding interesting is those three 15.5 mile trips on your log and the difference in energy consumption for each of them. Are those the same route for each trip? This trip log could be a fascinating way to look at how consistently people drive and how weather, temp, traffic, speed affect their real world energy consumption.
 
DaveinOlyWA said:
i am not allowed to update from version 51. can I delete and reinstall without having to rebuy?
There should be no problem deleting and re-installing. The key is being logged into Google with the same email address you used to originally purchase the app.

If you have several email addresses you may have been logged in under a different one which would explain why Playstore would not let you update.
 
vrwl said:
Turbo3 said:
Here is a cleaned up log file with everything in the correct columns and the fixed formatting that Excel removed when I saved it restored to the way the app originally saved it.

It is not a good idea to modify the log file with excel and save it back to the android device because the default Excel format will mess up the fixed formatting the app uses (1234.0 will change to 1234) unless you manually go into excel and set the columns format before you save it.

So testers it is best if you just delete the current trip log file before install this next version.

PgBZ5k.png

What I'm finding interesting is those three 15.5 mile trips on your log and the difference in energy consumption for each of them. Are those the same route for each trip? This trip log could be a fascinating way to look at how consistently people drive and how weather, temp, traffic, speed affect their real world energy consumption.
I live on a bit of a hill so trips back normally take more energy then going out unless I charge to 100% when there is little to no regen available to start with.

The first 15.5 needs to be added to the second short trip after it because it turned out where we parked no longer had access to the shopping center and I had move to park closer. The second 15.5 is the return home. The third 15.5 is return from dinner with a stop (Leaf left on) to make an ATM deposit. The trip out before it is not complete as I had a bug in the elevation code that crashed the app and it took a while to disable GPS while driving so the app would run without crashing.

Keep in mind the odometer is in km units so distance will be in 0.6 mile steps.
 
pchilds suggested that I use a long tap on the +/- buttons to adjust the countdown counter value.

Although the thought was to just step once per long tap I think that would make for very slow setting if you wanted to adjust the number by more than one or two counts.

What I have implemented is a setting procedure typically used to set clocks. You hold the +/- button down and the number auto steps up or down depending on which button you are holding down.

There are actually three levels depending on how long you hold the button down.

1. When you first hold the button down past the fixed time that makes it a long hold the display will switch to showing only the countdown value and drop displaying the right side distance to event number. You will only see the countdown number followed by the down arrow. If you are displaying in miles (not km) the displayed number will change to xx.x format to show tenths. This is necessary due to the fact that a step is always in km increments which is about 0.6 miles per step and you would not always see the number change if only an integer value was shown. If you take your finger off the button just after the number is shown in the new format the number will remain unchanged.

2. If you continue to hold down the button after the display format has changed it will increment/decrement at a 2 per second rate for the next 3 seconds

3. If you continue to hold down the button after that 3 seconds it will speed up and step at a 5 steps per second rate.

Note that you are not changing the default countdown value set in the settings menu. That value can only be changed in the settings menu and is used whenever you switch to displaying the countdown value.
 
Since the most recent trips are at the bottom of the spreadsheet I have enabled a single tap after the spreadsheet is loaded to cause a jump to the bottom. It also selects the bottom row. The letter "A" has been appended to the end of the Trip Log file name to prevent tester's from accidentally trying to load the old csv format which will cause the spreadsheet code to error out.

I should be able to release this version to testers tonight. Only need to update the change log.

fqMTEY.png
 
I generally charge my car fully every day. I've been keeping track of the Gids/AHr/kWh of a full charge manually by recording them (screenshot) each time I get in the car, and then transcribing that later from a spreadsheet. This is not the most useful way to do this.

My feature request: when Leaf Spy starts, if it sees the L1/L2 counter has increased since the last run, a popup or button would appear to ask me to confirm if the car were fully charged. If I acknowledged, it would log this state as a new field in the log (it would be even better if the one line also got written to a new "charged" log). This would allow me to quickly get from the logs the data from when my car was fully charged.


In the meantime, since this doesn't exist yet, I wrote a small Perl script to post-process the Leaf Spy logs and extract this data. I works for me and it might work for you. I use ES File Explorer to push all my Logs up to Box or Google Drive, download to my computer, and run then through this script. The result is two csv files: all.csv with all the events concatenated into a single log file, and a second called charged.csv that has just the events that appeared to be full charges.
process-leafspy-logs.pl (I release it under the BSD license)

In the absence of the feature I requested above, I added some heuristics to attempt to discern what looks like a fully charged event. Out of 75 log files, it correctly pulled out all the events I had previously manually recorded plus a few I had missed (before I started recording them, or some days I forgot to screenshot it). This isn't perfect, but it's a 95% solution and it works for me.


I can then import the charged.csv into a spreadsheet and plot various like Max Gids vs. time. I got the idea from this post by michapok:
michapok said:
I picked up my Leaf (manufactured 4/13) in July 2013 and have been tracking Ahr since Sept 2013. I started around 60-61 and am now in the 58-59 region after a year and change. I live in downstate NY so summer avg hi temp is 80's, winter average hi temp is right around freezing. Here is the data I have: https://docs.google.com/spreadsheets/d/1HhaOjMdHGDm2EbDt5yHog9rMALddIIQzEhlh6Dpb35A/edit#gid=0" onclick="window.open(this.href);return false;
 
jlv said:
I generally charge my car fully every day. I've been keeping track of the Gids/AHr/kWh of a full charge manually by recording them (screenshot) each time I get in the car, and then transcribing that later from a spreadsheet. This is not the most useful way to do this.

My feature request: when Leaf Spy starts, if it sees the L1/L2 counter has increased since the last run, a popup or button would appear to ask me to confirm if the car were fully charged. If I acknowledged, it would log this state as a new field in the log (it would be even better if the one line also got written to a new "charged" log). This would allow me to quickly get from the logs the data from when my car was fully charged.


In the meantime, since this doesn't exist yet, I wrote a small Perl script to post-process the Leaf Spy logs and extract this data. I works for me and it might work for you. I use ES File Explorer to push all my Logs up to Box or Google Drive, download to my computer, and run then through this script. The result is two csv files: all.csv with all the events concatenated into a single log file, and a second called charged.csv that has just the events that appeared to be full charges.
process-leafspy-logs.pl (I release it under the BSD license)

In the absence of the feature I requested above, I added some heuristics to attempt to discern what looks like a fully charged event. Out of 75 log files, it correctly pulled out all the events I had previously manually recorded plus a few I had missed (before I started recording them, or some days I forgot to screenshot it). This isn't perfect, but it's a 95% solution and it works for me.


I can then import the charged.csv into a spreadsheet and plot various like Max Gids vs. time. I got the idea from this post by michapok:
michapok said:
I picked up my Leaf (manufactured 4/13) in July 2013 and have been tracking Ahr since Sept 2013. I started around 60-61 and am now in the 58-59 region after a year and change. I live in downstate NY so summer avg hi temp is 80's, winter average hi temp is right around freezing. Here is the data I have: https://docs.google.com/spreadsheets/d/1HhaOjMdHGDm2EbDt5yHog9rMALddIIQzEhlh6Dpb35A/edit#gid=0" onclick="window.open(this.href);return false;

As indicated in the post by michapok, the data (fully charged) you're interested in changes very little
to not at all on a daily basis. Basically when compared from day to day, the data appears as random
noise, i.e. there's really no correlation/trend. A more meaningful data evaluation would occur when
data gathering was performed monthly or every 1000 miles. As an example, it's taken over a year
and 14K miles for my Ahs to decrease by 3-4 Ahs from when it was new.
 
Back
Top