Automatic OBD-II Indigo Plugin (discontinued)

Posted on
Sat Nov 25, 2017 4:37 pm
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

If you don’t have the upgraded access, you will need to modify the URL that you are directed to. That is, the URL that takes you to Automatic and prompts you to log in. You need to remove one of the parameters. (See the directions I posted). After you submit that URL, log on to your Automatic account. It will then redirect you to localhost something. Copy that entire URL and paste it into the config page.

When I get home, I’ll try to make it more clear. Sorry.

DVDDave wrote:
OK, I tried to move on with the temporary approval while waiting for my scope authorization. When I enter the URL, I get an error that "there was a problem getting my access token." When asked to log into my localhost redirect URL, I'm not sure what account I'm logging into. My Indigo web server, Automatic account or what? Could you elaborate please? Thanks.

--Dave

Posted on
Sat Nov 25, 2017 4:58 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Automatic OBD-II Indigo Plugin

dgarozzo wrote:
...This plugin has a dependency on socketIO-client. One way to install this is to bring up a Terminal, and type:....

Did you know you can just include the necessary modules in the plugin bundle? You need to create a folder in the Server Plugin folder. You can call it whatever you want, something like Modules is clear. Then, place all the needed modules in that folder. You will also need two create __init__.py
That will contain a list of sub-folders. For example:
Code: Select all
__all__ = ["socketIO_client", "certifi", "chardet", "idna", "requests", "urllib3", "websocket"]
When you do an import, you can just prefix the path with Modules.., For example, instead of
Code: Select all
from socketIO_client import SocketIO
use
Code: Select all
from Modules.socketIO_client import SocketIO
For the Automatic OBD-II plugin you will need to make one additional change in Modules.SocketIO_client.transports.py. Change line 20 to read
Code: Select all
from Modules.websocket import
Following the above steps I was able to load the plugin. I have not actually tried to get it connected yet, so there may need to be other minor path changes. But, you get the idea.
Last edited by berkinet on Sat Nov 25, 2017 8:23 pm, edited 1 time in total.

Posted on
Sat Nov 25, 2017 5:52 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Automatic OBD-II Indigo Plugin

A few issues. The first one may be related to the fact I placed the libs in the plugin...
After receiving the callback url, and entering it in the appropriate field, I get the following error in the log:
Code: Select all
 
Automatic OBD-II                client_secret=XXX&code=XXX&client_id=XXX&grant_type=authorization_code
   Automatic OBD-II                FYI - Exception caught _requestAccessToken: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)
   Automatic OBD-II                FYI - Exception caught saving access token: No JSON object could be decoded
   Automatic OBD-II                unable to save access_token
The instructions say to click the question mark. But, the only question mark I see in on the plugin config dialog, and it takes me to this forum topic. I do not see a ? on the Automatic web page

While signing up for the Google APIs I received separate keys for the Distance Matrix and Geolocation APIs. Which one should I use as the Google API Key in the config dialog? BTW, I used the same ID for both APIs.

BTW. I know interfacing with Automatic is a complex process and really appreciate the work you are putting in on this plugin.

Posted on
Sat Nov 25, 2017 6:11 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Automatic OBD-II Indigo Plugin

dgarozzo wrote:
If you don’t have the upgraded access, you will need to modify the URL that you are directed to. That is, the URL that takes you to Automatic and prompts you to log in. You need to remove one of the parameters. (See the directions I posted). After you submit that URL, log on to your Automatic account. It will then redirect you to localhost something. Copy that entire URL and paste it into the config page.

When I get home, I’ll try to make it more clear. Sorry.

DVDDave wrote:
OK, I tried to move on with the temporary approval while waiting for my scope authorization. When I enter the URL, I get an error that "there was a problem getting my access token." When asked to log into my localhost redirect URL, I'm not sure what account I'm logging into. My Indigo web server, Automatic account or what? Could you elaborate please? Thanks.

--Dave

Yes, I removed the parameter as instructed and that worked. However, when asked to log in on the next screen, I wasn't sure what I was logging into and what credentials to enter.

Posted on
Sat Nov 25, 2017 8:05 pm
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

On the Automatic site, you should log in to your Automatic account. This is not the account that you created for API access, but rather the account that you log in to for using your smartphone app for Automatic. Does that make sense?

DVDDave wrote:
dgarozzo wrote:
If you don’t have the upgraded access, you will need to modify the URL that you are directed to. That is, the URL that takes you to Automatic and prompts you to log in. You need to remove one of the parameters. (See the directions I posted). After you submit that URL, log on to your Automatic account. It will then redirect you to localhost something. Copy that entire URL and paste it into the config page.

When I get home, I’ll try to make it more clear. Sorry.

DVDDave wrote:
OK, I tried to move on with the temporary approval while waiting for my scope authorization. When I enter the URL, I get an error that "there was a problem getting my access token." When asked to log into my localhost redirect URL, I'm not sure what account I'm logging into. My Indigo web server, Automatic account or what? Could you elaborate please? Thanks.

--Dave

Yes, I removed the parameter as instructed and that worked. However, when asked to log in on the next screen, I wasn't sure what I was logging into and what credentials to enter.

Posted on
Sat Nov 25, 2017 8:08 pm
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

Crap. I thought I got rid of the question mark text. Ignore that.

That’s weird that you got two separate API keys for Google. When I signed up for them, they both were the same key.

berkinet wrote:
A few issues. The first one may be related to the fact I placed the libs in the plugin...
After receiving the callback url, and entering it in the appropriate field, I get the following error in the log:
Code: Select all
 
Automatic OBD-II                client_secret=XXX&code=XXX&client_id=XXX&grant_type=authorization_code
   Automatic OBD-II                FYI - Exception caught _requestAccessToken: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)
   Automatic OBD-II                FYI - Exception caught saving access token: No JSON object could be decoded
   Automatic OBD-II                unable to save access_token
The instructions say to click the question mark. But, the only question mark I see in on the plugin config dialog, and it takes me to this forum topic. I do not see a ? on the Automatic web page

While signing up for the Google APIs I received separate keys for the Distance Matrix and Geolocation APIs. Which one should I use as the Google API Key in the config dialog? BTW, I used the same ID for both APIs.

BTW. I know interfacing with Automatic is a complex process and really appreciate the work you are putting in on this plugin.

Posted on
Sat Nov 25, 2017 8:20 pm
DVDDave offline
Posts: 470
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Automatic OBD-II Indigo Plugin

dgarozzo wrote:
On the Automatic site, you should log in to your Automatic account. This is not the account that you created for API access, but rather the account that you log in to for using your smartphone app for Automatic. Does that make sense?

I was confused since it doesn't ask me to log in but rather just authorize access. The localhost url then comes back which brings up a dialog asking me to log into localhost, which I thought was the login you were talking about. When I copy that URL into the config box, I get the error message in the dialog and and the same type of entries in the log that berkinet mentioned.

Posted on
Sat Nov 25, 2017 11:12 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Automatic OBD-II Indigo Plugin

berkinet wrote:
...I get the following error in the log:

    Automatic OBD-II client_secret=XXX&code=XXX&client_id=XXX&grant_type=authorization_code
    Automatic OBD-II FYI - Exception caught _requestAccessToken: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)
    Automatic OBD-II FYI - Exception caught saving access token: No JSON object could be decoded
    Automatic OBD-II unable to save access_token
....
I have repeated this process and verified the data in the first line of the log output is correct. I can use that same information in a curl call and get an auth token. So, it looks like the problem is in httplib.HTTPSConnection. Have you considered switching to requests? It is really easy to use and solves almost all http related connection problems. You could also bundle it into the plugin to avoid the users having to install it.

Posted on
Sun Nov 26, 2017 5:19 am
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

The localhost dialog prompt is probably because you have a webserver running locally that requires you to log in. You can ignore that. If you want, in your Automatic API config screen, you can change the redirect URL to anything else. Maybe make it go to localhost:2468 or something that you don't have running locally?

DVDDave wrote:
dgarozzo wrote:
On the Automatic site, you should log in to your Automatic account. This is not the account that you created for API access, but rather the account that you log in to for using your smartphone app for Automatic. Does that make sense?

I was confused since it doesn't ask me to log in but rather just authorize access. The localhost url then comes back which brings up a dialog asking me to log into localhost, which I thought was the login you were talking about. When I copy that URL into the config box, I get the error message in the dialog and and the same type of entries in the log that berkinet mentioned.

Posted on
Sun Nov 26, 2017 5:40 am
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

Ugh. I'm sorry. I was using Requests before, and then when trying to fix something, I thought Requests was the problem, and switched it out.

I'm able to reproduce this problem and will fix it now. I must have not re-tested this after I took out Requests, and it worked fine because I didn't need to get a new auth token.

Standby.


berkinet wrote:
berkinet wrote:
...I get the following error in the log:

    Automatic OBD-II client_secret=XXX&code=XXX&client_id=XXX&grant_type=authorization_code
    Automatic OBD-II FYI - Exception caught _requestAccessToken: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)
    Automatic OBD-II FYI - Exception caught saving access token: No JSON object could be decoded
    Automatic OBD-II unable to save access_token
....
I have repeated this process and verified the data in the first line of the log output is correct. I can use that same information in a curl call and get an auth token. So, it looks like the problem is in httplib.HTTPSConnection. Have you considered switching to requests? It is really easy to use and solves almost all http related connection problems. You could also bundle it into the plugin to avoid the users having to install it.

Posted on
Sun Nov 26, 2017 6:21 am
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

Ok, so I misspoke. I was using Requests before for other parts of the app (communication with Google APIs), but not this part. Nonetheless, I converted the auth token part to Requests, and I still get the same SSLV3 error, which makes me think that something changed on Automatic's side. I'll keep digging.

Posted on
Sun Nov 26, 2017 7:06 am
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

I'm fairly certain something changed on Automatic's side to change the cypher negotiation. I'm trying to figure out what I need to update in python in order to be able to properly negotiate with them now, but I'm not having much luck.

Code: Select all
Davids-MBP:~ david$ curl -v -I https://accounts.automatic.com
* Rebuilt URL to: https://accounts.automatic.com/
*   Trying 52.84.125.131...
* TCP_NODELAY set
* Connected to accounts.automatic.com (52.84.125.131) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256

Posted on
Sun Nov 26, 2017 7:23 am
eme jota ce offline
Posts: 618
Joined: Jul 09, 2009
Location: SW Florida

Re: Automatic OBD-II Indigo Plugin

ottoppp wrote:
The six package installation is a known problem with pip on macOS and is due to System Integrity Protection. You can work around it using this command:

sudo -H pip install -U socketIO-client --ignore-installed six

Reference:

https://github.com/pypa/pip/issues/3165


Thanks ottoppp! That fixed my socketIO-client installation problem, too.

Still awaiting Automatic to provide proper authorization, but "Configure" now appears in the Plugin.

Code: Select all
Automatic Site:
Unauthorized request
null does not have valid scopes
This app is trying to request information from you that Automatic has not given it permission for.
What to do
Contact the owner of this app to report this issue.
Need help?

Posted on
Sun Nov 26, 2017 7:31 am
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

Correct. You can try doing this while you wait for your approval to come through.

IMPORTANT NOTE: If you haven't yet received approval for access to current_location, the web page that you will be sent to will request too much access. While you are waiting for that approval, you can first modify the url to remove "scope:current_location" from it, then go to that new url, and log in there. You will need to re-do this when you do finally get the approval for current_location.


eme jota ce wrote:
Still awaiting Automatic to provide proper authorization, but "Configure" now appears in the Plugin.

Code: Select all
Automatic Site:
Unauthorized request
null does not have valid scopes
This app is trying to request information from you that Automatic has not given it permission for.
What to do
Contact the owner of this app to report this issue.
Need help?

Posted on
Sun Nov 26, 2017 7:59 am
bjones offline
Posts: 21
Joined: Oct 22, 2017

Re: Automatic OBD-II Indigo Plugin

Thanks for creating this plugin! I've successfully run the following in terminal:
Code: Select all
sudo -H pip2.7 install -U socketIO-client --ignore-installed six

However, I am still getting the following when I start the plugin:
Code: Select all
   Automatic OBD-II Error          Error in plugin execution InitializeMain:
Traceback (most recent call last):
  File "plugin.py", line 55, in <module>
ImportError: No module named socketIO_client

I am running python 2.7.14
I did a few reboots, but nothing seems to change the result. Any ideas?

Who is online

Users browsing this forum: No registered users and 3 guests