Xee integration

The URL is not shown in my server, so I tried from my laptop. I need to install paho-mqtt before in addition to the README Python libraries to execute xee2mqtt.py. After that, I get the URL (/authorize) but I get an error:
The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed

https://api.xee.com/v4/oauth/authorize?response_type=code&client_id={{client_id}}&redirect_uri=https%3A%2F%2Flocalhost%2F&scope=vehicles.read+vehicles.signals.read+vehicles.locations.read+vehicles.events.read+vehicles.accelerometers.read+vehicles.devices-data.read+account.read+vehicles.management&state=z1F1SgbH5rp0ApgkJPjlWtbZcvCRl1
That URL has more query parameters than the /authorized URL that worked for me:

https://api.xee.com/v4/oauth/authorize?response_type=code&client_id={{client_id}}&scope=vehicles.read+vehicles.signals.read+vehicles.locations.read

from this tutorial.

What can be wrong in my config or the script xee2mqtt.py?

Very strange… Couldn’t you ssh to it?
If you run the code on another machine you will have to save the token file and upload it to your server.
When do you get there error? After entering auth return code it’s that? Have you update your apps permission to authorize new scope needed? Did you apply all things in the README?

I do not understand the first part how is it possible to not have the link display on your server, that’s very strange. It’s pure python (a simple print function).

Yes, I enter by ssh to it. But the script first execution doesn’t work for me even in my laptop. Can you provide an example of json file where the script save the config? I already have an access and refresh token that I got previously.

I have added the scopes missing in my app client:
Screenshot_20200615_231113

Please enter your authorization_code:  <I paste the code here>
Traceback (most recent call last):
  File "xee2mqtt.py", line 47, in <module>
    with open(xee_config_file, 'rb') as xee_token_file:
FileNotFoundError: [Errno 2] No such file or directory: 'xee.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "xee2mqtt.py", line 64, in <module>
    token, error = xee.get_token_from_code(authorization_code)
....

oauthlib.oauth2.rfc6749.errors.InvalidGrantError: (invalid_grant) The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.

Hi that’s crappy…
It should work everywhere laptop or others.

Could you create an empty json file to see if it change something?

Mine won’t help. Value are not human readable.

I’ll have a look tomorrow on a clean machine to see if I can reproduce this and find the error.

Hum i’ve got this only when user as no write access to the path where it’ saved.
could you create it by hand to be sure?

Hi,

yes, I can create the xee.json file in the same path. I’m sure is not a permission issue. I have run your xee2mqtt.py script in a debugger (Visual Studio Code). The issue for me is the line:
token, error = xee.get_token_from_code(authorization_code).

I can’t reproduce at all.
Did you install my version of xee python sdk?

Isant to help but do not understand at all what’s wrong

Bonjour’ je suis tout nx sur ha et je n’arrive pas à installer python. J’utilise un ha avec une image et son os sous odroid. L’orque j’essaye d’installer python il ne reconnaît pas la cde?
Avez vous des pistes d’aides à m’indiquer?

Did you still receive data or no more like me?

The Xee platform is dead, for Spanish users at least.

Same for french and found this morning that the API server did no more respond.

Need to find an other way to monitor cars now.