Automatic OBD-II Indigo Plugin (discontinued)

Posted on
Thu Mar 01, 2018 3:08 pm
dgarozzo offline
Posts: 132
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: 276
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: 470
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: 132
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: 276
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: 470
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: 132
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: 470
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: 276
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: 470
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: 276
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 3787 times

Posted on
Fri Mar 02, 2018 10:35 am
DVDDave offline
Posts: 470
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: 132
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: 132
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

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

Re: Automatic OBD-II Indigo Plugin

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


No worries and no need to apologize. We got this figured out and the plugin is awesome!

Now that the plugin is working (and automatic seems through the backlog on approving permissions), I've started to poke around a little more. Any way that you could directly expose the JSON data under vehicle as custom device states - I'm thinking specifically of fuel level, for example, to make it easy to show that on a dashboard or use it to trigger alerts to fill up the tank....


Sent from my iPad using Tapatalk

Who is online

Users browsing this forum: No registered users and 1 guest