1

I used the example from the following link Nuget for HueApi

static void Main(string[] args)
{
    IBridgeLocator locator = new SSDPBridgeLocator();

    //For Windows 8 and .NET45 projects you can use the SSDPBridgeLocator which actually scans your network. 
    //See the included BridgeDiscoveryTests and the specific .NET and .WinRT projects
    IEnumerable<string> bridgeIPs = locator.LocateBridgesAsync(TimeSpan.FromSeconds(5)).GetAwaiter().GetResult();
    foreach (var bridgeIp in bridgeIPs)
    {
        Console.WriteLine(bridgeIp);
    }
    Console.ReadLine();
}

When I run this console app it doesn't find the bridge ip address. Can someone explain me what I am doing wrong? I verified that the bridge of Philips Hue is working fine.

How can I automatically find the Philips Hue bridge in a network?

Which credentials should I run the console app on?

Ben
  • 2,433
  • 5
  • 39
  • 69
StackOverflowVeryHelpful
  • 2,347
  • 8
  • 34
  • 46
  • 2
    *"Which credentials should I run the console app on?"* - Administrator? – Ben Jul 28 '15 at 02:11
  • Previously i tried to run as admin and it failed. But now i am able to run it successfully. Thanks for your answer – StackOverflowVeryHelpful Jul 28 '15 at 03:15
  • So did that actually solve the problem? – Ben Jul 28 '15 at 03:46
  • @Ben : It started failing again. I am unable to retrieve the IP address. No code change. Any ideas what thing might have caused this. Seems like a network issue to me. And for couple of runs it looked like it had solved the issue – StackOverflowVeryHelpful Jul 28 '15 at 03:48
  • That's seeming likely. Monitor your network status when you run this to double check :) – Ben Jul 28 '15 at 03:49
  • Any progress on this? – Ben Jul 28 '15 at 05:12
  • Here is the code link : https://github.com/Q42/Q42.HueApi/blob/master/src/Q42.HueApi.NET/SSDPBridgeLocator.cs I restarted my PC and it worked fine. Still trying to figure out what the issue is – StackOverflowVeryHelpful Jul 28 '15 at 17:59
  • Clean and rebuild the project and run it as admin and it worked. – StackOverflowVeryHelpful Jul 29 '15 at 21:25
  • 1
    So, after all that, did you manage to solve the problem? If so, please feel free to add it as an answer below (you may even get a few upvotes for solving your own problem! That's always worth a few kudos). Make sure to add the details of the issue and what you did to solve them! – Ben Jul 31 '15 at 01:54

1 Answers1

0

Problem that i was facing : After i consumed the Nuget for HueApi and did a build and tried to run the code it used to succeed at times to retrieve the bridge IP address, But failed at other times.

Some of the things that i made sure that i ran successfully all the time : 1) Run as Admin as mentioned by Ben in the comments 2) Do a clean and rebuild and then try to run the application.

StackOverflowVeryHelpful
  • 2,347
  • 8
  • 34
  • 46