Automatic OBD-II Indigo Plugin

Posted on
Thu Mar 01, 2018 3:03 pm
rapamatic offline
Posts: 209
Joined: Aug 03, 2015
Location: Glencoe, IL

Re: Automatic OBD-II Indigo Plugin

I'm getting a bit different error message, about once a second when a vehicle is driving. Here's a sample debug log (with a few things [redacted]).

Code: Select all
Mar 1, 2018, 12:48:34 PM
   Automatic OBD-II Debug          Automatic - Minivan
   Automatic OBD-II Debug          _refreshStatesFromAPI for Automatic - Minivan (C_400027b0f9a87963)
   Automatic OBD-II Debug          Bearer 8e5c1e5f52565eb889fc982921a27e1d0b3114b3
   Automatic OBD-II Debug          Bearer 8e5c1e5f52565eb889fc982921a27e1d0b3114b3
   Automatic OBD-II Debug          Bearer 8e5c1e5f52565eb889fc982921a27e1d0b3114b3
   Automatic OBD-II Debug          Bearer 8e5c1e5f52565eb889fc982921a27e1d0b3114b3
   Automatic OBD-II Debug          <<-- entering triggerEvent: location_updated
   Automatic OBD-II Debug          getting ETA
   Automatic OBD-II Debug          getETA for C_400027b0f9a87963
   Automatic OBD-II Debug          https://maps.googleapis.com/maps/api/distancematrix/json?origins=42.06241,-87.752104&destinations=[[redacted - home]]&key=[[redacted - Google API Key]]&units=imperial
   Automatic OBD-II Debug          {
   "destination_addresses" : [ "[[redacted - my home address]]" ],
   "origin_addresses" : [ "[[redacted - looks like a good address for where the car was]]" ],
   "rows" : [
      {
         "elements" : [
            {
               "distance" : {
                  "text" : "7.1 mi",
                  "value" : 11451
               },
               "duration" : {
                  "text" : "11 mins",
                  "value" : 630
               },
               "status" : "OK"
            }
         ]
      }
   ],
   "status" : "OK"
}

   Automatic OBD-II Debug          2018-03-01 14:59:00
   Automatic OBD-II Debug          ['7.1', 'mi']
   Automatic OBD-II Debug          11 mins / 7.1 miles from home, ETA 02:59 PM
   Automatic OBD-II Debug          getting location
   Automatic OBD-II Debug          getLocation C_400027b0f9a87963
   Automatic OBD-II                Location unknown, geocode failed: list index out of range
   Automatic OBD-II Debug          getLocation: unknown location
   Automatic OBD-II Debug          updating miles
   Automatic OBD-II Debug          PreviousMiles = 2.7
   Automatic OBD-II Debug          CurrentMiles = 7.1
   Automatic OBD-II Debug          Skipping due to lack of progress *towards* home; percent change = -162.962962963
   Automatic OBD-II Debug          triage end


Posted on
Thu Mar 01, 2018 3:08 pm
dgarozzo offline
Posts: 118
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

I’ll put my plugin in debug and capture some logs to show you what I get. I’ll also see if I can craft up some tests to see if your tokens are working.


Sent from my iPhone using Tapatalk

Posted on
Thu Mar 01, 2018 3:12 pm
rapamatic offline
Posts: 209
Joined: Aug 03, 2015
Location: Glencoe, IL

Re: Automatic OBD-II Indigo Plugin

Just to clarify on my post above, which had a long string of the debug code, it looks like the errors are occuring around this part:

Code: Select all
Automatic OBD-II Debug          getting location
   Automatic OBD-II Debug          getLocation C_400027b0f9a87963
   Automatic OBD-II                Location unknown, geocode failed: list index out of range
   Automatic OBD-II Debug          getLocation: unknown location


And when I turn of debugging, I still get that one error message, about every second, in my log:

Code: Select all
   Automatic OBD-II                Location unknown, geocode failed: list index out of range

Posted on
Thu Mar 01, 2018 9:40 pm
DVDDave offline
Posts: 335
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Automatic OBD-II Indigo Plugin

rapamatic wrote:
Just to clarify on my post above, which had a long string of the debug code, it looks like the errors are occuring around this part:

Code: Select all
Automatic OBD-II Debug          getting location
   Automatic OBD-II Debug          getLocation C_400027b0f9a87963
   Automatic OBD-II                Location unknown, geocode failed: list index out of range
   Automatic OBD-II Debug          getLocation: unknown location


And when I turn of debugging, I still get that one error message, about every second, in my log:

Code: Select all
   Automatic OBD-II                Location unknown, geocode failed: list index out of range

Once my Automatic app updated with a real event, I got similar results. Will be interesting to see what dgarozzo's log looks like.

Posted on
Fri Mar 02, 2018 7:18 am
dgarozzo offline
Posts: 118
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

So it looks like I've been getting exceptions in my logs, too, but not the same ones that you guys are getting:


Code: Select all
Mar 1, 2018, 5:12:15 PM
   Automatic OBD-II                FYI - Exception caught getting vehicle info: 'latest_location'
   Automatic OBD-II                2013 Audi S4 Premium Plus:ignition:on @ 2018-03-01 17:12:16
   Trigger                         Car Started
   Automatic OBD-II                2013 Audi S4 Premium Plus:notification:hard_accel @ 2018-03-01 17:12:19
   Automatic OBD-II                2013 Audi S4 Premium Plus:notification:hard_accel @ 2018-03-01 17:12:20

Mar 1, 2018, 5:17:29 PM
   Automatic OBD-II                FYI - Exception caught getting vehicle info: 'latest_location'

Mar 1, 2018, 5:20:57 PM
   Automatic OBD-II                2013 Audi S4 Premium Plus:notification:speeding @ 2018-03-01 17:20:57

Mar 1, 2018, 5:21:56 PM
   Automatic OBD-II                FYI - Exception caught getting vehicle info: 'latest_location'

Mar 1, 2018, 5:22:20 PM
   Automatic OBD-II                2013 Audi S4 Premium Plus:notification:hard_accel @ 2018-03-01 17:22:20

Mar 1, 2018, 5:27:44 PM
   Automatic OBD-II                2013 Audi S4 Premium Plus:notification:hard_accel @ 2018-03-01 17:27:44

Mar 1, 2018, 5:29:44 PM
   Automatic OBD-II                2013 Audi S4 Premium Plus:notification:hard_accel @ 2018-03-01 17:29:44

Mar 1, 2018, 5:32:08 PM
   Trigger                         Car Approaching Home
   Automatic OBD-II                2013 Audi S4 Premium Plus En Route; At Shoen Road, 14 mins / 5.7 miles from home, ETA 06:45 PM

Mar 1, 2018, 5:36:47 PM
   Automatic OBD-II                FYI - Exception caught getting vehicle info: 'latest_location'
   Automatic OBD-II                2018 Honda Odyssey EX-L:ignition:on @ 2018-03-01 17:36:48
   Trigger                         Van Started
   Automatic OBD-II                FYI - Exception caught getting vehicle info: 'latest_location'

Mar 1, 2018, 5:40:44 PM
   Automatic OBD-II                2013 Audi S4 Premium Plus:ignition:off @ 2018-03-01 17:40:44
   Trigger                         Car Parked

Mar 1, 2018, 5:41:51 PM
   Automatic OBD-II                FYI - Exception caught getting vehicle info: 'latest_location'
   Automatic OBD-II                2013 Audi S4 Premium Plus:trip:finished @ 2018-03-01 17:41:52

Mar 1, 2018, 5:42:38 PM
   Automatic OBD-II                FYI - Exception caught getting vehicle info: 'latest_location'

Mar 1, 2018, 5:45:55 PM
   Automatic OBD-II                FYI - Exception caught getting vehicle info: 'latest_location'
   Automatic OBD-II                2013 Audi S4 Premium Plus:ignition:on @ 2018-03-01 17:45:56
   Trigger                         Car Started

Mar 1, 2018, 5:46:41 PM
   Automatic OBD-II                FYI - Exception caught getting vehicle info: 'latest_location'

Mar 1, 2018, 5:49:56 PM
   Automatic OBD-II                FYI - Exception caught getting vehicle info: 'latest_location'

Mar 1, 2018, 5:50:25 PM
   Automatic OBD-II                2018 Honda Odyssey EX-L:notification:speeding @ 2018-03-01 17:50:25

Mar 1, 2018, 5:50:57 PM
   Automatic OBD-II                FYI - Exception caught getting vehicle info: 'latest_location'

Mar 1, 2018, 5:51:25 PM
   Automatic OBD-II                FYI - Exception caught getting vehicle info: 'latest_location'

Mar 1, 2018, 5:51:46 PM
   Automatic OBD-II                2013 Audi S4 Premium Plus:notification:hard_accel @ 2018-03-01 17:51:46
   Trigger                         Car Approaching Home
   Automatic OBD-II                2013 Audi S4 Premium Plus En Route; At Moore Road, 4 mins / 1.7 miles from home, ETA 06:55 PM

Mar 1, 2018, 5:53:01 PM
   Trigger                         Van Approaching Home
   Automatic OBD-II                2018 Honda Odyssey EX-L En Route; At Pennsylvania Turnpike, 16 mins / 11.8 miles from home, ETA 07:06 PM


As for the 'latest_location' exception, it looks like I just screwed it up (or Automatic changed their API response?). I dunno. That field doesn't even exist int he API response for vehicle. It looks like I was trying to figure out how I can get location data via the API instead of the SocketIO connection.

The plugin is only supposed to poll for API info when automaticLocationApproved hasn't been set yet. I will look into this, but it's possible that my config page isn't properly saving the value of the checkbox or something. I'll try to fix that this weekend.

As for rapamatic's problem with the geocode failed, I think that's a problem with your access to the Google API.


Can you try this URL (with your own googleMapsApiKey) and make sure you get a response?

https://maps.googleapis.com/maps/api/ge ... 66349&key={googleMapsApiKey}

Posted on
Fri Mar 02, 2018 9:14 am
rapamatic offline
Posts: 209
Joined: Aug 03, 2015
Location: Glencoe, IL

Re: Automatic OBD-II Indigo Plugin

dgarozzo wrote:

As for rapamatic's problem with the geocode failed, I think that's a problem with your access to the Google API.


Can you try this URL (with your own googleMapsApiKey) and make sure you get a response?

https://maps.googleapis.com/maps/api/ge ... 66349&key={googleMapsApiKey}


Ok, that helped me solve the issue - the problem is that I had only turned on Geolocation (which I think is using cell towers and wifi signals to triangulate location - do we need this?) and Distance Matrix. I think you may need to update the instructions on the first page of this post to say that we also need to enable the geocoding API. Turning that on seems to have fixed my issues.

Posted on
Fri Mar 02, 2018 9:59 am
DVDDave offline
Posts: 335
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Automatic OBD-II Indigo Plugin

rapamatic wrote:
dgarozzo wrote:

As for rapamatic's problem with the geocode failed, I think that's a problem with your access to the Google API.


Can you try this URL (with your own googleMapsApiKey) and make sure you get a response?

https://maps.googleapis.com/maps/api/ge ... 66349&key={googleMapsApiKey}


Ok, that helped me solve the issue - the problem is that I had only turned on Geolocation (which I think is using cell towers and wifi signals to triangulate location - do we need this?) and Distance Matrix. I think you may need to update the instructions on the first page of this post to say that we also need to enable the geocoding API. Turning that on seems to have fixed my issues.

I gave it a try and got a response when I entered a Geocoding key into the plugin configuration. When I used the Geolocation or Distance Matrix keys, I got an access denied error.

--Dave

Posted on
Fri Mar 02, 2018 10:02 am
dgarozzo offline
Posts: 118
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

I don’t know how I got lucky and got one api key for both services. If you can’t figure out how to combine access into one key, I’ll have to update the plugin to be able to accept separate keys.


Sent from my iPhone using Tapatalk

Posted on
Fri Mar 02, 2018 10:13 am
DVDDave offline
Posts: 335
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Automatic OBD-II Indigo Plugin

I just turned the ignition on and off with the Geocoding key entered. No errors! I did not actually drive yet so I don't know if I will get the latest_location errors. I'll report back later after the car is driven.

So, it looks like the Geocoding api key is the one to enter, right?

Thanks!

--Dave

Posted on
Fri Mar 02, 2018 10:14 am
rapamatic offline
Posts: 209
Joined: Aug 03, 2015
Location: Glencoe, IL

Re: Automatic OBD-II Indigo Plugin

dgarozzo wrote:
I don’t know how I got lucky and got one api key for both services. If you can’t figure out how to combine access into one key, I’ll have to update the plugin to be able to accept separate keys.


As long as the two services are turned on for your project, it shouldn't matter which API key is used, and you really only need one enabled.

Go here: https://console.developers.google.com/apis/library and make sure that geocoding and distance matrix are enabled for your project. Then you can use any of the API keys (see them here: https://console.developers.google.com/apis/credentials) for your project to access any of those APIs...

Posted on
Fri Mar 02, 2018 10:25 am
DVDDave offline
Posts: 335
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Automatic OBD-II Indigo Plugin

rapamatic wrote:
dgarozzo wrote:
I don’t know how I got lucky and got one api key for both services. If you can’t figure out how to combine access into one key, I’ll have to update the plugin to be able to accept separate keys.


As long as the two services are turned on for your project, it shouldn't matter which API key is used, and you really only need one enabled.

Go here: https://console.developers.google.com/apis/library and make sure that geocoding and distance matrix are enabled for your project. Then you can use any of the API keys (see them here: https://console.developers.google.com/apis/credentials) for your project to access any of those APIs...

Ah, maybe when I obtained the Geocoding key, it enabled that api and the URL worked and fixed the errors. I just went back and checked the test URL with the other keys and they work without error. I guess the trick is that the Geocoding key needs to be enabled no matter which key is entered into the plugin configuration. dgarozzo probably had enabled it earlier. No need for multiple keys in the configuration.

Posted on
Fri Mar 02, 2018 10:33 am
rapamatic offline
Posts: 209
Joined: Aug 03, 2015
Location: Glencoe, IL

Re: Automatic OBD-II Indigo Plugin

DVDDave wrote:
Ah, maybe when I obtained the Geocoding key, it enabled that api and the URL worked and fixed the errors. I just went back and checked the test URL with the other keys and they work without error. I guess the trick is that the Geocoding key needs to be enabled no matter which key is entered into the plugin configuration. dgarozzo probably had enabled it earlier. No need for multiple keys in the configuration.


You can also go here: https://console.developers.google.com/apis/dashboard and see which APIs your project is using - looking at this, it doesn't look like it is using the geolocation API at all, at least for me I see: 895 requests on distance matrix, 41 on geocoding, and 0 on geolocation over the past 30 days.
Attachments
Capture.JPG
Capture.JPG (77.47 KiB) Viewed 377 times

Posted on
Fri Mar 02, 2018 10:35 am
DVDDave offline
Posts: 335
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Automatic OBD-II Indigo Plugin

rapamatic wrote:
DVDDave wrote:
Ah, maybe when I obtained the Geocoding key, it enabled that api and the URL worked and fixed the errors. I just went back and checked the test URL with the other keys and they work without error. I guess the trick is that the Geocoding key needs to be enabled no matter which key is entered into the plugin configuration. dgarozzo probably had enabled it earlier. No need for multiple keys in the configuration.


You can also go here: https://console.developers.google.com/apis/dashboard and see which APIs your project is using - looking at this, it doesn't look like it is using the geolocation API at all, at least for me I see: 895 requests on distance matrix, 41 on geocoding, and 0 on geolocation over the past 30 days.

Yep, same for me.

Posted on
Fri Mar 02, 2018 10:40 am
dgarozzo offline
Posts: 118
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

My dashboard shows hits on both distance matrix and geocoding. No hits on geolocation.


Sent from my iPhone using Tapatalk

Posted on
Fri Mar 02, 2018 10:45 am
dgarozzo offline
Posts: 118
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

I will double check my directions on the required Google API access. Very sorry about that!


Sent from my iPhone using Tapatalk

Who is online

Users browsing this forum: No registered users and 1 guest