Comments (9)
Hi, please use the bug template the next time you create an issue, it describes two prerequisites :
- Check that your devices have the "developer mode" enabled
- 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.
Hi @roddone ,
- Yes Developer Mode is Enabled
- 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
- YeeLight API 1.7.0
- Project is using .Net Standard 2.0
from yeelightapi.
using YeelightAPI;
using Device = YeelightAPI.Device;
DeviceLocator.OnDeviceFound += (sender, arg) => {
Console.WriteLine($"Device found : {arg.Device}");
};
List devices = await DeviceLocator.Discover();
from yeelightapi.
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.
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.
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.
Maybe it's related to #25?
from yeelightapi.
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.
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)
- Event that notify a light is discovered HOT 2
- [BUG] HOT 16
- [BUG] HOT 1
- Question: is there a way to set a property? HOT 2
- [ENHANCEMENT] use IAsyncEnumerable to provide a more modern way to iterate devices found by DeviceLocator HOT 1
- Unable to detect Mi LED Smart Bulb[BUG] HOT 2
- [BUG] AdjustBright doesn't allow negative values
- [QUESTION] Is it possible to connect to the Yeelight device and send some commands from the device/application that is NOT in the same LAN? HOT 2
- [BUG] LED Ceiling Light brightness always returns 1 in moonlight mode HOT 2
- [SOLVED] Connect issue HOT 1
- [BUG] DeviceLocator throwing InvalidOperationException HOT 13
- Q: Support for music mode? HOT 11
- [Feature-request][Question] HOT 1
- [BUG] DeviceGroup.StartMusicMode() won't work for multiple devices HOT 6
- How it work? HOT 2
- Only works once HOT 1
- DeviceLocator.UseAllAvailableMulticastAddresses not returning all devices in v1.10.2. HOT 9
- [BUG] HOT 4
- [QUESTION] Should I create new tcp connection on every http request or persist an exist one ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yeelightapi.