fishbigger / TapoP100

A module for controlling the TP-Link Tapo P100 Plugs
MIT License
566 stars 138 forks source link

Invalid Request or Credentials (-1501) when requestTimeMils set to 0 in login function (L530) #109

Open fernsehkind opened 1 year ago

fernsehkind commented 1 year ago

If I revert the requestTimeMils (as introduced in #698100d123be3387f598dea3b60398c7952c95d9) back to int(round(time.time() * 1000)) in the login function, the login and the device L530 works correctly. In other functions (color, info, state, ...) the L530 device does not seem to have any problem with the 0 value at requestTimeMils.

My P110 works correctly with requestTimeMils set to 0 and int(round(time.time() 1000)). My L530 only works correctly when requestTimeMils is set to int(round(time.time() 1000)).

P110 (3 devices): SW V1.1.6, HW: 1.0 L530 (1 device): SW V1.2.2, HW: 1.0.0

Other users (like @DaneelReventelov) seem to have the same problem. I'm not quite sure what the correct solution for this problem is because I have only a few devices with the same SW version and I'm not sure what happens to other device types and older software versions.

beatty12 commented 1 year ago

int(round(time.time() * 1000)) fixed my issues (P100). THANK YOU SO MUCH FOR POSTING THIS!

fsnuxer commented 1 year ago

same for me for my P100 SW V1.4.16 HW V1.20.0 error when requestTimeMils set to 0 ok when requestTimeMils set to int(round(time.time() * 1000))

lanpa commented 1 year ago

confirmed the fix with P105 1.3.2 Build 20210122 Rel. 57063:

git checkout a93aadea
python setup.py install