Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to work when run in a daemon process. #144

Open
hotear opened this issue Oct 2, 2023 · 2 comments
Open

Fails to work when run in a daemon process. #144

hotear opened this issue Oct 2, 2023 · 2 comments

Comments

@hotear
Copy link

hotear commented Oct 2, 2023

I have used teslapy to create a process than can either run in the terminal or as a daemon. When I run it in the terminal it successfully talks to the tesla API and starts/stops my car charging. If I run it as a daemon then it no longer works. I think it has something to do with stdin being closed. When running it as a daemon it keeps reporting this error: "EOF when reading a line". If instead of connecting stdin to /dev/null, I connect it to a file containing just a newline then I get this error instead: "Please supply either code or authorization_response parameters.", hence why I think it is related to stdin being closed.

@tdorssers
Copy link
Owner

The error comes from requests-oauthlib, which is problably caused by a missing token. Can the daemon access the token cache file?

@hotear
Copy link
Author

hotear commented Oct 9, 2023

Where will it look for the cache file? Perhaps if it used a fixed location (home directory of the user running the daemon for example) it might find it. I have made a temporary modification to your code locally to make the location of the cache.json file be in /tmp and now the daemon works. So it seems to be that it cannot find the cache file when running as a daemon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants