Title: Out of box Tapo TC40: discovery not working, authentication failure on wifi setup · Issue #1628 · python-kasa/python-kasa · GitHub
Open Graph Title: Out of box Tapo TC40: discovery not working, authentication failure on wifi setup · Issue #1628 · python-kasa/python-kasa
X Title: Out of box Tapo TC40: discovery not working, authentication failure on wifi setup · Issue #1628 · python-kasa/python-kasa
Description: Hi! I had the misfortune to get a TP-Link Tapo TC40 IP camera, which I intend to use with Frigate through the local RTSP stream. I wanted to set it up without connecting it to the internet, and registering for any cloud service, and I re...
Open Graph Description: Hi! I had the misfortune to get a TP-Link Tapo TC40 IP camera, which I intend to use with Frigate through the local RTSP stream. I wanted to set it up without connecting it to the internet, and reg...
X Description: Hi! I had the misfortune to get a TP-Link Tapo TC40 IP camera, which I intend to use with Frigate through the local RTSP stream. I wanted to set it up without connecting it to the internet, and reg...
Opengraph URL: https://github.com/python-kasa/python-kasa/issues/1628
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Out of box Tapo TC40: discovery not working, authentication failure on wifi setup","articleBody":"Hi!\n\nI had the misfortune to get a TP-Link Tapo TC40 IP camera, which I intend to use with Frigate through the local RTSP stream.\nI wanted to set it up without connecting it to the internet, and registering for any cloud service, and I read in the Home Assistant docs ([here](https://www.home-assistant.io/integrations/tplink)) that python-kasa should work for provisioning most TP-Link devices, but something is wrong and I cant even scan for wifi networks with it. I have factory resetted it just in case, but that did not help.\n\nI have installed python-kasa 0.10.2 with pip, on python 3.12.\nIf I run the discovery command while the laptop is connected to the camera's wifi network, I get 0 results:\n```\n$ kasa discover\nDiscovering devices on 255.255.255.255 for 10 seconds\nFound 0 devices\n```\n\nSince my laptop receives the IP address 192.168.191.100 on this network, and the default gateway IP is 192.168.191.1, which I can ping, I tried to run a discovery for this IP range too, without success:\n```\n$ kasa --target 192.168.191.255 discover\nDiscovering devices on 192.168.191.255 for 10 seconds\nFound 0 devices\n```\n\nNext I though I'll continue with the next steps in [the provisioning instructions](https://python-kasa.readthedocs.io/en/latest/cli.html#provisioning), however it seems I cannot start a wifi scan with it either:\n```\n$ kasa --host 192.168.191.1 wifi scan\nDiscovering device 192.168.191.1 for 10 seconds\nRaised error: Device response did not match our challenge on ip 192.168.191.1, check that your e-mail and password (both case-sensitive) are correct. \nRun with --debug enabled to see stacktrace\nERROR:asyncio:Unclosed client session\nclient_session: \u003caiohttp.client.ClientSession object at 0x7f418d2ab5c0\u003e\n```\n\nDetailed output with `--debug`:\n```\n$ kasa --debug --host 192.168.191.1 wifi scan\nDiscovering device 192.168.191.1 for 10 seconds\nDEBUG:kasa.discover:[DISCOVERY] 192.168.191.1 \u003e\u003e {'system': {'get_sysinfo': {}}}\nDEBUG:kasa.discover:Waiting a total of 10 seconds for responses...\nDEBUG:kasa.discover:Decrypted encrypt_info for 192.168.191.1: {'connect_ssid': '',\n 'connect_type': 'wireless',\n 'device_id': 'REDACTED',\n 'http_port': 443,\n 'last_alarm_time': '0',\n 'last_alarm_type': '',\n 'owner': '',\n 'sd_status': 'offline'}\nDEBUG:kasa.device_factory:Using SmartCamDevice for SMART.IPCAMERA\nDEBUG:kasa.device_factory:Finding protocol for 192.168.191.1\nDEBUG:kasa.device_factory:Finding protocol for DeviceFamily.SmartIpCamera\nDEBUG:kasa.transports.sslaestransport:Created AES transport for 192.168.191.1\nDEBUG:kasa.discover:[DISCOVERY] 192.168.191.1 \u003c\u003c {'error_code': 0,\n 'result': {'device_id': 'REDACTED_D164F44270DB784055D1852',\n 'device_model': 'TC40',\n 'device_name': '#MASKED_NAME#',\n 'device_type': 'SMART.IPCAMERA',\n 'encrypt_info': {'data': '', 'key': '', 'sym_schm': 'AES'},\n 'encrypt_type': ['3'],\n 'factory_default': True,\n 'firmware_version': '1.0.4 Build 240902 Rel.38194n',\n 'hardware_version': '2.0',\n 'ip': '192.168.191.1',\n 'isResetWiFi': False,\n 'is_support_iot_cloud': True,\n 'mac': 'REDACTED',\n 'mgt_encrypt_schm': {'is_support_https': True},\n 'protocol_version': 1}}\nDEBUG:kasa.device:Initializing 192.168.191.1 of type \u003cclass 'kasa.smartcam.smartcamdevice.SmartCamDevice'\u003e\nDEBUG:kasa.protocols.smartprotocol:192.168.191.1 multi-request-batch-1-of-1 \u003e\u003e '{\"method\":\"multipleRequest\",\"request_time_milis\":1767154616677,\"terminal_uuid\":\"b+2BG4NWkAozOFExc2pgwA==\",\"params\":{\"requests\":[{\"method\":\"getDeviceInfo\",\"params\":{\"device_info\":{\"name\":[\"basic_info\",\"info\"]}}},{\"method\":\"getAppComponentList\",\"params\":{\"app_component\":{\"name\":\"app_component_list\"}}},{\"method\":\"getConnectionType\",\"params\":{\"network\":{\"get_connection_type\":{}}}}]}}'\nDEBUG:kasa.transports.sslaestransport:Trying default credentials to 192.168.191.1\nDEBUG:kasa.transports.sslaestransport:Sending handshake1...\nDEBUG:kasa.httpclient:Posting to https://192.168.191.1\nDEBUG:kasa.transports.sslaestransport:Device responded with status 200: {'result': {'data': {'code': -40401, 'time': 7, 'max_time': 10, 'encrypt_type': ['3'], 'key': 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKv4a/AHIEzDPyDwLsqC5onkBX+/DPC7D0d/CG/m6kNiHFpjrgqssQmndF9sXQHURBa2lCnDIC5EMNbwXrxcyvsCAwEAAQ==', 'nonce': 'CB97EC007FBA2E01', 'device_confirm': '4C8E85943619F7681B2A78FF7F68B8074237A76618958A2EFA6851B54C785F15CB97EC007FBA2E015EC70B5A8ED8041B'}}, 'error_code': -40413}\nDEBUG:kasa.transports.sslaestransport:Connected to 192.168.191.1 with default username\nDEBUG:kasa.transports.sslaestransport:Device response did not match our challenge on ip 192.168.191.1, check that your e-mail and password (both case-sensitive) are correct. \nDEBUG:kasa.protocols.smartprotocol:Unable to authenticate with 192.168.191.1, not retrying: Device response did not match our challenge on ip 192.168.191.1, check that your e-mail and password (both case-sensitive) are correct. \nRaised error: Device response did not match our challenge on ip 192.168.191.1, check that your e-mail and password (both case-sensitive) are correct. \n```\n\nI have read warnings that the offline provisioning only works if it has never been set up with a cloud account before, but as far as I know this should be a brand new device. I got it in its original box, nicely wrapped in all the wrapping material.\nI have seen #1590 and #1604 which seem to be somewhat related, could it be because it uses newer communication protocols? Though in my case `encrypt_type` is not TPAP or KLAP, but `[3]`.\n","author":{"url":"https://github.com/mpeter50","@type":"Person","name":"mpeter50"},"datePublished":"2025-12-31T05:06:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":115},"url":"https://github.com/1628/python-kasa/issues/1628"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c3556def-8060-a397-98f5-484cbbc1833a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A0DE:A2F82:11A772:17E734:69824AB3 |
| html-safe-nonce | 3f169a708dc97b1c548edc8c68cfa86dd65da7e0a06a6f73b25b8a400028c7e4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMERFOkEyRjgyOjExQTc3MjoxN0U3MzQ6Njk4MjRBQjMiLCJ2aXNpdG9yX2lkIjoiMjM2OTYyNjkyNjA1MTY0MjAzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4a014957dd87ef4ad94927dd6230c6a6532fcf2ab76a1a23072f37905a8c1f3f |
| hovercard-subject-tag | issue:3771996323 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-kasa/python-kasa/1628/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8180ec57e5e81cf826ae83f56f8b84ed81939f2a685c843d76a34b1d47d4e5ce/python-kasa/python-kasa/issues/1628 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8180ec57e5e81cf826ae83f56f8b84ed81939f2a685c843d76a34b1d47d4e5ce/python-kasa/python-kasa/issues/1628 |
| og:image:alt | Hi! I had the misfortune to get a TP-Link Tapo TC40 IP camera, which I intend to use with Frigate through the local RTSP stream. I wanted to set it up without connecting it to the internet, and reg... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mpeter50 |
| hostname | github.com |
| expected-hostname | github.com |
| None | e2ebc70d7d37443ffd1ae8f91a253417e0725a69916687ec3b823f2451fb6caa |
| turbo-cache-control | no-preview |
| go-import | github.com/python-kasa/python-kasa git https://github.com/python-kasa/python-kasa.git |
| octolytics-dimension-user_id | 57733869 |
| octolytics-dimension-user_login | python-kasa |
| octolytics-dimension-repository_id | 221571611 |
| octolytics-dimension-repository_nwo | python-kasa/python-kasa |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 221571611 |
| octolytics-dimension-repository_network_root_nwo | python-kasa/python-kasa |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6241ad74f49cf194bf94dad6a72d8792f1c2ab10 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width