-
Notifications
You must be signed in to change notification settings - Fork 220
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
Discovery MAC address #71
Comments
Yes OpenHAB needs me to set the right mac address before it's accepted and ready to interact. So does the device answer the right way already or is there a wrong MAC inside or something else? |
The ID esp8266_milight_hub responds with is the device ID bound to the UDP port (e.g., I poked through the OpenHAB code for the MiLight binding, and it doesn't look like it's doing any ARP lookups, so I don't think the MAC needs to be the right value from a network perspective. It does seem like OpenHAB needs to run the discovery protocol and get a response with a matching ID. Right now the discovery protocol isn't implemented at all, which is probably why you're seeing it not working. There's some relevant discussion in #46. I'm taking a stab at implementing the discovery protocol. Should have a testable version within the next couple of days. |
Ok, I just tried adding it with the the MAC "00:00:00:00:XX:YY" and voilà it works. I am gonna try everything now. Maybe a tip in your web overlay would be helpful? Thanks again for all your work! :) |
Sweet! Good find. I'm hoping that implementing discovery makes this more automatic, but I definitely want to document integrating with different HA platforms. @alexeinz FYI, looks like @dennisvonderbey got it working with OpenHAB without discovery (see above). |
Do you mean to be using protocol version 5? What kind of bulbs are you trying control? |
i have both v6 and v5 bulbs
the 55 in screenshot is rgbw and should work on v5 and lower with no issues
…Sent from my cell
On Apr 27, 2017, at 9:15, Chris Mullins ***@***.***> wrote:b
Do you mean to be using protocol version 5? What kind of bulbs are you trying control?
―
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Have you already tried it with v6? It should indeed work with v5, but I can imagine it not working because v5 is unidirectional with the exception of discovery, whereas v6 packets are always met with a response. Might be helpful to get Serial output with If discovery is indeed the issue, adding it should fix for both v5 and v6. |
Yes I tried setting the Gateway as v6 and v5 , the result is similar.
My OpenHab installation simply does not see the 00000000XXYY mac adresses
at all,and cant add the gateway except in the v2compat. mode.
how can I test that ESP indeed responds with the correct mac adresses ?
…------
Regards
Alex Einz
Tel - +81(0) 80-6749-1800
dj@alexeinz.info
http://www.alexeinz.info
Weekly quote:
“The true sign of intelligence is not knowledge but imagination
- Albert Einstein
On Thu, Apr 27, 2017 at 1:17 PM, Chris Mullins ***@***.***> wrote:
Have you already tried it with v6? It should indeed work with v5, but I
can imagine it not working because v5 is unidirectional with the exception
of discovery, whereas v6 packets are always met with a response.
Might be helpful to get Serial output with MILIGHT_UDP_DEBUG turned on.
If discovery is indeed the issue, adding it should fix for both v5 and v6.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGeYSauupH4k4VCtGH_ExM9y9yDrzUU1ks5r0BbtgaJpZM4NIDFA>
.
|
@alexeinz Which version of OpenHAB are you running? I am using the snaphshot (unstable) one which uses the new developement binding for the iBox bridges. I also needed to add it manually via the PaperUI. Gonna take a look at it again, because I like adding all my things via the files. You can also try to look at the log. The Karaf console will give you more details than the default log file. You cann access it via ssh from the Pi (or what you're running it from):
The password is |
I run oh2, and offcourse did debug on milight plugin.
is what I get when the 00000000B55D mac is added. Once mac is removed, v2 mode is discovered and added correctly
Can you tell which version of milight binding you running, or better yet send me a link - and i can test right now. |
Took an initial stab at the discovery protocol. You can try it out in this branch. |
Nice one, is there a way to do remote upgrade using http console or I need to reflash the esp? |
> UDPSock = UDPSocket.new
=> #<UDPSocket:fd 10>
> UDPSock.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true)
=> 0
> UDPSock.send('HF-A11ASSISTHREAD', 0, '<broadcast>', 48899)
=> 17
> UDPSock.recvfrom(100)
=> ["10.133.8.146,000000000001,HF-LPB100", ["AF_INET", 48899, "10.133.8.146", "10.133.8.146"]]
> UDPSock.recvfrom(100)
=> ["10.133.8.146,000000000002,HF-LPB100", ["AF_INET", 48899, "10.133.8.146", "10.133.8.146"]] |
Yeah you can POST a compiled binary to the
There's also a modal in the UI if that's easier. A button at the bottom opens it. |
There is also a feature that pulls the latest release from github if that's what you meant, but right now it only looks at the latest stable release, and I'm afraid this feature is not super stable right now because SSL needs like 16 KBs of RAM, which is pretty close to steady state. |
oh I see, cant compile the binary right now because at work ( i have access
to the http UI remotely )... ( i got nodemcuv2 if you can hit compile for
me on your end and up it here...
btw whats is the udp response if you send “Link_Wi-Fi”
…------
Regards
Alex Einz
Tel - +81(0) 80-6749-1800
dj@alexeinz.info
http://www.alexeinz.info
Weekly quote:
“The true sign of intelligence is not knowledge but imagination
- Albert Einstein
On Thu, Apr 27, 2017 at 5:03 PM, Chris Mullins ***@***.***> wrote:
There is also a feature that pulls the latest release from github if
that's what you meant, but right now it only looks at the latest stable
release, and I'm afraid this feature is not super stable right now because
SSL needs like 16 KBs of RAM, which is pretty close to steady state.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGeYSW08aIOYT1XvnvldP5zK5R7k0AiZks5r0EvTgaJpZM4NIDFA>
.
|
I can tag the release. Travis CI should upload compiled binaries momentarily: https://github.com/sidoh/esp8266_milight_hub/releases/tag/1.3.0-dev It should have no output with the example configuration I gave since neither of the UDP servers are version 5. It responds with something like |
i mean if it would respond with macadress,ipadress to Link wifi , wouldnt it make the gateway fully compatible with v5 and lower boxes ?
…Sent from my cell
On Apr 27, 2017, at 17:13, Chris Mullins ***@***.***> wrote:
I can tag the release. Travis CI should upload compiled binaries momentarily:
https://github.com/sidoh/esp8266_milight_hub/releases/tag/1.3.0-dev
It should have no output with the example configuration I gave since neither of the UDP servers are version 5. It responds with something like xx.yy.zz.ww,AABBCCDDEEFF for each version 5 server.
―
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
seems no change here with the new one.
|
I don't think OpenHAB or anything else is (or should be) relying on the ID getting sent back being a hardware address bound to the IP. The argument for having it respond with generated IDs is that this is a device that supports multiple gateways, and it makes sense to me to distinguish them somehow. You're certainly welcome to try sending the MAC instead of the generated ID. Relevant bits of code are here and here. The error you're seeing is from here, it seems: String[] msg = new String(buffer, 0, packet.getLength()).split(",");
if (msg.length >= 2 && msg[1].length() == 12) {
// Stop resend timer if we got a packet.
if (resendTimer != null) {
resendTimer.cancel(true);
resendTimer = null;
}
// Determine version: Version 6 sends a third argument != ""
int version = msg.length >= 3 && msg[2].trim().length() > 0 ? 6 : 3;
// Notify all observers
discoverResult.bridgeDetected(((InetSocketAddress) packet.getSocketAddress()).getAddress(), msg[1],
version);
} else {
logger.error("Unexpected data received {}", msg[0]);
} Having a hard time seeing how the messages it received are invalid. They should split into 2 or 3 tokens, and the ID should have length 12. Is it possible for you to modify the |
it seem now with the new firmware and updated openhab addon, the mac ids are detected correctly. |
Sweet. Glad it's working! Interesting that v5 won't work with multiple ports. I don't think there's any reason this has to be the case, but could imagine the way OpenHAB has implemented version discovery doesn't work well because the v5 protocol is unidirectional. Yeah -- v6 should work with every bulb type. And it's reasonably easy to add handlers for new remotes/bulbs :) |
Hey,
I just finished building a DIY milight hub. Unfortunately when I try to pair it with the V6 protocoll and Openhab the discovery package gets the following return:
Is it something like an encoded address?
I tracked it down to this part of the code:
The OpenHab implementation doesn't allow the usage of a device without the right mac address in a config. Sadly I don't really get this code. Is it a hardcoded MAC address or is just something buggy? I would appreciate your help!
Thanks.
The text was updated successfully, but these errors were encountered: