# Xiaomi gateway and node red

**URL:** <https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484>\
**Category:** General\
**Created:** [19 July 2019 12:52 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484 "2019-07-19T12:52:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pawel256](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@pawel256](https://discourse.nodered.org/u/pawel256)\
**Post date:** [19 July 2019 12:52 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/1 "2019-07-19T12:52:39Z")

</div>

I read this tutorial [https://notenoughtech.com/home-automation/nodered-home-automation/xiaomi-gateway-in-nodered/](https://notenoughtech.com/home-automation/nodered-home-automation/xiaomi-gateway-in-nodered/) and try to connect to xiaomi gateway  
I have ip, key, port etc, but I can't connect

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [19 July 2019 14:12 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/2 "2019-07-19T14:12:50Z")

</div>

So you’ve managed to install the node it recommends?

If so and it doesn’t connect what error does it give you?

What version of node-red?  
What version of nodejs?

---

<div class="post-metadata">

**Author:** ![Folgore](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@Folgore](https://discourse.nodered.org/u/Folgore)\
**Post date:** [20 July 2019 11:42 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/3 "2019-07-20T11:42:51Z")

</div>

Where try you to connect?

---

<div class="post-metadata">

**Author:** ![realjax](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realjax/32/895_2.png) [@realjax](https://discourse.nodered.org/u/realjax)\
**Post date:** [20 July 2019 14:36 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/4 "2019-07-20T14:36:15Z")

</div>

I had to modify the settings of the xiaomi gateway by connecting it to a terminal in order to be able to access it. You might want to make sure yours is accessible in the first place.

---

<div class="post-metadata">

**Author:** ![pawel256](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@pawel256](https://discourse.nodered.org/u/pawel256)\
**Post date:** [22 July 2019 07:21 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/5 "2019-07-22T07:21:38Z")

</div>

Node-RED v0.20.6  
Node.js v10.16.0  
system: windows 7  
I have errror "path" is not defined: try to reuse 9898

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [22 July 2019 07:24 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/6 "2019-07-22T07:24:51Z")

</div>

Can you take a screenshot of the nodes config settings?

---

<div class="post-metadata">

**Author:** ![pawel256](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@pawel256](https://discourse.nodered.org/u/pawel256)\
**Post date:** [22 July 2019 08:15 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/7 "2019-07-22T08:15:35Z")

</div>

> [@ukmoose](#):
>
> nodes config settings

![Hub_settings](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5672ab1842e0df184bb53c45a7327e2dcca5435b.png)  
 ![key](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/2c4f6c9c5f7f9c3313a750eadcd5c294eff3f131.png)  
I have install node red on rpi, and the same problem

---

<div class="post-metadata">

**Author:** ![pawel256](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@pawel256](https://discourse.nodered.org/u/pawel256)\
**Post date:** [22 July 2019 08:20 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/8 "2019-07-22T08:20:23Z")

</div>

![node-red-settings](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f8705875be2a478405e5817b2804b8fff6c42a4a.png)  
 ![window](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4b4c1701620d9853ecd10a8dfb82864ee3162416.png)

---

<div class="post-metadata">

**Author:** ![pawel256](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@pawel256](https://discourse.nodered.org/u/pawel256)\
**Post date:** [22 July 2019 08:21 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/9 "2019-07-22T08:21:42Z")

</div>

![ssh](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d8e147d33c4d525f96f1755d085feedb0cd5be67.png)

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [22 July 2019 08:50 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/10 "2019-07-22T08:50:14Z")

</div>

Try removing the ip address and the port number (leave them both blank) from the configuration and trying again.

---

<div class="post-metadata">

**Author:** ![pawel256](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@pawel256](https://discourse.nodered.org/u/pawel256)\
**Post date:** [22 July 2019 09:05 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/11 "2019-07-22T09:05:31Z")

</div>

The same problem

---

<div class="post-metadata">

**Author:** ![pawel256](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@pawel256](https://discourse.nodered.org/u/pawel256)\
**Post date:** [22 July 2019 09:07 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/12 "2019-07-22T09:07:03Z")

</div>

'USP socket is already used, try to reuse 9898' is normal information?  
Maybe port 9898 is used by another program or firewall blocked?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [22 July 2019 09:16 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/13 "2019-07-22T09:16:31Z")

</div>

Then I suggest you open an issue on the nodes GitHub page to talk directly to the author

---

<div class="post-metadata">

**Author:** ![Folgore](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@Folgore](https://discourse.nodered.org/u/Folgore)\
**Post date:** [22 July 2019 09:20 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/14 "2019-07-22T09:20:48Z")

</div>

I have even problem with multicast and PC, I have the same problem (Virtual machine with linux idem), I have Resolved with a raspberry.

I did not understand if it is an operating system or network card problem.

For verify the communication with xiaomi gateway (for android)

> <https://play.google.com/store/apps/details?id=net.liveforcode.multicasttester&hl=it>
>
> Multicast Tester is used for testing Multicast packets on your network. 
> 
> Features:
> • Allows you to send and receive Multicast packets on any Multicast IP and Port combination.
> • Allows custom messages to be sent.
> • Shows IP Address origin of each received packet.
> • Use of Material Design to give you a very simple interface.
> • Receive in Hexadecimal to view the raw data sent over the network.
> 
> Troubleshooting:
> 
> I don't receive my program's packets / My programs aren't seeing what I send!
> 
> There ...

---

<div class="post-metadata">

**Author:** ![pawel256](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@pawel256](https://discourse.nodered.org/u/pawel256)\
**Post date:** [22 July 2019 12:35 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/15 "2019-07-22T12:35:48Z")

</div>

This problem is with firmware xiaomi gateway and closed ports.

> **[\[SOLVED\] Openhab2 - Xiaomi Mi Gateway - does not respond](https://community.openhab.org/t/solved-openhab2-xiaomi-mi-gateway-does-not-respond/52963)**
>
> Platform information: Hardware: CPU: armv7l / ram: 1gb / sd card: 8gb OS: Linux 3.10.107-11; Ubuntu 18.04.1 LTS bionic Java Runtime Environment: OpenJDK Runtime Environment (build 1.8.0\_181-8u181-b13-0ubuntu0.18.04.1-b13) openHAB version: OpenHab...

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [22 July 2019 12:58 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/16 "2019-07-22T12:58:03Z")

</div>

So it would be useful if the author updated the ReadMe of the node to include the information you have found. The way to contact the author is to open an issue on the nodes github page (follow a link from the nodes page on [flows.nodered.org](http://flows.nodered.org))

---

<div class="post-metadata">

**Author:** ![markost](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@markost](https://discourse.nodered.org/u/markost)\
**Post date:** [22 July 2019 14:51 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/17 "2019-07-22T14:51:15Z")

</div>

That method works OK.

See also the parameters for the serial port in the same topic.

Also, I recommend the method without connection to 220VAC (use only upper PCB, and caution with USB / Serial adapter, use only 3.3V! )

---

<div class="post-metadata">

**Author:** ![realjax](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realjax/32/895_2.png) [@realjax](https://discourse.nodered.org/u/realjax)\
**Post date:** [22 July 2019 17:33 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/19 "2019-07-22T17:33:40Z")

</div>

> [@pawel256](#):
>
> This problem is with firmware xiaomi gateway and closed ports.

That's what I said. It is not impossible to fix but it requires opening up the gateway and a bit of soldering.

---

<div class="post-metadata">

**Author:** ![pawel256](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@pawel256](https://discourse.nodered.org/u/pawel256)\
**Post date:** [22 July 2019 18:28 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/20 "2019-07-22T18:28:42Z")

</div>

Yes you said, but without information how to do it 😉  
I read that not all the version can be modified. Do you know more about it?

---

<div class="post-metadata">

**Author:** ![realjax](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realjax/32/895_2.png) [@realjax](https://discourse.nodered.org/u/realjax)\
**Post date:** [22 July 2019 19:01 UTC](https://discourse.nodered.org/t/xiaomi-gateway-and-node-red/13484/21 "2019-07-22T19:01:09Z")

</div>

> [@pawel256](#):
>
> Yes you said, but without information how to do it 😉

Google is your friend 😊 (but answering this post on my mobile phone is really nit my friend) and you have found the solution. Follow the link to thatt post 114 they mentions as being the answer.
