Cannot connect Xiaomi Gateway (lumi.gateway.v3) to HA

That would imply that discovery was not working, which may be due to multicast not working on your LAN.

Thanks Nickrout.

You were right. Now fully enabled and awaiting testing :smiley:

image

I have this same issue with a newly purchased Xiaomi Gateway from eBay.

I can enable dev mode but no matter what I try, the ports never seem to be open and HA cannot find this Gateway. I have another existing Xiaomi Gateway which continues to work fine on the same firmware version so it seems like there’s some other subtle difference.

Is the best recourse just buying another unit (opting for Chinese if possible) to hope that will work?

Nmap output:

sudo nmap -sU -Pn 192.168.xxx.xxx -p 9898,4321

Starting Nmap 7.40 ( https://nmap.org ) at 2019-03-17 21:40 UTC
Nmap scan report for lumi-gateway-v3_miio78952604.lan (192.168.xxx.xxx)
Host is up (0.018s latency).
PORT     STATE  SERVICE
4321/udp closed rwhois
9898/udp closed monkeycom
MAC Address: 78:11:DC:XX:XX:XX (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 1.03 seconds

@ricochet try this . Had the same problem. If the firmware is new , the developer mode does not open the ports

Wow great information, thank you. Doing open heart surgery on the hub is likely beyond my capabilities unfortunately so I will wait to see if a future firmware fixes the ability to do the equivalent of psm-set network.open_pf 3 from the dev mode screen again.

If I had my time again, I would enable this dev mode before updating the older firmware on the new hub, and I likely wouldn’t have had any further issues… so getting another hub and doing this right is a second option?

Depends on the firmware version the new device is shipped with. The Mi home will nag to update the firmware as well , you will need to be careful. The serial connection is not too bad , you do need a usb to serial converter. The most difficult thing was to open the box . tamper proof screws !

The last firmware update was few weeks ago and apparently didn’t fix the issue.

I’ll have to try this as well… I’m at latest fw out of the damn box and it consumed my entire weekend trying to get it working. I’m using orbi router and can’t find multicast settings but assume it will work if I can force open the ports. I also have a decent Cisco router with ddwrt loaded so I’ll use that and connect a 2nd net interface to my docker server if necessary.

Make sure you can get into developers mode on the Mi home app. The serial port fix will only work on Xiaomi Gateways

The bug is triggered (ports closed) if you upgrade >= 1.4.1_164.0158 without setting the developer mode first. Once ports are open you can upgrade to latest firmware . I am currently on 1.4.1_167.0158 and working OK

The latest aqua hub and app does not support developers mode and the serial port mod will not work :frowning:

1 Like

I have “developer mode” aka “wireless communication protocol” turned on. I generated multiple " passwords" and turned the mode off\on multiple times with no luck.

I’m on fw_ver":"1.4.1_167

Serial option it is then :). Fixed it for me

1 Like

Hmm I just checked the ports, and it looks like nmap shows both 9898 and 4321 as “open | filtered”. I haven’t seen anyone with that yet.

As someone with almost no experience soldering anything, it seems like a pretty tricky solution that would likely result in a completely dead hub… I don’t really trust myself messing around with a device while it is plugged into the mains

The state is either open , filtered , closed , or unfiltered . Open means that an application on the target machine is listening for connections/packets on that port. Filtered means that a firewall, filter , or other network obstacle is blocking the port so that Nmap cannot tell whether it is open or closed .

my Nmap returns

Starting Nmap 7.40 ( https://nmap.org ) at 2019-03-18 17:16 UTC
Nmap scan report for lumi-gateway-v3_miio56304268.home.local (192.168.1.61)
Host is up (0.28s latency).
PORT     STATE         SERVICE
4321/udp open|filtered rwhois
9898/udp open          monkeycom

Verified that this worked. Lonebaggie, thanks for pointing this out earlier, I had to save it so I can potentially do it to my 2nd one when it finally arrives from China (I’ll forget the steps by then):joy:

Now to finally get all of these sensors set up!

1 Like

Same problem here, hours of headache. So I ordered a RaspBee for my PI and ditched the Xiaomi and Tradfri bridges. All my Xiaomi sensors work just fine and all together with my Tradfri bulbs.

I’ve having this exact issue, annoying as I already canceled my first gateway thinking it would’t work. Can you confirm if your new working gateway is a lumi.gateway.v3 also?

Hi as the starter of this thread, I finally able to resurrect my first gateway from useless using the serial method. I first try to stick the cable with tape to avoid soldering but turned out it wasn’t stable enough. Finally needed to solder some wires and now it’s working perfectly fine.

So what now?
I haven’t updated and my gateway is working fine, should I update to 1.4.1_167.0158? or leave it and be happy?

I’m not a fan of doing surgery on the gateway for no reason unless there are major benefits

Thank you for such a detailed thread. After resetting my lumi v3 ovr the last 48hrs, I’ve been on a mission to try and find out why it didn’t work with HA any longer, managing to unpair 30 devices along the way!

The serial method documented here worked a treat and now it’s working again. Yay. Now to re-pair 30 Zigbee devices!! :slightly_frowning_face:

Jesus, so maybe I should stay on my current (7 months old) firmware then since it’s working fine

Does the newer firmware offer anything amazing?