trocotronic/weconnect

Login after token refresh times out

Opened this issue · 4 comments

signag commented

I have an issue with login after tokens have been refreshed.
This one seems to be different from #16.

From my main program, I cyclically call get_vsr from nativeAPI.py every 15 minutes.
This works fine for 5 cycles (about 1 hour) using the cached session data,
In the 6th cycle (see attached trace file starting at line 260), tokens are found to be expired and a new login is made.
However, __get_url, called from __force_login, times out after ~15 minutes with ConnectionError 'Remote end closed connection without response'

The attached trace file covers the entire test run and has the exception output included at the end.

Thanks for support
monitorVW_02.log

Try replacing line 250 of NativeAPI

            if (scope in self.__oauth and 'refresh_token' in self.__oauth[scope]):

By

            if (scope in self.__oauth and 'refresh_token' in self.__oauth['sc2:fal']):

It’s something wrong with cubic token.

signag commented

Thanks for the quick response.

I tried the suggested modification but I am running into the same issue.

Here is the modification:
image

Note that the difference in line numbers in my version is due to minor modifications which do not have any influence on functionality:

  • instantiation of extended logging (logging_plus)
  • modification of init(self) by passing credentials rather than reading these from the credentials file
  • prints removed in __get_idk(self, soup)

I have attached the new trace file.
What is different now is that tokens are expired already in the first cycle (starts at line 26), because I had started with existing weconnectAPI.access and weconnectAPI.session.
In this initial cycle, the forced login works fine.
However, in the 6th cycle (starting at line 266), the login has a timeout again.
monitorVW_07.log

Which is the current status of this issue? Still persists?

Issue still persists