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

Follow the instructions and use -Pn in your commandline.

How hard can that be?

Also, there needs to be a space between the IP address and the -p

Why are you obfuscating the IP address? Do you really think we can access your gateway by knowing your private IP address?

No, you cant access my GW over the internet but I dont like to expose my private ip to the internet(full stop).

There is a space there in my command line. I am not sure why when I copy and paste, it disappear.
It does shows the port was open for a while and then closed then open and then close…
I ran few times and sometimes it open and sometimes it closed. I just copy the 2 that shows different result.

hoedha, maybe you wanna try run on host computer rather than virtual machine.

Was it stated as closed or was it the Nmap couldn’t connect to he gateway? In my case using LAN cable I can always Nmap the gateway but it always return the state of closed on both ports.

I’ve tried running HA in VMware, in virtualbox, and in Ubuntu desktop pc as host… All result in same situation… Do I get a defective gateway?

Why the hell don’t you follow the instructions and run nmap with -Pn.

who is from hell again ?

I give up on trying to help you. You seem oblivious to suggestions.

@tyjtyj @nickrout please don’t fight each other. We are here to help others having problems (like me)…

Back to topic, I’ve tried running nmap using -Pn as suggested, but the result is the same… So I really guess there’s something wrong with my gateway which won’t open its port. I’ve disabled-enabled LAN access from dev-mode in mi-home but still face the same problem. I’ve found a guy in another city with HA setup and xiaomi gateway, so I may try to send him my unit to try on his setup, or ask him to send his gateway for me to try in my network…

Really strange… I wish we could flash (custom) firmware to the Xiaomi gateway…

root@hoedha-m93p:~# nmap -sU -Pn 192.168.0.108 -p 9898,4321

Starting Nmap 7.60 ( https://nmap.org ) at 2018-09-08 09:24 WIB
Nmap scan report for 192.168.0.108
Host is up (0.22s latency).

PORT     STATE  SERVICE
4321/udp closed rwhois
9898/udp closed monkeycom
MAC Address: 78:11:DC:B3:7D:98 (Xiaomi Electronics,co.)

Nmap done: 1 IP address (1 host up) scanned in 14.07 seconds
root@hoedha-m93p:~# nmap -sU -Pn 192.168.0.108 -p 9898,4321

Starting Nmap 7.60 ( https://nmap.org ) at 2018-09-08 09:24 WIB
Nmap scan report for 192.168.0.108
Host is up (0.22s latency).

PORT     STATE  SERVICE
4321/udp closed rwhois
9898/udp closed monkeycom
MAC Address: 78:11:DC:B3:7D:98 (Xiaomi Electronics,co.)

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

Forget the rude people…

Here is my output

Host is up (0.024s latency).
PORT     STATE         SERVICE
4321/udp open|filtered rwhois
9898/udp open          monkeycom

Definitely something wrong with my gateway. It doesn’t open the port for communication. No wonder HA never been able to communicate with it… Ok… I’ll try to swap gateway with one of my friend… I’ll report back when there’s result… thank you all for you kind help and suggestion…

Hi all,

Got back with sad result from my friend. So he owns two xiaomi mijia gateway (same like mine). When he tried to integrate mine with his HA, his HA can never find mine. Nmap also showed that both port on mine is closed. Whereas, both of his gateway has ports open.

So I think my unit is a defective unit. I don’t know how to fix that. It seems like something wrong with the software inside, but I don’t know how to downgrade the firmware. I might be waiting for next firmware upgrade to try my luck.

Meanwhile, I’ve been ordered parts for zigbee2mqtt and hope that I get better luck with it.

But for curiousity I will also order the xiaomi gateway one more time, this time from the same seller as my friend.

A bit OOT, Xiaomi seems to release a new smart aqara hub. Anyone has experience with it?

1 Like

Hi @hoedha,

New smart aqara hub is not from xioami! Only is from Aqara! so you need to add this new device in Aqara app, not in Xiaomi!.

For now, only aqara devices (motion detection, water sensor, door sensors, etc) will be compatible with new aqara hub, devices that are not aqara, will not be compatible with new Hub.

I talked with aqara 2/3 weeks ago and they told me that for now this new hub will not be compatible with Xiaomi app, during 1st quarter of year, will be compatible then.

I don’t have photo about aqara hub will be compatible with xiaomi sensors, but i make again the qüestion to aqara people. Also you can find this info here:

https://npirtube.com/aqara-nuevo-gateway-homekit-mi-home-xiaomi/

I have finally solved this problem !! It’s true, somehow my first gateway is broken/defective in a way and cannot open its communication port at 9898 and 4321.

Now I get my second xiaomi gateway, same as before, only this time I bought the 5-in-1 package. It works out of the box without much hassle, just following the doc, and et voila it appears in HA and I have total control…

Now, what should I do with my first gateway? Throw it out to the river? Run it over with my car? Put it on a railway track? It’s been giving me headache for 2 weeks… :joy:

3 Likes

return it for a refund?

the gateway works OK with mi-home apps… I don’t think the seller will accept the reason…

I might try to link it using mi-home… Can I ?

1 Like

I read this topic and think my is faulty too, is anything else to try?
My output nmap:

PORT STATE SERVICE VERSION
4321/tcp closed rwhois
9898/tcp closed monkeycom
MAC Address: 7C:49:EB:1A:44:13 (Unknown)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: specialized
Running: iRobot embedded
OS CPE: cpe:/h:irobot:roomba_980
OS details: iRobot Roomba 980 vacuum cleaner
Network Distance: 1 hop

Hi, any update?

root@xsk-Haier:/usr/share/hassio/homeassistant# nmap -sU -Pn 192.168.1.126 -p 9898,4321

Starting Nmap 7.60 ( https://nmap.org ) at 2018-11-19 17:06 CST
Nmap scan report for lumi-gateway-v3_miio87642603 (192.168.1.126)
Host is up (0.12s latency).

PORT STATE SERVICE
4321/udp closed rwhois
9898/udp closed monkeycom
MAC Address: 7C:49:EB:1C:F2:FE (Unknown)

what else can I do? It worked fine with the Mi-home app

Have you enabled developer mode?

Hello @nickrout,

Do you mean in the Mi-home app to enable the xiaomi-gateway’s “LAN communication protocol” ? If so , yes I have enabled it.
It is frustrating that I struggled over 5 hours on this problem and still no clue.
Or maybe it is because I’m running the hass.io from docker?

Best regards,
Kong

Ok, my device turned out to be the exact same situation that @hoedha met.
HA cannot discover it.
Nmap shows 4321, 9898 port is closed.
I’ve tried changing router settings, fresh re-installation of HA by Docker, navtive linux
And no progress at all.
Today I finally returned the gateway and they gave me another new one.
It works as soon as I plugged it in and restarted HA.
I confirm it is due to a defective device (or the culprit is the latest firmware? the defective one I updated to the latest firmware, this new working one has fw_ver:1.4.1_149 not the latest)

Thanks!

1 Like