We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
Tapo changed its IP address now can't read it with Raspberry Pi
Comments
-
JohnSwift10 said:MeteredOut said:If it stopped working the very day you changed ISPs, that is the most likely root cause. I asked above - is there firewall settings in the new router that is stopping the comms?
If it is relevant the app on my phone, tablet and bluestacks app on my computer all work OK.
You computer to the Tapo will all be over the local network. 192.168.x.x. What apps run on your phone, table and bluestacks, and are they all local network executed or do they go via the cloud. Do they use the same PyP100 library?
Not wanting to sound harsh, but you're running someone elses software locally on your computer. Knowing what it does, and about firewalls, is probably a good idea.0 -
AstonSmith said:I agree with MeteredOut. The code does not handle the exception - it always assumes it can extract the encryption key from the response.So the easiest way to find out what's going on is to find out what the response is. It's probably going to be either blank/empty, or an error message, or an empty JSON structure.It might be interesting to visit the address it's trying to connect to using a web browser, i.e. http:// (the Tapo's IP here) /app to see what happens.
When I go to http://{IP]/app, I get a standard 200 OK response
OP, can you try that in your browser and see if you get the same response?0 -
Another suggestion, if you feel comfortable editing the library code (PyP110.py). Changeto
r = requests.post(URL, json=Payload) encryptedKey = r.json()["result"]["key"] self.tpLinkCipher = self.decode_handshake_key(encryptedKey) try: self.cookie = r.headers["Set-Cookie"][:-13] except: errorCode = r.json()["error_code"] errorMessage = self.errorCodes[str(errorCode)] raise Exception(f"Error Code: {errorCode}, {errorMessage}")<br>
r = requests.post(URL, json=Payload) try: <b>encryptedKey = r.json()["result"]["key"]</b> <b>self.tpLinkCipher = self.decode_handshake_key(encryptedKey)</b> self.cookie = r.headers["Set-Cookie"][:-13] except: errorCode = r.json()["error_code"] errorMessage = self.errorCodes[str(errorCode)] raise Exception(f"Error Code: {errorCode}, {errorMessage}")<br>
ie. put the line that is causing the error inside the try/except block. It might cause the true error to bubble up and be displayed to you. But, it might not.
You could also edit that file to display the response, eg,r = requests.post(URL, json=Payload) print(r.json()) encryptedKey = r.json()["result"]["key"] self.tpLinkCipher = self.decode_handshake_key(encryptedKey) try: self.cookie = r.headers["Set-Cookie"][:-13] except: errorCode = r.json()["error_code"] errorMessage = self.errorCodes[str(errorCode)] raise Exception(f"Error Code: {errorCode}, {errorMessage}")
0 -
Interesting. There could be a few different reasons for this
You don't have the right IP address (ie. you've checked it is the same as the Tapo Device Info, such as this):
Or, the device you have is no longer accepting HTTP requests. Do you have the same firmware as I have above?
Or something on your network is blocking HTTP requests, eg a firewall on your router
Is your new router on the same subnet as the previous one? eg, 192.168.0.x v 192.168.1.x0 -
MeteredOut said:AstonSmith said:I agree with MeteredOut. The code does not handle the exception - it always assumes it can extract the encryption key from the response.So the easiest way to find out what's going on is to find out what the response is. It's probably going to be either blank/empty, or an error message, or an empty JSON structure.It might be interesting to visit the address it's trying to connect to using a web browser, i.e. http:// (the Tapo's IP here) /app to see what happens.
When I go to http://{IP]/app, I get a standard 200 OK response
OP, can you try that in your browser and see if you get the same response?
0 -
JohnSwift10 said:MeteredOut said:AstonSmith said:I agree with MeteredOut. The code does not handle the exception - it always assumes it can extract the encryption key from the response.So the easiest way to find out what's going on is to find out what the response is. It's probably going to be either blank/empty, or an error message, or an empty JSON structure.It might be interesting to visit the address it's trying to connect to using a web browser, i.e. http:// (the Tapo's IP here) /app to see what happens.
When I go to http://{IP]/app, I get a standard 200 OK response
OP, can you try that in your browser and see if you get the same response?0 -
Hi MeteredOut, any chance of a copy of your PyP100.py file as that is what seems to be the problem, there are various versions of that file.0
-
Here is my device info details.0
-
I sent a response to your DM earlier - I just looked at the one on GitHub:
https://github.com/fishbigger/TapoP100/blob/main/PyP100/PyP100.py
I have the same P110 hardware/firmware version as you have above
(note, I've not tried to run the code - I just looked at it. I'll see if I can make some time to try get it running)0 -
I've just done a quick test. The TAPO is returning:
{'error_code': 1003}
It looks like a firmware security update has caused this.
See https://community.openhab.org/t/single-tapo-p100-suddenly-stopped-working-error-code-1003/149740
The Py100 pacakge owner would need to update the package, but since its not been updated in 2 years, I'm not sure that's going to happen.1
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 349.8K Banking & Borrowing
- 252.6K Reduce Debt & Boost Income
- 453K Spending & Discounts
- 242.8K Work, Benefits & Business
- 619.6K Mortgages, Homes & Bills
- 176.4K Life & Family
- 255.7K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 15.1K Coronavirus Support Boards