Connection to Xiaomi Bridge not working

Hi,

i have a xiaomi gateway installed but was not able to bind it to openhab2. I am running the latest “testing”, configured everything according to the documentation but the item remains in “INITIALIZING” and then goes to OFFLINE after a while. I am pretty sure to have configured the correct ip address and Developer Key.

Anyone with the same issue and solved it?

BR, Jens

here a little bit more info:

15-Okt-2018 21:26:04.394 [DEBUG] [openhab.binding.mihome.handler.XiaomiBridgeHandler] - dispose
15-Okt-2018 21:26:04.395 [DEBUG] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Interrupting Thread Thread[Thread-182,5,main]
15-Okt-2018 21:26:04.397 [DEBUG] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Closing socket java.net.MulticastSocket@d2f6e4
15-Okt-2018 21:26:04.399 [TRACE] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Receiver thread was interrupted
15-Okt-2018 21:26:04.400 [DEBUG] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Receiver thread ended
15-Okt-2018 21:26:04.410 [DEBUG] [openhab.binding.mihome.handler.XiaomiBridgeHandler] - Init socket on Port: 9898
15-Okt-2018 21:26:04.412 [DEBUG] [.binding.mihome.internal.socket.XiaomiBridgeSocket] - Setup socket
15-Okt-2018 21:26:04.417 [DEBUG] [.binding.mihome.internal.socket.XiaomiBridgeSocket] - Initialized socket to null:-1 on 0.0.0.0/0.0.0.0:9898
15-Okt-2018 21:26:04.419 [DEBUG] [penhab.binding.mihome.internal.socket.XiaomiSocket] - There are 1 open sockets: {9898=java.net.MulticastSocket@c1e5e0}
15-Okt-2018 21:26:04.421 [TRACE] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Staring reveicer thread for socket on port 9898
15-Okt-2018 21:26:04.423 [TRACE] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Thread Thread[Thread-188,5,main] waiting for data on port 9898
15-Okt-2018 21:26:04.421 [TRACE] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Adding socket listener org.openhab.binding.mihome.handler.XiaomiBridgeHandler@d91977
15-Okt-2018 21:26:04.440 [DEBUG] [openhab.binding.mihome.handler.XiaomiBridgeHandler] - Cancelled running timer
15-Okt-2018 21:26:05.440 [DEBUG] [openhab.binding.mihome.handler.XiaomiBridgeHandler] - Triggered discovery
15-Okt-2018 21:26:05.445 [DEBUG] [openhab.binding.mihome.handler.XiaomiBridgeHandler] - Send to bridge mihome:bridge:d30fcfbb: {"cmd": "get_id_list"}
15-Okt-2018 21:26:05.447 [TRACE] [penhab.binding.mihome.internal.socket.XiaomiSocket] - Sending message: {"cmd": "get_id_list"} to /192.168.178.54:9898

Version code:201
网关ID:87635039
Zigbee通道:25
网关信息:
{“life”:294415,“cfg_time”:0,“token”:“59db7b81jksghfzrfueuehgz70c51ebd”,“mac”:“7C:49:EB:1C:D5:72”,“fw_ver”:“1.4.1_157”,“hw_ver”:“MW300”,“model”:“lumi.gateway.v3”,“mcu_fw_ver”:“0143”,“wifi_fw_ver”:“SD878x-14.76.36.p84-702.1.0-WM”,“ap”:{“rssi”:-41,“ssid”:“con1”,“bssid”:“78:8A:20:2A:AA:1A”},“netif”:{“localIp”:“192.168.178.54”,“mask”:“255.255.255.0”,“gw”:“192.168.178.1”,“gw_mac”:“E0:28:6D:AD:A5:E5”},“mmfree”:159808,“ot”:“ott”,“otu_stat”:[0,0,1,1,0,752],“ott_stat”:[25,1,624,974]}

子设备信息:
[{“model”:“lumi.weather.v1”,“did”:“lumi.158d0002325d11”,“name”:“Temperature and Humidity Sensor”}]

and a tcpdump

21:43:04.730471 IP 192.168.178.2.9898 > 192.168.178.54.9898: UDP, length 22
21:43:05.131457 IP 192.168.178.54 > 192.168.178.2: ICMP 192.168.178.54 udp port 9898 unreachable, length 36
21:43:09.757646 ARP, Request who-has 192.168.178.54 tell 192.168.178.2, length 28
21:43:09.759202 ARP, Reply 192.168.178.54 is-at 7c:49:eb:1c:d5:72, length 46

ok… now i see by myself that the gateway told openhab that the port 9898 is unreachable… BUT WHY… ?

No one a clue? :frowning:

Hi Jensen,

Looks like the gateway (.54) replied to your openhab server that port 9898 was unreachable. Perhaps it is not open? I’m wondering if you are having the same problem as me down the bottom of this forum post. I’m currently trying to get to the bottom of this.

Can you use nmap to check if the port is responding? Also; can you run tcpdump to check if you see multicast packets being sent on 244.0.0.50?

Aaron

Hi Aaron,

to be honest: I gave up on this. It seems as if some bridges are simply “broken”. I switched to zigbee2mqtt an a USB-Zigbee Stick.

Jens

Hi Jensen,

I’m guessing you’re using zigbee2mqtt with Xiaomi devices? Are you finding that works without any issues? That might be a safer option rather than continuing to buy gateways until I find one that works…

Hi Aaron,

yes, that is exactly what i am doing. First i tried the Zigbee Bindung from OpenHAB, but it was not stable enough for me. I had issues with updates from sensors and was also not able to connect a ZigBee router to extend the network. I switched to Zigbee2mqtt and the mqtt Binding and it works for me.

Jens

1 Like

Hi Jens,

do you have a tutorial for that?

Sven

Hi Sven,

i used a combination from https://koenkk.github.io/zigbee2mqtt/ and Howto use zigbee2mqtt with openHAB, removing proprietary bridges / gateways

Jens