tplink-smartplug icon indicating copy to clipboard operation
tplink-smartplug copied to clipboard

Cannot get working with smartPlug_CE_HS100(AU)_HS110(AU)

Open mamejay opened this issue 8 years ago • 8 comments

Hello everyone. I have been trying to get this working with an australian version hs100 model Hardware is version 2 and firmware installed is smartPlug_CE_HS100(AU)_HS110(AU)_1.1.3_Build_170120_Rel.171906.bin Checking the firmware sizes from know working models shows it is only 513kb where the woeking models are about 3mb. Is it possible to check the firmware for the au model and see if there are differences in the command set? I have basic knowledge of wireshark and linux so hoping some smarter people can assist.

mamejay avatar Sep 13 '17 00:09 mamejay

Update encrypt with the following:

def encrypt(self, string):
                key = 171
                result = "\0\0\0"+chr(len(string))
                for i in string:
                        a = key ^ ord(i)
                        key = a
                        result += chr(a)
                return result

works with HS100(AU) HW:2.0 SW:1.0.10

uwwint avatar Sep 22 '17 14:09 uwwint

I have a couple of HS100/HS110 (US) modules. The code with and without the above patch to encrypt seems to work fine with those modules. However I have a new mini plug HS105 (US), HW version 1.0, firmware versino 1.2.9 that doesn't seem to respond with or without this patch. I don't know if I'm just missing something or there is some other difference for this.

So I think it's worth merging the PR for this patch. I'll probably open up a separate issue for the HS105.

rct avatar Oct 29 '17 23:10 rct

That modification was already merged into my plugin to get the au versions working. If you find out a way to get your version to work let me know.

jneilliii avatar Oct 30 '17 11:10 jneilliii

result = pack('>I', len(string))

kchiem avatar Nov 08 '17 05:11 kchiem

@kchiem - Thank you, that works with both my new HS105(US) and older HS100's.

Note: An import struct is needed. Pack is in the struct module.

rct avatar Nov 08 '17 05:11 rct

Thanks @kchiem , I've updated my plugin in the dev branch and am awaiting confirmation for the HS105. It does still seem to work fine for my HS100 plugs.

jneilliii avatar Nov 08 '17 16:11 jneilliii

I had to use this patch to get the script working with my HS100(US), hardware version 2.0 firmware version 1.2.9.

jpap avatar Dec 05 '17 00:12 jpap

Using @uwwint's suggestion, all I changed was this line: result = "\0\0\0"+chr(len(string)) and It started working after that, I'm using tplink hs100 (US). Thanks for the suggestion.

xaviervilla avatar Apr 23 '18 02:04 xaviervilla