-
Notifications
You must be signed in to change notification settings - Fork 20
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
[BUG] - Generate Secret method doesn't work with newer gateway fw version (1.11.47) #48
Comments
Can you please try with newest 1.11.51 gateway version and report back to save time if they are the cause... ? |
Gateway is on 1.12.31 and the code runs always into TimeOut. Nugets are all updated to todays newest versions. Increasing TimeOut also did not help. |
@JoergSn @vbtiger "Bad record mac" is probably due to the SSL being tampered with (which you are doing by using Wireshark) so that error is definitely misleading.. If you have timeout problems, please check your router and firewall settings.. |
Thanks Tomidix for your feedback. To troubleshoot I also used WireShark and voila, same "Bad Record MAC" on two machines, using WLAN and Ethernet cable. Now with completely fresh settings in app.config, Tradfri-UI works like a charm. RCA might be: To many tries with possibly same appName etc. |
This is an old open bug but since it's marked as open I'll add to it here. |
|
Hi. Thanks for your reply.
I did not use tradfriui, I coded up the connection myself. I will look into that and get back to you once I have. |
Hi again @tomidix . I had time to look into this again. So I ran tradfriui. First I got this error message: |
Hi, I have changed my appName setting and tried to generate the secret again. That worked fine and using settings below and I can confirm that the GW version 1.16.26 is working fine. One thing I noticed while I was playing around is that every time I publish TradfriUI app, it asks for firewall allowance so please check that you application is not blocked by fwall. RestSharp is needed in csproj due to apiLibs problem.. (I'm waiting for the author to solve this one) |
Hi again @dominicusmento . Have you had the possibility to look into this? When I clone the latest version from master I get version 1.2.0.0, not the version 2.1.0.5 that you seem to have. Am I missing something obvious here? |
Hi, Regarding your problem I really can't reproduce it.. Maybe some more info about your network would help to solve the issue as I really can't see what's stopping it from creating the secret.. |
Thanks for getting back to me @dominicusmento . Indeed a very strange problem this!
Running a ping gives me this:
The code to create a new app secret is as of now running from a console app (.NET Core 3.1) and this is the code (simplified) using System;
using Tomidix.NetStandard.Tradfri;
namespace Holly.IkeaTradfriConnectorConsole
{
class Program
{
static void Main(string[] args)
{
var controller = new TradfriController("my-gw", "192.168.1.35");
var appSecret = controller.GenerateAppSecret("GatewaySecret", "Holly");
}
}
} As already mentioned, it fails when generating the secret with a "Timeout Generating App Secret". |
Hi, from what I see in your last response, the issue should be in a network. I think the problem here is not the generate app secret method; my guess is that, in current network configuration, you will get timeout for any other call too. It's just that it is mandatory call for every other to work.
|
So I did a quick nmap scan for now, I'll get back for more results:
|
Hi again @dominicusmento. So as you can see I successfully ran an nmap scan on udp without issue. |
My gateway version is 1.11.47
I tried to use this sample code:
const string password = "ThisIsMySecretPassword";
const string applicationName = "TradfriControllerApp";
const string ipAddress = "192.168.0.230";
var controller = new TradfriController("Tradfri", ipAddress);
TradfriAuth appSecret = controller.GenerateAppSecret(password, applicationName);
It throws an exception: "Timeout Generating App Secret."
I've tried to increase the AckTimeout value but no luck.
Also the app writes this to the console:
"15:11:10 [DTLSClientChannel] Error - Failed to establish a DTLS session"
When checked the raw network data with Wireshark, this was the result:
The text was updated successfully, but these errors were encountered: