plasticrake / tplink-smarthome-api

TP-Link Smarthome WiFi API
MIT License
1.02k stars 142 forks source link

ECONNREFUSED when trying to establish connection #103

Closed saendu closed 4 years ago

saendu commented 4 years ago

I tried to get my TP-Link HS100 working with your smarthome-api library. Unfortunatelly I receive the following error when trying to establish a connection.

Code:

const { Client } = require('tplink-smarthome-api');
const client = new Client();
const plug = client.getDevice({ host: '192.168.1.125' }).catch(e => console.log(e));

Error:

TCP 192.168.1.125:9999 Error: connect ECONNREFUSED 192.168.1.125:9999
{ Error: connect ECONNREFUSED 192.168.1.125:9999
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.1.125',
  port: 9999 }

nmap shows me that port 80 is open but not port 9999

sudo nmap -sS -O 192.168.1.125
Starting Nmap 7.80 ( https://nmap.org ) at 2020-07-18 11:59 CEST
Nmap scan report for tapo_smartplug.home (192.168.1.125)
Host is up (0.0079s latency).
Not shown: 999 closed ports
PORT   STATE SERVICE
80/tcp open  http
MAC Address: 1C:3B:F3:8E:18:55 (Unknown)
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=7.80%E=4%D=7/18%OT=80%CT=1%CU=40132%PV=Y%DS=1%DC=D%G=Y%M=1C3BF3%T
OS:M=5F12C819%P=x86_64-apple-darwin17.7.0)SEQ(SP=87%GCD=1%ISR=B5%TI=I%CI=I%
OS:II=RI%SS=O%TS=U)OPS(O1=M5B4%O2=M5B4%O3=M5B4%O4=M5B4%O5=M5B4%O6=M5B4)WIN(
OS:W1=B68%W2=B68%W3=B68%W4=B68%W5=B68%W6=B68)ECN(R=Y%DF=N%T=FF%W=B68%O=M5B4
OS:%CC=N%Q=)T1(R=Y%DF=N%T=FF%S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=Y%DF=N%T=FF%
OS:W=B68%S=O%A=S+%F=AS%O=M5B4%RD=0%Q=)T4(R=Y%DF=N%T=FF%W=B68%S=A%A=S%F=AR%O
OS:=%RD=0%Q=)T5(R=Y%DF=N%T=FF%W=B68%S=A%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=N%T=
OS:FF%W=B68%S=A%A=S%F=AR%O=%RD=0%Q=)T7(R=Y%DF=N%T=FF%W=B68%S=A%A=S+%F=AR%O=
OS:%RD=0%Q=)U1(R=Y%DF=N%T=FF%IPL=38%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)
OS:IE(R=Y%DFI=S%T=FF%CD=S)

Network Distance: 1 hop

OS detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 14.05 seconds

Plug info:

Model: P100
Hardware Version: 1.0.0
Firmware Version: 1.1.8 Build 20200408 Rel. 64448

Any ideas?

Thanks for support!

saendu commented 4 years ago

Closing, since there is no support for Tapo P100 as I recognised.