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

Timeout connecting to Tradfri gateway #34

Closed
mthompson2 opened this issue Nov 28, 2019 · 6 comments
Closed

Timeout connecting to Tradfri gateway #34

mthompson2 opened this issue Nov 28, 2019 · 6 comments

Comments

@mthompson2
Copy link

** Environment**
Visual Studio 2019 on Windows 10
Tradfri Gateway version 1.9.27 with DHCP IP 10.1.5.7

Code that fails
tradfriController = new TradfriController("GW", "10.1.5.7");
TradfriAuth appSecret = tradfriController.GenerateAppSecret("XXXXXXXXX", "Tradfri");

Where XXXXXXXXX is the gateway secret from the back of the gateway.

On execution the code hangs for about 30 seconds. When it returns appSecret is null.

I can ping 10.1.5.7. The Idea Tradfri App works fine.

Any suggestions of what im doing wrong if this isnt a bug would be hugely appreciated.

Thanks.

@BjornPoppe
Copy link
Collaborator

I got the same problem when I tried the library the other day but haven't got around to report yet. It was due to miss-spelled PSK (mixed up small cap L with large cap I).

@mthompson2
Copy link
Author

Hi,
Thanks for the reply.

I presume the gateway key printed on the botttom of the Tradfri hub?
Ive checked it and rechecked the code and think i have it right... Still doesn't work though.

@mthompson2
Copy link
Author

Was wondering if it was something to do with my Unifi network - But it doesnt seem to be. Have connected directly between PC and Trdfri via a generic, dumb switch (Third port to Unifi network) and still no joy. The Idea / Tradfri App works fine though from my android phone.

Tearing my hair out on this one.

@dominicusmento
Copy link
Owner

The problem you described seems to be that your app (code) doesn't get the response from the gateway. Yet it can be the request itself that doesn't reach the gateway at all, or it can be that you don't get a response. Any way I think it is something in the networking, either specific PC network/firewall settings, or network internally or the gateway maybe has stuck in some mode. Most probable cause would be the PC as you already said that Android app works fine. Can you try on another PC with compiled app.

@mthompson2
Copy link
Author

Apologies for the delay responding. Was needed to be away from home for several days. I will get this tested in the next couple of days and report back.

@dominicusmento
Copy link
Owner

Closing due to inactivity..

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

3 participants