linuxscripts icon indicating copy to clipboard operation
linuxscripts copied to clipboard

hs100 script: incorporate netstat timeout

Open ggeorgovassilis opened this issue 5 years ago • 2 comments

Details in this comment https://blog.georgovassilis.com/2016/05/07/controlling-the-tp-link-hs100-wi-fi-smart-plug/comment-page-2/#comment-1901

ggeorgovassilis avatar Oct 07 '20 16:10 ggeorgovassilis

I'm not sure of the etiquette for this, but I rewrote the script in python. netcat on arch linux doesn't like the timeout arguments as per that linked comment. https://github.com/Nealefelaen/hs100

Nealefelaen avatar Oct 30 '20 02:10 Nealefelaen

Issue (on a Raspberry PI): The plug reacted without delay to on/off commands, but the script seemed to hang for a long tome after sending a command. Also took a long time to get any status info. Looked like nc was waiting for a timeout?

I added -N (shutdown on EOF) to nc in send_to_plug(). All the commands work and the script terminates quickly. Tested with: sw_ver":"1.0.18 Build 210910 Rel.141202","hw_ver":"1.0","model":"KP115(US)"

kkscherer avatar Mar 10 '22 02:03 kkscherer