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

Hi, thanks for all the info on this thread.
I have been using my lumi.gateway.v3 for two years and had no issues with developer/lan mode and I’m running the latest update, see attached image.

But I have a friend with same v3 gateway but new install and has this problem where the udp data is not working.
Having read through the post it seems to be;

  1. Setup issue, where the previous 1-10 checklist will help.
  2. Hardware batch issue
  3. Firmware issue
  4. OR Xiaomi are starting to remove the Dev/Lan mode support from their Gateway !
    Let’s hope for OpenLab, HomeAssistant and all others its not (4).

Has anyone got any Xiaomi support contacts who can confirm if this is a known problem.

1 Like

Hi, my very first post here.
It appears that the following has finally worked with my copy of the gateway model lumi.gateway.v3 and my dockerized HA.
The host string is critical as without it my gateway was never visible to HA after enabling the wireless communication protocol:

apj@zbook15:~$ sudo nmap -sU -Pn 10.10.10.9 -p 9898,4321

Starting Nmap 7.60 ( https://nmap.org ) at 2019-01-27 23:29 GMT
Nmap scan report for lumi-gateway-v3_miio98956133 (10.10.10.9)
Host is up (0.0080s latency).

PORT     STATE         SERVICE
4321/udp open|filtered rwhois
9898/udp open          monkeycom

Nmap done: 1 IP address (1 host up) scanned in 1.57 seconds
apj@zbook15:~$ echo '{"cmd":"whois"}' | nc -u 10.10.10.9 4321
{"cmd":"iam","port":"9898","sid":"7c49edd1e100","model":"gateway","proto_version":"1.1.2","ip":"10.10.10.9"}        

xiaomi_aqara:
discovery_retry: 10
gateways:
- mac: XXXXXXXXXX (remove all “:” and use lower case letters )
host: XXX.XXX.XX.XX
key: XXXXXXXXXXXXXXXX

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