WebThingsIO / tapo-adapter

TP-Link Tapo smart plug adapter for WebThings Gateway
Mozilla Public License 2.0
4 stars 2 forks source link

_RSAobj object has no 'export_key' #1

Open dickydoouk opened 3 years ago

dickydoouk commented 3 years ago

Tried adding my TP-Link Tapo lights using stock raspberry pi WebThings image and latest tapo-adapter.

Brief search on google reveals it maybe an issue with the PyP100 library particularly the function used to export the public RSA Key

Log details below

2021-01-28 22:21:47.290 INFO   : Fetching add-on https://github.com/WebThingsIO/tapo-adapter/releases/download/v0.0.1/tapo-adapter-0.0.1-linux-arm-v3.7.tgz as /tmp/cLFylT/tapo-adapter.tar.gz
2021-01-28 22:21:50.497 INFO   : Expanding add-on /tmp/cLFylT/tapo-adapter.tar.gz
2021-01-28 22:22:17.673 INFO   : Loading add-on: tapo-adapter
2021-01-28 22:22:36.746 INFO   : Unloading TapoAdapter
2021-01-28 22:22:38.460 INFO   : tapo-adapter: Failed to connect to 192.168.0.59: _RSAobj object has no 'export_key' attribute
2021-01-28 22:22:38.463 INFO   : tapo-adapter: Failed to connect to 192.168.0.60: _RSAobj object has no 'export_key' attribute
2021-01-28 22:22:38.465 INFO   : tapo-adapter: Failed to connect to 192.168.0.61: _RSAobj object has no 'export_key' attribute
2021-01-28 22:22:38.468 INFO   : tapo-adapter: Failed to connect to 192.168.0.62: _RSAobj object has no 'export_key' attribute

In the meantime I have had a play creating my own Typescript based library https://github.com/dickydoouk/tp-link-tapo-connect which also has discovery. As you may have guessed I'm not a Python guy (Yet).

mrstegeman commented 3 years ago

Linking to the issue you opened: https://github.com/fishbigger/TapoP100/issues/8

mrstegeman commented 3 years ago

If we don't see any action on the issue within a couple weeks, I wouldn't mind moving over to your library. I know Home Assistant uses the Python library, so I'd imagine somebody will pick it up.

robertcasanova commented 3 years ago

FYI you can temporarily fix this using a password of length 8. Related issue here: https://github.com/fishbigger/TapoP100/issues/1

shadow00 commented 3 years ago

It seems the error was just related to an incorrect usage of the library (perhaps because the function name changed after some update?). You can find my fix here: https://github.com/fishbigger/TapoP100/pull/20

dickydoouk commented 2 years ago

I've still been unable to get this adapter to work correctly. I have in the meantime successfully created this alternative adapter https://github.com/dickydoouk/tapo-adapter-ts which utilises https://github.com/dickydoouk/tp-link-tapo-connect as a pure typescript implementation (Sorry I don't know python).