TapoP100 icon indicating copy to clipboard operation
TapoP100 copied to clipboard

Failed to initialize protocol AuthProtocol

Open OreoOba opened this issue 2 years ago • 2 comments

Thanks for solving the problem Just a small add to your comments Be carefull if you combine devices with the old protocol and the new one.

  1. Add the preferred_protocol="old" at the inital statement of each old device
  2. Don't delete the p100.handshake() and p100.login() for the devices that keep the old protocol

OreoOba avatar Nov 26 '23 16:11 OreoOba

Hello,

  1. Yes you need to add preferred_protocol="old" for all old devices individually
  2. You should not need handshake() or login() , even for old devices. Please share the error if you still have an issue without it.

almottier avatar Dec 13 '23 19:12 almottier

I still get this error even though I add the "old" argument. MY code:

from PyP100 import PyP110 p110 = PyP110.P110("192.168.1.84", "xxx", "yyy",preferred_protocol="old" ) p110.getEnergyUsage()

Error:

Error: {'error_code': 1003} Failed to initialize protocol OldProtocol Traceback (most recent call last): File "c:\Users\34652\Documents\Python\Domótica\PyP100\PyP100.py", line 32, in _initialize protocol.Initialize() File "c:\Users\34652\Documents\Python\Domótica\PyP100\auth_protocol.py", line 244, in Initialize result = self._request_raw("handshake", {"key": public_key}) File "c:\Users\34652\Documents\Python\Domótica\PyP100\auth_protocol.py", line 173, in _request_raw raise Exception(f"Error code: {data['error_code']}") Exception: Error code: 1003 Traceback (most recent call last): File "c:\Users\34652\Documents\Python\Domótica\prueba.py", line 4, in p110.getEnergyUsage() File "c:\Users\34652\Documents\Python\Domótica\PyP100\PyP100.py", line 106, in getEnergyUsage return self.request("get_energy_usage") File "c:\Users\34652\Documents\Python\Domótica\PyP100\PyP100.py", line 43, in request self._initialize() File "c:\Users\34652\Documents\Python\Domótica\PyP100\PyP100.py", line 39, in _initialize raise Exception("Failed to initialize protocol") Exception: Failed to initialize protocol

raucal avatar Dec 20 '23 19:12 raucal