WeConnect-python icon indicating copy to clipboard operation
WeConnect-python copied to clipboard

I have a Cupra Born, and I'd love to help make this.

Open initdebugs opened this issue 4 years ago • 271 comments

Hi there! I recently picked up my Cupra Born and I'd love to make this work with my car as well. Could you tell me what I can do to help?

initdebugs avatar Dec 15 '21 07:12 initdebugs

Good new, and congratulations to your new car. I hope you love it :) First question: Is the mycupra app already working for you? If it is working the complicated part starts. I would prepare a test version for you to try out.

tillsteinbach avatar Dec 15 '21 07:12 tillsteinbach

Yes it is working! I can send you screenshots or whatever you need if you want. Would it be easier to discuss this via Discord or would you like to keep everything in Github?

initdebugs avatar Dec 15 '21 08:12 initdebugs

Just let me know what information you need :)

initdebugs avatar Dec 15 '21 10:12 initdebugs

I would prefer if we could keep the discussion here at GitHub to allow potentially others to also try it out. Also it helps a bit my working style as I can answer asynchronously :) If we have confidential parts let's use an email.

Are you a bit experienced in SW development and using python? I have a first version in a separate branch that we could use for initial testing.

tillsteinbach avatar Dec 15 '21 11:12 tillsteinbach

I have some experience in python, but I have no idea what steps I should take when trying this out. Could you explain what I should do?

initdebugs avatar Dec 15 '21 12:12 initdebugs

sure, you need to clone the project: git clone https://github.com/tillsteinbach/WeConnect-python.git and cd WeConnect-python install all requirements: pip3 install -r requirements.txt then you switch to the seat branch: git checkout feature/seat then go to the examples folder: cd examples and try out python allVehicles.py -b seat -u yourmyseatusername -p yourpassword

I guess it won't work out of the box, but we can try continuing from there with the error messages we get.

tillsteinbach avatar Dec 15 '21 13:12 tillsteinbach

Traceback (most recent call last): File "allVehicles.py", line 32, in <module> main() File "allVehicles.py", line 13, in main parser.add_argument('-b', '--brand', help='Brand if other (e.g. seat)', required=False, type=weconnect.WeConnect.Brand, AttributeError: type object 'WeConnect' has no attribute 'Brand'

initdebugs avatar Dec 15 '21 13:12 initdebugs

Can you do a python --version for me? We need at least python 3.7

tillsteinbach avatar Dec 15 '21 13:12 tillsteinbach

I'm on 3.8.8

initdebugs avatar Dec 15 '21 13:12 initdebugs

hmmmm, can you try to install it like that: pip3 install -e . and then execute the command again? might have something todo with paths

tillsteinbach avatar Dec 15 '21 13:12 tillsteinbach

image

initdebugs avatar Dec 15 '21 13:12 initdebugs

ah sorry you need to execute that in the WeConnect-python folder, not examples

tillsteinbach avatar Dec 15 '21 13:12 tillsteinbach

Initialize WeConnect

Login

update

print results

done

That's what it said in command prompt. What now?

initdebugs avatar Dec 15 '21 13:12 initdebugs

so on the positive side: you did not get an error :) on the negative side: also no data. I would need to see now what is coming back from the server. Can you add weConnect.persistCacheAsJson('test.json') right after print('# done') this should write a file with the answer from the server

tillsteinbach avatar Dec 15 '21 13:12 tillsteinbach

The file is empty :(

initdebugs avatar Dec 15 '21 13:12 initdebugs

hmmm, ok, new try: Lets use the CLI it has more logging options: git clone https://github.com/tillsteinbach/WeConnect-cli.git cd WeConnect-cli git checkout feature/seat pip3 install -e . and then: weconnect-cli -vvv -b seat -u yourmyseatusername -p yourpassword get / this should give you more output

tillsteinbach avatar Dec 15 '21 14:12 tillsteinbach

I assume the last line should be python weconnect-cli -vvv -b seat -u yourmyseatusername -p yourpassword get /

I get the error about WeConnect not having attribute 'Brand'. I tried doing the pip3 install -e . but that doesn't help

initdebugs avatar Dec 15 '21 14:12 initdebugs

no, after the pip3 install -e . the python in front should not be necessary.

tillsteinbach avatar Dec 15 '21 14:12 tillsteinbach

what does weconnect-cli --version say?

tillsteinbach avatar Dec 15 '21 14:12 tillsteinbach

Without python works, but gives the same error about the attribute 'Brand'.

weconnect-li --version gives the same error as well

initdebugs avatar Dec 15 '21 14:12 initdebugs

maybe it has overwritten the library, can you do a pip3 install -e . in the WeConnect-python folder again and then try weconnect-cli?

tillsteinbach avatar Dec 15 '21 14:12 tillsteinbach

When trying pip3 install -e . in WeConnect-python: image

initdebugs avatar Dec 15 '21 14:12 initdebugs

yes, but I think it still overwrite the package. Can you now do a weconnect-cli --version ?

tillsteinbach avatar Dec 15 '21 14:12 tillsteinbach

It still gives the attribute error

initdebugs avatar Dec 15 '21 14:12 initdebugs

grrr. Maybe try a pip3 install -e . --force

tillsteinbach avatar Dec 15 '21 14:12 tillsteinbach

weconnect-cli --version now gives: weconnect-cli develop (using WeConnect-python develop

initdebugs avatar Dec 15 '21 14:12 initdebugs

ok, that is better. now we can go back to: weconnect-cli -vvv -b seat -u yourmyseatusername -p yourpassword get /

tillsteinbach avatar Dec 15 '21 14:12 tillsteinbach

The Cache file is empty, the token file has, well, tokens.

initdebugs avatar Dec 15 '21 14:12 initdebugs

with -vvv it should also output something about the communication that is going on

tillsteinbach avatar Dec 15 '21 14:12 tillsteinbach

I'll post it, is there no sensitive data about my account in there?

initdebugs avatar Dec 15 '21 14:12 initdebugs