Xiaomi Mi Gateway - appears bridge offline in openHab


I have an openHab setup for already 18 months and I have 3 Xiaomi Gateways. They were all working fine until a couple of weeks ago when one of them started to be reported “offline” by openHab.
I believe this is more or less the point in time when I upgraded the firware on the gateways. They are now all on

Im’ not sure what they were on before :frowning: as I upgrade from time to time and since i had no problems until now I stopped tracking the firmware changes…

I have read the documentation on por 9898, I checked if it was still open on the gateway, and confirmed it was. I enabled the traces for the binding and can see a bunch of:

2019-05-08 15:39:24.434 [DEBUG] [.mihome.internal.socket.XiaomiSocket] - Received Datagram from on Port 9898

I have them for the 3 gateways, including the one @ which is the one that now appears offline…

For the other gateways, what is see is more like this (when I filter the log on the IP address):

Received Datagram from on Port 9898
2019-05-08 15:42:25.194 [DEBUG] [.mihome.internal.socket.XiaomiSocket] - Received Datagram from on Port 9898
2019-05-08 15:42:25.192 [DEBUG] [.mihome.internal.socket.XiaomiSocket] - Received Datagram from on Port 9898
2019-05-08 15:42:25.201 [TRACE] [internal.handler.XiaomiBridgeHandler] - Received message {“cmd”:“heartbeat”,“model”:“gateway”,“sid”:“34ce0091e702”,“short_id”:“0”,“token”:“KHEynPLS2j9TXXZe”,“data”:"{“ip”:“”}"}
2019-05-08 15:42:25.214 [DEBUG] [rnal.handler.XiaomiDeviceBaseHandler] - Item got update: {“cmd”:“heartbeat”,“model”:“gateway”,“sid”:“34ce0091e702”,“short_id”:“0”,“token”:“KHEynPLS2j9TXXZe”,“data”:"{“ip”:“”}"}

It looks to me that it is not a problem of ports open or closed in my case but I can’t tell for sure.
Does this look like the problem that is recovered only connecting a UART device to the gateway?

Any suggestion on other data should I look for in the trace to identify better the problem?



I had a similar issue, and I realized that the developer key was empty for my two gateways.
I have updated them, and now there are back online.

Don’t know if it will helps you…

Hello Matthieu,

A quick note to say thank you, I found what my problem was, and what triggered me was your message… I realized that the IP address of the gateway registered in Openhab was different from the one assigned to the gateway at this moment in time.
I remembered that the day it stopped working was the day I had to reboot my router and understood that for some reason I had not configured it to deliver a fixed IP address to this gateway…

So now, problem is fixed… I lost several weeks of data because of my lazyness in investigating this and not considering the sequence of events that were a likely explanation :slight_smile:
Thanks again for taking the time to answer.