Automatic OBD-II Indigo Plugin (discontinued)

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

Re: Automatic OBD-II Indigo Plugin

I guess I'll have to go ahead and include the library with my plugin so people don't have this problem.

Did you try installing with pip instead of pip2.7? Just wondering if that makes a difference.


bjones wrote:
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?

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

Re: Automatic OBD-II Indigo Plugin

So, after switching to Requests, and updating some other libraries:

Code: Select all
sudo -H pip install -U requests[security]
sudo -H pip install --ignore-installed pyOpenSSL --upgrade
sudo -H pip install ndg-httpsclient


I now get the following response:

Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
This distribution is not configured to allow the HTTP request method that was used for this request. The distribution supports only cachable requests.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: amvUVe2inaVxNYTabfWb2MwcYv-MmuRJBS2mEaiTfryaUbUS4_Y0aw==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>




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 8:08 am
bjones offline
Posts: 21
Joined: Oct 22, 2017

Re: Automatic OBD-II Indigo Plugin

I did -- here's the command:
Code: Select all
sudo -H pip install -U socketIO-client --ignore-installed six
Collecting socketIO-client
  Using cached socketIO-client-0.7.2.tar.gz
Collecting six
  Using cached six-1.11.0-py2.py3-none-any.whl
Collecting requests>=2.7.0 (from socketIO-client)
  Using cached requests-2.18.4-py2.py3-none-any.whl
Collecting websocket-client (from socketIO-client)
  Using cached websocket_client-0.44.0-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests>=2.7.0->socketIO-client)
  Using cached certifi-2017.11.5-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.7.0->socketIO-client)
  Using cached chardet-3.0.4-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests>=2.7.0->socketIO-client)
  Using cached idna-2.6-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests>=2.7.0->socketIO-client)
  Using cached urllib3-1.22-py2.py3-none-any.whl
Installing collected packages: certifi, chardet, idna, urllib3, requests, six, websocket-client, socketIO-client
  Running setup.py install for socketIO-client ... done
Successfully installed certifi-2017.11.5 chardet-3.0.4 idna-2.6 requests-2.18.4 six-1.11.0 socketIO-client-0.7.2 urllib3-1.22 websocket-client-0.44.0


dgarozzo wrote:
I guess I'll have to go ahead and include the library with my plugin so people don't have this problem.

Did you try installing with pip instead of pip2.7? Just wondering if that makes a difference.


bjones wrote:
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?

Posted on
Sun Nov 26, 2017 11:11 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Automatic OBD-II Indigo Plugin

dgarozzo wrote:
So, after switching to Requests, and updating some other libraries:...

Well, that is some progress. Odd that I am able to get it to work from the command line using curl. Here is a simple shell script (odb2test.sh) I wrote for testing. Just pass the auth code as arg1 on the command line. Have you considered pycurl? Though, it really shouldn't be necessary. FYI, I ran this on MacOS 10.13.
Code: Select all
#!/bin/sh

CODE_FROM_AUTHORIZE_URL=$1
CLIENT_ID=<your client id>
CLIENT_SECRET=<your client secret>

/usr/bin/curl -v  --data "code=${CODE_FROM_AUTHORIZE_URL}&client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}&grant_type=authorization_code" https://accounts.automatic.com/oauth/access_token

echo
And, this is the result
Code: Select all
$ ./odb2test.sh <my auth code>
*   Trying 54.192.146.58...
* TCP_NODELAY set
* Connected to accounts.automatic.com (54.192.146.58) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=*.automatic.com
*  start date: May  3 00:00:00 2017 GMT
*  expire date: Jun  3 12:00:00 2018 GMT
*  subjectAltName: host "accounts.automatic.com" matched cert's "*.automatic.com"
*  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fe322009c00)
> POST /oauth/access_token HTTP/2
> Host: accounts.automatic.com
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Length: 161
> Content-Type: application/x-www-form-urlencoded
>
* We are completely uploaded and fine
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200
< content-type: application/json
< content-length: 394
< allow: POST, OPTIONS
< date: Sun, 26 Nov 2017 17:02:21 GMT
< server: nginx
< vary: Accept-Encoding
< vary: Accept-Encoding
< x-content-type-options: nosniff
< x-request-id: 724710e4-5666-4b0f-a5ca-238788ec1b3a
< x-xss-protection: 1; mode=block
< x-cache: Miss from cloudfront
< via: 1.1 3d3d633d266d05d90a4eea7a6a59b514.cloudfront.net (CloudFront)
< x-amz-cf-id: IIdpIBoHIT3ECP9fiL0wVnDLNojzofayw1iHZ4mFZ6vVQTBo0NED5Q==
<
* Connection #0 to host accounts.automatic.com left intact
{"access_token":"5097b9a94f65b430e7621dba055bb77163567c46","scope":"scope:behavior scope:location scope:offline scope:public scope:trip scope:user:profile scope:vehicle:events scope:vehicle:profile","expires_in":2541930,"refresh_token":"fdd0b49465754175548d23f3d6fcadb0d592cb28","token_type":"bearer","user":{"id":"U_462488cb9e101dc7","sid":"U_462488cb9e101dc7"},"user_id":"U_462488cb9e101dc7"}

Posted on
Sun Nov 26, 2017 11:23 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Automatic OBD-II Indigo Plugin

dgarozzo wrote:
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....

A suggestion... add 2 radio buttons to the config dialog: Waiting for Location Approval and Have Location Approval and then provide the appropriate url. This would save the user from having to modify the URL.

Also, regarding the pasting of the call-back url. Since you only use the code from the url, it really shouldn't matter what the user enters for the URL or the OAuth Redirect URL on the automatic API web page. I was a little confused by that step and, in the end, found it easier to just copy the portion of the callback-URL starting from "code=" up to the end.

Posted on
Sun Nov 26, 2017 1:18 pm
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

I had considered making the scope part more dynamic but didn't think I needed to. I have taken your suggestion and have updated my code appropriately.

As for the callback-URL, you are correct; all I need is the data after code=. My code takes whatever is entered and looks for "code=" and takes the code that follows it. I thought it was simpler for somebody to copy/paste the entire URL.

berkinet wrote:
dgarozzo wrote:
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....

A suggestion... add 2 radio buttons to the config dialog: Waiting for Location Approval and Have Location Approval and then provide the appropriate url. This would save the user from having to modify the URL.

Also, regarding the pasting of the call-back url. Since you only use the code from the url, it really shouldn't matter what the user enters for the URL or the OAuth Redirect URL on the automatic API web page. I was a little confused by that step and, in the end, found it easier to just copy the portion of the callback-URL starting from "code=" up to the end.

Posted on
Sun Nov 26, 2017 1:56 pm
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

Ok everybody. I think I got it working again. I promise this worked before! Please get the latest from GitHub.

I've moved everything to use Requests instead of httplib.HTTPSConnection. I also added a checkbox to simplify things while you wait for location information from Automatic.

I have not bundled in the libraries yet. I will try to work on that later. You may need to do the following:

Code: Select all
sudo -H pip install -U requests[security] --ignore-installed six
sudo -H pip install --ignore-installed pyOpenSSL --upgrade
sudo -H pip install ndg-httpsclient


Thanks everybody for helping me out with this!

Posted on
Sun Nov 26, 2017 2:24 pm
mlooss offline
Posts: 184
Joined: Sep 05, 2013

Re: Automatic OBD-II Indigo Plugin

Hi, I am really excited to use this plug-in, I have been using the Automatic adapter for a couple of years now, but I have not been able to get the plug-in to run?

I followed all the instruction found in this discussion but without success. I run Indigo 7.1.1 on macOS 10.2, any idea what else to check for?

Thanks

Error reported:
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

Stopping plugin "Automatic OBD-II 1.0.1" (pid 91786)
Stopped plugin "Automatic OBD-II 1.0.1"

Posted on
Sun Nov 26, 2017 2:29 pm
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

You must have multiple versions of python installed, and when you installed socketIO_client, it must have installed it in a different instance of python than the one that Indigo is using. That's all I can think of. Did you try pip2.7 instead of pip?

I'll have to work on embedding socketIO_client into my plugin to make this less problematic for everybody.


mlooss wrote:
Hi, I am really excited to use this plug-in, I have been using the Automatic adapter for a couple of years now, but I have not been able to get the plug-in to run?

I followed all the instruction found in this discussion but without success. I run Indigo 7.1.1 on macOS 10.2, any idea what else to check for?

Thanks

Error reported:
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

Stopping plugin "Automatic OBD-II 1.0.1" (pid 91786)
Stopped plugin "Automatic OBD-II 1.0.1"

Posted on
Sun Nov 26, 2017 2:30 pm
mlooss offline
Posts: 184
Joined: Sep 05, 2013

Re: Automatic OBD-II Indigo Plugin

Yes, I tried both pip first and then with pip2.7

I am running the macOS 10.12 server, does this matter?

Posted on
Sun Nov 26, 2017 2:34 pm
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

I doubt it.

mlooss wrote:
Yes, I tried both pip first and then with pip2.7

I am running the macOS 10.12 server, does this matter?

Posted on
Sun Nov 26, 2017 2:57 pm
mlooss offline
Posts: 184
Joined: Sep 05, 2013

Re: Automatic OBD-II Indigo Plugin

I just ran the pip2.7 install using this command and it was successful, but the plug-in is still not working?

$ sudo -H pip2.7 install awscli --upgrade --ignore-installed six
Collecting awscli
Downloading awscli-1.12.1-py2.py3-none-any.whl (1.2MB)
100% |████████████████████████████████| 1.2MB 550kB/s
Collecting six
Using cached six-1.11.0-py2.py3-none-any.whl
Collecting colorama<=0.3.7,>=0.2.5 (from awscli)
Downloading colorama-0.3.7-py2.py3-none-any.whl
Collecting s3transfer<0.2.0,>=0.1.9 (from awscli)
Downloading s3transfer-0.1.11-py2.py3-none-any.whl (54kB)
100% |████████████████████████████████| 61kB 8.7MB/s
Collecting docutils>=0.10 (from awscli)
Downloading docutils-0.14-py2-none-any.whl (543kB)
100% |████████████████████████████████| 552kB 1.9MB/s
Collecting rsa<=3.5.0,>=3.1.2 (from awscli)
Downloading rsa-3.4.2-py2.py3-none-any.whl (46kB)
100% |████████████████████████████████| 51kB 5.7MB/s
Collecting PyYAML<=3.12,>=3.10 (from awscli)
Downloading PyYAML-3.12.tar.gz (253kB)
100% |████████████████████████████████| 256kB 3.9MB/s
Collecting botocore==1.8.1 (from awscli)
Downloading botocore-1.8.1-py2.py3-none-any.whl (3.8MB)
100% |████████████████████████████████| 3.8MB 311kB/s
Collecting futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" (from s3transfer<0.2.0,>=0.1.9->awscli)
Downloading futures-3.1.1-py2-none-any.whl
Collecting pyasn1>=0.1.3 (from rsa<=3.5.0,>=3.1.2->awscli)
Using cached pyasn1-0.4.2-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from botocore==1.8.1->awscli)
Downloading jmespath-0.9.3-py2.py3-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.8.1->awscli)
Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
100% |████████████████████████████████| 194kB 3.4MB/s
Building wheels for collected packages: PyYAML
Running setup.py bdist_wheel for PyYAML ... done
Stored in directory: /var/root/Library/Caches/pip/wheels/2c/f7/79/13f3a12cd723892437c0cfbde1230ab4d82947ff7b3839a4fc
Successfully built PyYAML
Installing collected packages: colorama, futures, jmespath, docutils, six, python-dateutil, botocore, s3transfer, pyasn1, rsa, PyYAML, awscli
Successfully installed PyYAML-3.12 awscli-1.12.1 botocore-1.8.1 colorama-0.3.7 docutils-0.14 futures-3.1.1 jmespath-0.9.3 pyasn1-0.4.2 python-dateutil-2.6.1 rsa-3.4.2 s3transfer-0.1.11 six-1.11.0

Posted on
Sun Nov 26, 2017 3:00 pm
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

Did you mean socketIO-client instead of awscli?

Code: Select all
sudo -H pip2.7 install -U socketIO-client --ignore-installed six


mlooss wrote:
I just ran the pip2.7 install using this command and it was successful, but the plug-in is still not working?

$ sudo -H pip2.7 install awscli --upgrade --ignore-installed six
Collecting awscli
Downloading awscli-1.12.1-py2.py3-none-any.whl (1.2MB)
100% |████████████████████████████████| 1.2MB 550kB/s
Collecting six
Using cached six-1.11.0-py2.py3-none-any.whl
Collecting colorama<=0.3.7,>=0.2.5 (from awscli)
Downloading colorama-0.3.7-py2.py3-none-any.whl
Collecting s3transfer<0.2.0,>=0.1.9 (from awscli)
Downloading s3transfer-0.1.11-py2.py3-none-any.whl (54kB)
100% |████████████████████████████████| 61kB 8.7MB/s
Collecting docutils>=0.10 (from awscli)
Downloading docutils-0.14-py2-none-any.whl (543kB)
100% |████████████████████████████████| 552kB 1.9MB/s
Collecting rsa<=3.5.0,>=3.1.2 (from awscli)
Downloading rsa-3.4.2-py2.py3-none-any.whl (46kB)
100% |████████████████████████████████| 51kB 5.7MB/s
Collecting PyYAML<=3.12,>=3.10 (from awscli)
Downloading PyYAML-3.12.tar.gz (253kB)
100% |████████████████████████████████| 256kB 3.9MB/s
Collecting botocore==1.8.1 (from awscli)
Downloading botocore-1.8.1-py2.py3-none-any.whl (3.8MB)
100% |████████████████████████████████| 3.8MB 311kB/s
Collecting futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" (from s3transfer<0.2.0,>=0.1.9->awscli)
Downloading futures-3.1.1-py2-none-any.whl
Collecting pyasn1>=0.1.3 (from rsa<=3.5.0,>=3.1.2->awscli)
Using cached pyasn1-0.4.2-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from botocore==1.8.1->awscli)
Downloading jmespath-0.9.3-py2.py3-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.8.1->awscli)
Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
100% |████████████████████████████████| 194kB 3.4MB/s
Building wheels for collected packages: PyYAML
Running setup.py bdist_wheel for PyYAML ... done
Stored in directory: /var/root/Library/Caches/pip/wheels/2c/f7/79/13f3a12cd723892437c0cfbde1230ab4d82947ff7b3839a4fc
Successfully built PyYAML
Installing collected packages: colorama, futures, jmespath, docutils, six, python-dateutil, botocore, s3transfer, pyasn1, rsa, PyYAML, awscli
Successfully installed PyYAML-3.12 awscli-1.12.1 botocore-1.8.1 colorama-0.3.7 docutils-0.14 futures-3.1.1 jmespath-0.9.3 pyasn1-0.4.2 python-dateutil-2.6.1 rsa-3.4.2 s3transfer-0.1.11 six-1.11.0

Posted on
Sun Nov 26, 2017 3:06 pm
mlooss offline
Posts: 184
Joined: Sep 05, 2013

Re: Automatic OBD-II Indigo Plugin

Code: Select all
 sudo -H pip2.7 install awscli --upgrade --ignore-installed six

No, I found the above command at https://github.com/pypa/pip/issues/3165 for macOS 10.13.1 and figured it may also apply to macOS 10.12.

But i did run the other command before, with this output:

$ sudo -H pip2.7 install -U requests[security] --ignore-installed six
Password:
Collecting requests[security]
Using cached requests-2.18.4-py2.py3-none-any.whl
Collecting six
Using cached six-1.11.0-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests[security])
Using cached certifi-2017.11.5-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests[security])
Using cached chardet-3.0.4-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests[security])
Using cached idna-2.6-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests[security])
Using cached urllib3-1.22-py2.py3-none-any.whl
Collecting cryptography>=1.3.4; extra == "security" (from requests[security])
Using cached cryptography-2.1.3-cp27-cp27m-macosx_10_6_intel.whl
Collecting pyOpenSSL>=0.14; extra == "security" (from requests[security])
Using cached pyOpenSSL-17.4.0-py2.py3-none-any.whl
Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography>=1.3.4; extra == "security"->requests[security])
Using cached cffi-1.11.2-cp27-cp27m-macosx_10_6_intel.whl
Collecting enum34; python_version < "3" (from cryptography>=1.3.4; extra == "security"->requests[security])
Using cached enum34-1.1.6-py2-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography>=1.3.4; extra == "security"->requests[security])
Using cached asn1crypto-0.23.0-py2.py3-none-any.whl
Collecting ipaddress; python_version < "3" (from cryptography>=1.3.4; extra == "security"->requests[security])
Using cached ipaddress-1.0.18-py2-none-any.whl
Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=1.3.4; extra == "security"->requests[security])
Installing collected packages: certifi, chardet, idna, urllib3, six, pycparser, cffi, enum34, asn1crypto, ipaddress, cryptography, pyOpenSSL, requests
Successfully installed asn1crypto-0.23.0 certifi-2017.11.5 cffi-1.11.2 chardet-3.0.4 cryptography-2.1.3 enum34-1.1.6 idna-2.6 ipaddress-1.0.18 pyOpenSSL-17.4.0 pycparser-2.18 requests-2.18.4 six-1.11.0 urllib3-1.22
mac-mini-home-server:~ serveradmin$ sudo -H pip2.7 install --ignore-installed pyOpenSSL --upgrade
Collecting pyOpenSSL
Using cached pyOpenSSL-17.4.0-py2.py3-none-any.whl
Collecting cryptography>=1.9 (from pyOpenSSL)
Using cached cryptography-2.1.3-cp27-cp27m-macosx_10_6_intel.whl
Collecting six>=1.5.2 (from pyOpenSSL)
Using cached six-1.11.0-py2.py3-none-any.whl
Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography>=1.9->pyOpenSSL)
Using cached cffi-1.11.2-cp27-cp27m-macosx_10_6_intel.whl
Collecting enum34; python_version < "3" (from cryptography>=1.9->pyOpenSSL)
Using cached enum34-1.1.6-py2-none-any.whl
Collecting idna>=2.1 (from cryptography>=1.9->pyOpenSSL)
Using cached idna-2.6-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography>=1.9->pyOpenSSL)
Using cached asn1crypto-0.23.0-py2.py3-none-any.whl
Collecting ipaddress; python_version < "3" (from cryptography>=1.9->pyOpenSSL)
Using cached ipaddress-1.0.18-py2-none-any.whl
Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=1.9->pyOpenSSL)
Installing collected packages: six, pycparser, cffi, enum34, idna, asn1crypto, ipaddress, cryptography, pyOpenSSL
Successfully installed asn1crypto-0.23.0 cffi-1.11.2 cryptography-2.1.3 enum34-1.1.6 idna-2.6 ipaddress-1.0.18 pyOpenSSL-17.4.0 pycparser-2.18 six-1.11.0
mac-mini-home-server:~ serveradmin$ sudo -H pip2.7 install ndg-httpsclient
Requirement already satisfied: ndg-httpsclient in /usr/local/lib/python2.7/site-packages
Requirement already satisfied: PyOpenSSL in /usr/local/lib/python2.7/site-packages (from ndg-httpsclient)
Requirement already satisfied: pyasn1>=0.1.1 in /usr/local/lib/python2.7/site-packages (from ndg-httpsclient)
Requirement already satisfied: cryptography>=1.9 in /usr/local/lib/python2.7/site-packages (from PyOpenSSL->ndg-httpsclient)
Requirement already satisfied: six>=1.5.2 in /usr/local/lib/python2.7/site-packages (from PyOpenSSL->ndg-httpsclient)
Requirement already satisfied: cffi>=1.7; platform_python_implementation != "PyPy" in /usr/local/lib/python2.7/site-packages (from cryptography>=1.9->PyOpenSSL->ndg-httpsclient)
Requirement already satisfied: enum34; python_version < "3" in /usr/local/lib/python2.7/site-packages (from cryptography>=1.9->PyOpenSSL->ndg-httpsclient)
Requirement already satisfied: idna>=2.1 in /usr/local/lib/python2.7/site-packages (from cryptography>=1.9->PyOpenSSL->ndg-httpsclient)
Requirement already satisfied: asn1crypto>=0.21.0 in /usr/local/lib/python2.7/site-packages (from cryptography>=1.9->PyOpenSSL->ndg-httpsclient)
Requirement already satisfied: ipaddress; python_version < "3" in /usr/local/lib/python2.7/site-packages (from cryptography>=1.9->PyOpenSSL->ndg-httpsclient)
Requirement already satisfied: pycparser in /usr/local/lib/python2.7/site-packages (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=1.9->PyOpenSSL->ndg-httpsclient)

Posted on
Sun Nov 26, 2017 3:26 pm
dgarozzo offline
Posts: 132
Joined: Jan 08, 2009

Re: Automatic OBD-II Indigo Plugin

I'm trying to embed socketIO_client, but I'm having problems. Did you copy the socketIO_client folder from GitHub, or from your Library/Python directory? Or is there some way to run the installer and have it put it directly in my plugin folder?


berkinet wrote:
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.

Page 4 of 11 1, 2, 3, 4, 5, 6, 7 ... 11

Who is online

Users browsing this forum: No registered users and 0 guests