Giter Site home page Giter Site logo

Comments (9)

roddone avatar roddone commented on August 17, 2024

Hi, please use the bug template the next time you create an issue, it describes two prerequisites :

  1. Check that your devices have the "developer mode" enabled
  2. Check that your devices firmwares are up to date

Please check that both of these prerequisites are OK. If both of these prerequisites are OK, please provide a full code sample to help reproduce the problem. The log you provide is not really helpful.

Regards,

Romain.

from yeelightapi.

cjkarande avatar cjkarande commented on August 17, 2024

Hi @roddone ,

  1. Yes Developer Mode is Enabled
  2. Yes Device Firmware is Up to date

Issue here is that the Discover API call is working fine inside a Windows based Console Test App for the same device, however its Not working inside a Xamarin Forms Project. Also other Control APIs like Power, Brightness, etc. are working fine on the Device object constructed from a Host IPAddress in the Xamarin project. Its only the Discovery API that i am facing issue in a Xamarin project.
My current library configs are as follows

  1. YeeLight API 1.7.0
  2. Project is using .Net Standard 2.0

from yeelightapi.

cjkarande avatar cjkarande commented on August 17, 2024

using YeelightAPI;
using Device = YeelightAPI.Device;

DeviceLocator.OnDeviceFound += (sender, arg) => {
Console.WriteLine($"Device found : {arg.Device}");
};

List devices = await DeviceLocator.Discover();

from yeelightapi.

roddone avatar roddone commented on August 17, 2024

It seems like a network issue, i already have encountered some issues like that but I wasn't able to fix it because it was specific to the network / hardware.
Are you launching your app locally in your computer or directly on your mobile device? If launching on your computer, can you try to launch the app through Wi-Fi and ethernet to see if there is any difference?

from yeelightapi.

cjkarande avatar cjkarande commented on August 17, 2024

Yes I hv read about some issues in desktop simulators. However, in my case i am running it directly on the android phone. On the other hand the Device Control APIs using Direct Host IP are working fine on Mobile.
For ex. the below calls are working fine. Issues is only wiyh Discover API
//////////////////////////////////////////////////////
Device device = new Device("192.168.1.xxx");
device.Connect();
await device.Toggle();
//////////////////////////////////////////////////////

One more observation, If this can help you locate the issue
While i was trying alternate YeeLight Libraries, i found that the Discover API of the below library works fine on my mobile device and returns me the SmartBulb list in my n/w
https://github.com/SnakePin/yeelight-api-csharp

For ex. the following call from "yeelight-api-csharp" library call works fine on my mobile.
List<YeeLightAPI.YeeLightDevice> devices = DeviceLocator.DiscoverDevices(1000, 1);

from yeelightapi.

cjkarande avatar cjkarande commented on August 17, 2024

Hi @roddone, today i debugged your Discover API and found that for some reason the Mobile Wifi Interface returns a Null GateWayAddress and hence skips execution of the succeeding logic. I observed that the GatewayAddress is getting used nowhere in your SSDP discovery logic so tried commenting the below if condition after which the Discover API seems to work fine. Not sure why do we need to check presence of GatwayAddress.

if (addr != null && !addr.Address.ToString().Equals("0.0.0.0"))
{
...
}

from yeelightapi.

thoemmi avatar thoemmi commented on August 17, 2024

Maybe it's related to #25?

from yeelightapi.

roddone avatar roddone commented on August 17, 2024

You're right @thoemmi, both issues seems similar and may be related, but proposed fixes are not the sames 🤔.
@cjkarande can you locally try #25 and tell us if it fixes your issue ? If it does not I will considere this change in a future release 😉

from yeelightapi.

roddone avatar roddone commented on August 17, 2024

I finally managed (and get some time) to reproduce the problem. Removing the test on the gateway adress seems to fix the problem, as you proposed.

Honnestly this is one of the first things i wrote two years ago and I don't remember why ...

I will ship the fix in the next release.

from yeelightapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.