Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client network socket disconnected before secure TLS connection was established #4

Closed
joroMaser opened this issue Nov 23, 2021 · 5 comments

Comments

@joroMaser
Copy link

joroMaser commented Nov 23, 2021

I removed my Dlink from mydlink app , then I add back only to wifi then I closed the application

I have tried to run:
node switch.js 192.168.1.11 <PIN_CODE> 1 0

And I got

Signed in!                                                                                                                 
Getting state                                                   
Had error: { Error: API Error 2: system error                    
    at WebSocketClient._getSetting (/mnt/dlink_websocketclient/index.js:282:27)   
    at process._tickCallback (internal/process/next_tick.js:68:7) code: 2 }

What does it mean please?

If I make a wrong with PIN code I got:

Signed in!                                                                                                               
Getting state                                                                                                            
Had error: { Error: API Error 424: invalid device token                                                                  
    at WebSocketClient._getSetting (/mnt/dlink_websocketclient/index.js:282:27) 
    at process._tickCallback (internal/process/next_tick.js:68:7) code: 403 }
@Garfonso
Copy link
Owner

Hi,

what device do you try to talk to?
Do you see a webpage on the IP?

@joroMaser
Copy link
Author

@Garfonso I have edit my post , thank you

@Garfonso
Copy link
Owner

@joroMaser what device do you want to talk to? DSP-W118?

The device returns an error, when the library asks for the current state of the socket.
You can try with a modified version of the switch.js file (which is meant as example anyway) and remove the client.state() call and see if it manages to switch the socket on or off.

@joroMaser
Copy link
Author

joroMaser commented Nov 23, 2021

@Garfonso
Do you mean comment out the lines:

let state = await client.state();
console.log('Socket is ' + (state ? 'on' : 'off'));

in switch.js ?

I still got

Had error: Error: API Error 2: system error   
    at WebSocketClient._setSetting (/mnt/dlink_websocketclient/index.js:263:19)       
    at process._tickCallback (internal/process/next_tick.js:68:7

@Garfonso
Copy link
Owner

@Garfonso Do you mean comment out the lines:

let state = await client.state();
console.log('Socket is ' + (state ? 'on' : 'off'));

in switch.js ?

yes.

I still got

Had error: Error: API Error 2: system error   
    at WebSocketClient._setSetting (/mnt/dlink_websocketclient/index.js:263:19)       
    at process._tickCallback (internal/process/next_tick.js:68:7

So it can not switch.
What device is this? (third time I ask... sorry.... without this information I can recommend nothing further)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants