milight | Reverse engineering MiLight
kandi X-RAY | milight Summary
kandi X-RAY | milight Summary
Documentation and tools for MiLight remote-controlled lightbulb. These docs are specific to the dual-white bulbs/remotes. The protocol differs from the RGBW hardware but there are details of that on Henryk Plötz' Hackaday.io page.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Handle incoming packet .
- Main function .
- convert a bitstring to bytes
- Slice a string
- Calculate the checksum of a given packet .
- Slice string by count .
milight Key Features
milight Examples and Code Snippets
Community Discussions
Trending Discussions on milight
QUESTION
I trying to write a menubar app to get control over my lights via Mac. I'm using the system of milight (limitless, easybulbs...). They have an open system were you can send commands via UDP.
I'm able to control my lights via python-limitless library in python, so I know the networking thing such as IP and port is right.
So I think I do anything wrong with this UDP stuff I never worked with. I'm trying to use SwiftSocket library to send my commands but nothing happens, I've been trying it since 2 days.
Here ist what I'm trying:
...ANSWER
Answered 2017-Apr-19 at 21:30I'm a bit late, but I hope it can help you :
Before sending your lighton request you have to send a first request to get, the wifi bridge session. You also need to compute what Milight called the "checksum" based on your request.
You also make sure about what kind of bulb you have, is it WW bulb or CW? I was stuck for severals days because I was sending wrong request..
I made an implementation, It's in php but you can use it same way in Objective-C.
Check it out : https://github.com/winosaure/MilightAPI
UPDATE :
According to limitlessled "documentation" (http://www.limitlessled.com/dev/) this is how a request is composed :
UDP Hex Send Format: 80 00 00 00 11 {WifiBridgeSessionID1} {WifiBridgeSessionID2} 00 {SequenceNumber} 00 {COMMAND} {ZONE NUMBER} 00 {Checksum}
This is why you must get wifibridge session first then you need to calculate the checksum.
Let me take one example about how to turn on the light.
The documentation says that :
31 00 00 08 04 01 00 00 00 = Light ON
31 00 00 08 04 01 00 00 00 refer to {COMMAND} above.
So far the full request must be :
QUESTION
While busy with project I'm wondering how you can't make a brown looking color with a RGB led light, but pixel can display brown really well. What is the biggest different between a RGB led light(for example a MiLight or Arduino RGB LED) and a (monitor) pixel what makes it works?
Is there a way to program any RGB light to output a brown light color?
...ANSWER
Answered 2017-Oct-23 at 14:23LEDs are rather large so your eye can easily identify only the R and B being on for example, so we see a red and a blue light source. A monitor pixel is so small that our brain sees the R and B as magenta instead.
You can read about here on Wikipedia.
QUESTION
I'm trying to implement milight api using http://www.limitlessled.com/dev.
I wrote a small php script which based on that. According to the documentation I always received the good response from my UDP request, all the request is successfull but nothing happens (Link light, siwth on/off etc..)
What I've done so far :
...ANSWER
Answered 2017-Apr-14 at 23:12I figured out what was wrong.
First I noticed that request are not exactly the same between CW bulb and WW bulb. For example, the request you have to send to switch on the light with CW bulb is :
QUESTION
First of all I have searched a lot and also tried many things but unfortunately no solution for my problem.
Below, I tried to compare two char* values. But I do not understand why this does not work. What my intention is that this function performs the sendCommand() only when temp does not equal IDMilight. Temp values will be different if there is an adjustment to the database. So if there issn't any adjustment it must delay for 2sec and check again.
I'm pretty new to C++ so I hope someone can help me with this
...ANSWER
Answered 2017-Mar-07 at 11:23Since you are pretty new to C++, the right answer is this:
Don't use char*
. Try to avoid pointers at all and if you have to use them, use pointer classes like unique_ptr
. One simple reason, for example, is that you have to manage memory if those pointers don't simply point at some other variables that exist within some scope. Thus, memory leaks are quite easy to produce if you use pointers. (That said, you can use pointers, but usually you do this in some controlled environment, like wrapped within some class, like a linked list class, or in a very small scope in which you need polymorphy - although again, in such a case you could use unique_ptr
or shared_ptr
)
Pointers that are essentially arrays like the typically used char*
should be replaced by something that wraps arrays. In this case, clearly std::string
, which can be used just like char*
. In other cases, for example instead of int*
or int[]
arrays, you'd use std::vector
.
Now, you have some function from outside that you need for SQL, that's ok, but try to limit the time in which something stays a char*
. Transform char*
to string simply by putting it in the constructor: std::string my_string(functions_that_returns_char());
, then compare simply by string_1 == string_2
. You can access single letters as usual by my_string[some_index]
. Take a look yourself for more functionality:
http://www.cplusplus.com/reference/string/string/
That said, I can only second the comment from Baum mit Augen, get a book or read through some tutorials. And be aware that C-style is totally not C++-style, C-programmers will use pointers a lot, for instance.
As for your original question, a pointer that is essentially an array points to the first element of that array. Dereferencing produces that element, not the array. No need to use a pointer here anyway if you could simply directly use the actual array, right?
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install milight
You can use milight like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page