dswd / OctoPrint-PSUControl-Tapo

Adds TPLink Smart Plug support to OctoPrint-PSUControl as a sub-plugin
GNU Affero General Public License v3.0
7 stars 2 forks source link

Error_code 9999 - not working #4

Open StrangePers0n opened 1 year ago

StrangePers0n commented 1 year ago

Out of nowhere stopped working the following error shows up in the log files:

2022-08-17 07:29:39,679 - octoprint.plugins.psucontrol_tapo - ERROR - Error: {'error_code': 9999}
2022-08-17 07:29:39,679 - octoprint.plugins.psucontrol - ERROR - Error while executing callback <bound method PSUControl_Tapo.get_psu_state of <octoprint_psucontrol_tapo.PSUControl_Tapo object at 0xb250a030>>
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_psucontrol/__init__.py", line 292, in _check_psu_state
    r = callback()
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_psucontrol_tapo/__init__.py", line 90, in get_psu_state
    return self.device.get_status()
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_psucontrol_tapo/tapo.py", line 176, in get_status
    return self._get_device_info()["device_on"]
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_psucontrol_tapo/tapo.py", line 162, in _get_device_info
    return self._request("get_device_info")
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_psucontrol_tapo/tapo.py", line 72, in _request
    self._initialize()
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_psucontrol_tapo/tapo.py", line 139, in _initialize
    "key": public_key
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_psucontrol_tapo/tapo.py", line 63, in _request_raw
    raise Exception(f"Error code: {data['error_code']}")
Exception: Error code: 9999

Ofc tried to do a clean install and reconfigure the whole Tapo with new pass but alas does not work still

georgeav commented 1 year ago

I see a mention in a different project that this might be due duplicate handshakes in the same session: https://github.com/fishbigger/TapoP100/issues/62#issuecomment-1107876214

Johnnii360 commented 1 year ago

Same issue here since yesterday I installed HACS and the Tapo Extension in my Home Assistant. But I'm not integrated the 3D printer Tapo Plug just a different one.

Edit: Aaaah, there is a really fancy fix: Just do a power reset. ;)

3dprintandpaint commented 1 year ago

octoprint.plugins.psucontrol_tapo - ERROR - Error: {'error_code': 9999} octoprint.plugins.psucontrol - ERROR - Error while executing callback <bound method PSUControl_Tapo.get_psu_state of <octoprint_psucontrol_tapo.PSUControl_Tapo object at 0xb2375530>> Traceback (most recent call last):

Same issue. Was this ever resolved?

lub1q commented 1 year ago

Same issue here.

Same issue here since yesterday I installed HACS and the Tapo Extension in my Home Assistant. But I'm not integrated the 3D printer Tapo Plug just a different one.

Edit: Aaaah, there is a really fancy fix: Just do a power reset. ;)

I added DEBUG level log for the plugin and there is a problem with a handshake.

2023-06-25 14:02:54,712 - octoprint.plugins.psucontrol_tapo - DEBUG - get_psu_state
2023-06-25 14:02:54,721 - octoprint.plugins.psucontrol_tapo - DEBUG - Request raw: {'method': 'handshake', 'requestTimeMils': 1687694574721, 'terminalUUID': 'xyz', 'params': {'key': '-----BEGIN PUBLIC KEY-----abc-----END PUBLIC KEY-----'}}

In PSU Control, I am using this plugin for Switching and Sensing (polling every 15 seconds).

Finally, the only thing that worked was resetting the device, re-adding it in the Tapo app, reinstalling and configuring the device again. Not sure if all was required though.