Code Monkey home page Code Monkey logo

Comments (3)

ianjwhite99 avatar ianjwhite99 commented on June 15, 2024

Hi @nils2410,

Try switching your region to "US". Sometimes there are issues with authenticating in different regions. Let me know if that solution works for you.

from connected-car-python-sdk.

nils2410 avatar nils2410 commented on June 15, 2024

i changed the region to US:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/connectedcar/requester.py", line 37, in call
    raise E.ResourceNotFoundException(response)
  File "/usr/local/lib/python3.7/dist-packages/connectedcar/exceptions.py", line 9, in __init__
    json = response.json()
  File "/usr/local/lib/python3.7/dist-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/dist-packages/simplejson/decoder.py", line 373, in decode
    raise JSONDecodeError("Extra data", s, end, len(s))
simplejson.errors.JSONDecodeError: Extra data: line 1 column 5 - line 2 column 1 (char 4 - 94)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "fordpass2openhab.py", line 27, in <module>
    print(vehicle.details())
  File "/usr/local/lib/python3.7/dist-packages/connectedcar/vehicle.py", line 104, in details
    '/detail?lrdt=01-01-1970%2000:00:00')
  File "/usr/local/lib/python3.7/dist-packages/connectedcar/api.py", line 68, in get
    return requester.call('GET', url, headers=headers)
  File "/usr/local/lib/python3.7/dist-packages/connectedcar/requester.py", line 51, in call
    raise E.SyncException("Unexpected error") from e
connectedcar.exceptions.SyncException: Unexpected error``

response.text returns the following error:
404 Not Found: Requested route ('user-profile-proxy-prod.uspd01.cf.ford.com') does not exist.

from connected-car-python-sdk.

budwazzer avatar budwazzer commented on June 15, 2024

Login works fine, but there is a problem in details() in vehicle.py but status() works fine.

getData.py
`import connectedcar
from datetime import datetime

client = connectedcar.AuthClient(
'9fb503e0-715b-47e8-adfd-ad4b7770f73b',
None,
None) # Create client connection
access = client.get_user_access_token(
'email', 'password') # Fetch client access token

user = connectedcar.User(access['access_token']) # New User Object
vehicles = user.vehicles() # Fetch list of user vehicles

vehicleList = [] # Stored list of user vehicles

for userVehicle in vehicles: # For each user vehicle
vehicleList.insert(0, userVehicle['VIN'])
break

def ukaz(co):
currentVehicle = connectedcar.Vehicle(
vehicleList[0], access['access_token']) # IF YOU HAVE MORE CARS, THIS USE 1st [0].
a = datetime.today()
funkce = ("currentVehicle." + co + "()")
print ("")
print ("--- {} - -->".format(co))
print(eval(funkce)) # Send command
b = datetime.today()
sekund = ((b-a).total_seconds())
print ("<--- {} - {} s".format(co,sekund))

ukaz("odometer")
ukaz("fuel")
#and so on...`

I've been stuck on this for months but finally found the time to go through the code. It's a little thing, I believe the author will fix it easily when he has time. But it still works great for me. Thank you @ianjwhite99 for great work.

from connected-car-python-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.