Closed Sonnenwerk closed 4 years ago
It's not finding a response from the plug for some reason. Can you upload your plugin_tplinksmartplug_debug.log
file form the logging section of OctoPrint please?
I notice you mentioned most current firmware as well. A recent HS103 plug user reported an issue withe most current version of its firmware in #163 that may be related.
Hmm..yesterday the powersupply went defect, i ordered a new one. So curently i can not verify.
This works fine for me however I'm in UK on firmware 1.0.3 with no update available?
[2020-06-20 17:50:11,396] DEBUG: {'emeter': {'err_code': True}, 'system': {'get_sysinfo': {'relay_state': 3}}} [2020-06-20 17:50:11,519] DEBUG: ImmutableMultiDict([('checkStatus', u'192.168.2.115')]) [2020-06-20 17:50:11,520] DEBUG: Checking status of 192.168.2.115. [2020-06-20 17:50:11,521] DEBUG: {'system': {'get_sysinfo': {}}} [2020-06-20 17:50:11,522] DEBUG: IP 192.168.2.115 is valid. [2020-06-20 17:50:11,522] DEBUG: Sending command {'system': {'get_sysinfo': {}}} to 192.168.2.115 [2020-06-20 17:50:14,506] DEBUG: Could not connect to 192.168.2.115. [2020-06-20 17:50:14,507] DEBUG: [2020-06-20 17:50:14,508] DEBUG: {'emeter': {'err_code': True}, 'system': {'get_sysinfo': {'relay_state': 3}}} [2020-06-20 17:50:14,590] DEBUG: ImmutableMultiDict([('checkStatus', u'192.168.2.115')]) [2020-06-20 17:50:14,592] DEBUG: Checking status of 192.168.2.115. [2020-06-20 17:50:14,592] DEBUG: {'system': {'get_sysinfo': {}}} [2020-06-20 17:50:14,593] DEBUG: IP 192.168.2.115 is valid. [2020-06-20 17:50:14,594] DEBUG: Sending command {'system': {'get_sysinfo': {}}} to 192.168.2.115 [2020-06-20 17:50:17,626] DEBUG: Could not connect to 192.168.2.115. [2020-06-20 17:50:17,627] DEBUG: [2020-06-20 17:50:17,628] DEBUG: {'emeter': {'err_code': True}, 'system': {'get_sysinfo': {'relay_state': 3}}} [2020-06-20 17:50:25,311] DEBUG: Checking status of 192.168.2.115. [2020-06-20 17:50:25,312] DEBUG: {'system': {'get_sysinfo': {}}} [2020-06-20 17:50:25,313] DEBUG: IP 192.168.2.115 is valid. [2020-06-20 17:50:25,314] DEBUG: Sending command {'system': {'get_sysinfo': {}}} to 192.168.2.115 [2020-06-20 17:50:28,426] DEBUG: Could not connect to 192.168.2.115. [2020-06-20 17:50:28,427] DEBUG: [2020-06-20 17:50:28,428] DEBUG: {'emeter': {'err_code': True}, 'system': {'get_sysinfo': {'relay_state': 3}}}
If i use the Kasa App i can switch on / off in the same network.
So you might be impacted by a recent firmware update. I have received reports that TPLink may have broken communication, which there is nothing I can do about until someone else figures out a way to reverse engineer the communication again. For example, my working HS100 is a HW version 1.0, Firmware version 1.2.5 and I'm still able to control my device. All my plugs are in Local Only mode though, so not sure if that has an impact on your use case or not. You could try turning off Remote Control in the Device Settings (Kasa app) and then unplug the unit from the wall and plug it back in to see if that makes a difference.
There have been reports from other users in the forum and on discord that performing a factory reset on their plug was able to get it working again, but I'm not going to guarantee that it fixes it for you.
FYI, I just set up 2 HS100 devices, Hardware v 2.0, Firmware v 1.5.6, both work fine.
Hi, i did a factory reset today. Problem stays. I also contacted support and referenced to this bugfiling. Maybe they will read it. cu
I doubt they will care what people are doing outside of their own app. Especially since it was their protocol that was reverse engineered and technically could be considered a security risk.
This issue has been automatically marked as stale because it has not had activity in 14 days. It will be closed if no further activity occurs in 7 days.
I am seeing the exact same behaviour. I use a HS110 HW Version 4.0 and FW Versuib 1.0.4
Damn. I just bought it for this purpose.
@PhriZ if you enable debug logging and restart octoprint and then try to toggle/check status does the plugin_tplinksmartplug_debug.log file indicate any response from your plug?
I just got the plug so I am not sure If I am doing sth else wrong. This shows up in the log:
[2020-07-16 23:10:32,481] DEBUG: ImmutableMultiDict([('checkStatus', u'192.168.1.102')]) [2020-07-16 23:10:32,482] DEBUG: Checking status of 192.168.1.102. [2020-07-16 23:10:32,482] DEBUG: {'system': {'get_sysinfo': {}}} [2020-07-16 23:10:32,483] DEBUG: IP 192.168.1.102 is valid. [2020-07-16 23:10:32,483] DEBUG: Sending command {'system': {'get_sysinfo': {}}} to 192.168.1.102 [2020-07-16 23:10:35,611] DEBUG: Could not connect to 192.168.1.102. [2020-07-16 23:10:35,612] DEBUG: [2020-07-16 23:10:35,612] DEBUG: {'emeter': {'err_code': True}, 'system': {'get_sysinfo': {'relay_state': 3}}}
Never mind me. Works fine now. My guess would be that my static IP mapping wasn't actually forwarded to the plug and thus the IP set in octoprint being wrong.
@Sonnenwerk it seems that this may be resolvable for you following the steps linked in this comment, and now added to the warning in the readme.
https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/issues/163#issuecomment-660281143
This issue has been automatically marked as stale because it has not had activity in 14 days. It will be closed if no further activity occurs in 7 days.
Mine stopped working today with pretty much the same errors in the logs.
[2020-08-01 13:16:50,618] DEBUG: Checking statuses during print progress (51). [2020-08-01 13:16:50,627] DEBUG: Resetting idle timer during print progress (51)... [2020-08-01 13:16:51,628] DEBUG: Checking status of 192.168.43.171. [2020-08-01 13:16:51,629] DEBUG: {'system': {'get_sysinfo': {}}} [2020-08-01 13:16:51,630] DEBUG: IP 192.168.43.171 is valid. [2020-08-01 13:16:51,631] DEBUG: Sending command {'system': {'get_sysinfo': {}}} to 192.168.43.171 [2020-08-01 13:16:54,766] DEBUG: Could not connect to 192.168.43.171. [2020-08-01 13:16:54,767] DEBUG: [2020-08-01 13:16:54,767] DEBUG: {'emeter': {'err_code': True}, 'system': {'get_sysinfo': {'relay_state': 3}}}
The smartplug (HS100 on 1.5.6) still works on Kasa and on my Homebridge setup. Not sure what happened overnight for this to suddenly stop working
Interesting, an HS100 shouldn't have energy monitoring so shouldn't be attempting to check status during print progress. I'v seen cases where the plug had to be unplugged from the wall and reconnected. It could also be your firmware updated and if it was set to being able to be controlled from the cloud it locked out local mode connections, which is how this plugin communicates. More about that in the warning here.
FWIW, I downloaded the latest tplink_smartplug.py since it says the plugin is inspired by it.
python tplink_smartplug.py -t 192.168.43.171 -c info
('Sent: ', '{"system":{"get_sysinfo":{}}}')
('Received: ', '{"system":{"get_sysinfo":{"sw_ver":"1.5.6 Build 191118 Rel.140307","hw_ver":"2.0","type":"IOT.SMARTPLUGSWITCH","model":"HS100(US)","mac":"
Parts redacted for privacy.
Yeah, so my plugin should be working then, because it's the same guts. Did you run that command from your pi within the ~/oprint/bin
folder or from another machine/location? I'm totally confused at this point why it would just stop working. What else have your tried, ie unplugging from the wall, restarting the pi, etc.? Do you see any errors in octoprint.log or the browser's developer console on initial page load?
I ran several the python script as well as hs100.sh (https://github.com/ggeorgovassilis/linuxscripts/blob/master/tp-link-hs100-smartplug/hs100.sh) from several different machines with success. At this point, I'm not sure what I did to get this working but it did NOT involve setting the plug to local only. I would say this problem is not with this plugin but something on the plug side that prevents the octopi from communicating. I constantly got tcp errors:
./hs100.sh 192.168.43.171 9999 off args are 192.168.43.171 9999 off nc: connect to 192.168.43.171 port 9999 (tcp) failed: No route to host
and with some combination of connecting to the device at the same time on another machine, my octopi finally connected pi@octopi:~/oprint/bin $ ./hs100.sh 192.168.43.171 9999 off args are 192.168.43.171 9999 off Connection to 192.168.43.171 9999 port [tcp/*] succeeded! ^C
After this, I checked with the plugin on the octoprint interface and verified its working again.
This issue has been automatically marked as stale because it has not had activity in 14 days. It will be closed if no further activity occurs in 7 days.
I updated my octoprint today (completly reinstalled on the sd card). Because i run on an old python version. I now get the same error... No clue what to do now. Kasa works fine.
[2023-01-03 14:51:24,699] DEBUG: ImmutableMultiDict([('checkStatus', '100.100.100.34')]) [2023-01-03 14:51:24,700] DEBUG: Checking status of 100.100.100.34. [2023-01-03 14:51:24,706] DEBUG: {'system': {'get_sysinfo': {}}} [2023-01-03 14:51:24,706] DEBUG: IP 100.100.100.34 is valid. [2023-01-03 14:51:24,707] DEBUG: Sending command {'system': {'get_sysinfo': {}}} to 100.100.100.34 [2023-01-03 14:51:27,833] DEBUG: Could not connect to 100.100.100.34. [2023-01-03 14:51:27,834] DEBUG: [2023-01-03 14:51:27,834] DEBUG: {'system': {'get_sysinfo': {'relay_state': 3}}, 'emeter': {'err_code': True}} [2023-01-03 14:53:39,714] DEBUG: ImmutableMultiDict([('checkStatus', '100.100.100.34')]) [2023-01-03 14:53:39,715] DEBUG: Checking status of 100.100.100.34. [2023-01-03 14:53:39,715] DEBUG: {'system': {'get_sysinfo': {}}} [2023-01-03 14:53:39,715] DEBUG: IP 100.100.100.34 is valid. [2023-01-03 14:53:39,715] DEBUG: Sending command {'system': {'get_sysinfo': {}}} to 100.100.100.34 [2023-01-03 14:53:42,872] DEBUG: Could not connect to 100.100.100.34. [2023-01-03 14:53:42,874] DEBUG: [2023-01-03 14:53:42,874] DEBUG: {'system': {'get_sysinfo': {'relay_state': 3}}, 'emeter': {'err_code': True}}
Any errors in octoprint.log? So the plug is seen but it's not responding to commands. Can you try unplugging it and plugging it back in, verify the IP didn't change from your router, adjust plugin settings accordingly and try again. It's possibly your firmware updated and is no longer locally controllable.
Describe the bug Can not switch on/off TPLink HS100 with OctoPi / TP Plugin.
To Reproduce Steps to reproduce the behavior:
Expected behavior Switch plug off
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context Thats what i got out of octos log..not sure, if that helps or what loginfo is needed.
any idea how to progress with finding a solution ? cu Thomas