Xiaomi Gateway no Longer connecting on latest firmware - "Invalid Config"

many thanks for this reply, it looks like a good solution. Will try it soon, many thanks again!

Finally found some time to try the solution above. It perfectly worked for me, I connected to the gateway by UART and activated ports opening. Now the gateway and all its devices are available in HASS.
The most complex part for me was about special screwdriver (u-profile), I didn’t have the one and had to find some workaround :slight_smile:
I used speed 115200 to connect via putty. Thanks to everyone who was helping!

I’ve added a second gateway to my network - did the open lan connection first, then upgraded (twice) - seems to work.

Just getting courage to do the primary

Is it a square or round text gateway ? The square text ones seem to be fine for upgrade without soldering etc as I understood, it’s the round text ones that will cause troubles

Did you look at the pic? The serial connection hack soldering is shown in the pic, you can see the shape of the gateway.

That’s not what I mean, look at the full topic here https://community.openhab.org/t/solved-openhab2-xiaomi-mi-gateway-does-not-respond/52963/77

@walaj there are 2 versions one with square text one with round text, the square text ones seem to be ok and can be upgraded without the need of soldering etc.

OK I see what you mean.

Both my original and the new one have the ‘round text’ of the new hardware. And both have now been upgraded successfully.

I think the important point is that you must open LAN access first before any upgrade.

@walaj I can confirm what walaj is saying. I installed a new one with round text, new hardware, yesterday. Installed it without upgrading firmware, opened access and configured it in Openhab and added a smoke detector. Will be testing HA tonight but there is no reason why the result would be different as it uses same principle to communicate with the Xiaomi hub.

I was planning to leave it on the old firmware as I don’t feel like soldering but @walaj’s post encouraged me to give it a try.

Upgraded firmware this morning and it’s still working fine, the gateway as well as the smoke detector.

So it is fine to upgrade as long as you enable LAN mode first before upgrading. Also using latest IOS version of Mi home app, so nothing special there.

Hi,

I too finally got around to connecting to the gateway via the serial interface. I managed to open port 9898 and HA detects the gateway just fine. The connected rocker switch and motion sensor also work fine. The only thing I can’t get to work is controlling the light on the gateway. I can turn it on, but not off. Also the light sensor doesn’t change its values.

I experienced the same behavior before I opened port 9898, but the difference is that back then when I turned on the gateway light in HA, the switch flipped back to the off state. Now that the port is open, it stays in the ‘on’ position.

When still connected to the serial interface via Putty, I notice that when I turn the gateway light on via HA, it registers the command ({“id”:52,“method”:“props”,“params”:{“rgb”:1694498815}}. But when I turn it off, no command registers in the terminal window. By the way, when I turn it on via the Mi Home app, it displays a different message “{“id”:56,“method”:“props”,“params”:{“light”:“on”,“from.light”:“4,”}}”
When I turn it off in the MiHome app, it shows “{“id”:54,“method”:“props”,“params”:{“light”:“off”,“from.light”:“4,”}}”.

I have another gateway (with square text) and that one works fine.

I tried:

  • a factory reset of the gateway (by removing it from the app and another time by holding down the button on the gateway)
  • Toggling the LAN mode
  • regenerating the LAN key (5 times).

Any ideas what could be the issue here?

Sounds like you need to post a github issue.

Thanks. Just did that: https://github.com/home-assistant/home-assistant/issues/20329

Anyone have any updates on if the most resent firmware is working?

I rebooted my hass and lost one of my gateways and can’t get it back - not sure if I should risk trying to upgrade firmware.

1.4.1_167.0158 is working here. Although it had to be hacked as stated in previous posts.

I tried the UART connection but somehow I can’t seem to get in.
I have a round hub with fw version 1.4.1_167

Using this cable: https://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_TTL-232R_CABLES.pdf > TTL-232R-3V3 which I’ve had laying around for serial connection to my Beaglebone Black. Is this not the correct cable?

Connecting with “screen -L /dev/cu.usbserial-A603LDNK” and I see nothing. Nor with “screen -L /dev/tty.usbserial-A603LDNK 115200”

I do as the instructions say, connect TX and GND, and wait until I see connection in the app (eg change color) to connect RX. I noticed that when TX or RX are connected when the hub powers on, it doesn’t seem to want to boot at all.

Can anyone confirm with the the following photos, the connection points are OK?

Any ideas?

Edit: Got it work, UART TX goes to Hub RX and vice versa of course, silly me!

1 Like

Sorry, i tried everything like the instructions, i can see the messages in putty, but i can NOT send the command… I dont know how to do that… Can you please explain. Thx.

Have you tried hit Enter few times to have a hash at the beginning? And then start typing your commands.

I have recieved Xiaomi Gateway from Aliexpress and unfortunatelly had the same issues with connecting it to HA.

My MAC wasn’t in the list - in fact it starts with 28:6C:07 - but the port 9898 was closed, so this thread was very useful for me to get it working.

I was first unlucky with soldering the TX connector and accidentally tear the metal contact off the gateway board - it wasn’t very hard to do that in fact. So I did appreciate to find another step by step approach on russian blog, which shows another point on the board, where you can alternatively solder TX, RX and GND.

In fact there are much more detailed instructions for beginner like me.

And connecting TX from gateway to RX on UART and vice versa is a really good to point out.

Were you able to solve this issue?
I’m so painfully close! I was able to open the gateway, solder it, I can connect to it through minicom (I’m in Linux) and I can see all the messages coming out, but I can’t get it to respond to my commands! It’s so frustrating, if I could only send the command to open the port I’d be finally done with this!
Any ideas on how to get it to take input via serial would be greatly welcomed.

Not sure if this matters but I’m on Firmware 1.4.1_176.0220

oooooh! Alelujah!

I was finally able to get this step done!

For the next poor soul, these are the small tips that were missing for me:

  • I was using minicom on Linux to try to get this working, but it would ignore the commands I sent. I installed Putty (yes, it exists for Ubuntu as well, just apt install putty) and that worked as a charm
  • Silly but I had assumed that in the picture showing where to solder things, “Rx” meant “this is where you should connect the Rx end of the UART dongle” but in reality it meant “This is the Rx terminal of the serial port on the Getway”. In other words: connect Rx from the Gateway to Tx in the UART and vice-versa (duh)
  • I found this additional post which explains the same thing but a bit cleaner, it helped me confirm these were the right steps (and hinted me to putty): Cannot connect Xiaomi Gateway (lumi.gateway.v3) to HA - #126 by Swaq

Thanks, community!
Now on to trying to get the Gateway Key to see if I can finally integrate this.