Second Xiaomi bridge offline, only 1 works at a time

Platform information:

  • Hardware: Raspberry Pi 4 Model B Rev 1.2, Xiaomi Mi lumi-gateway-v3
  • OS: Raspbian GNU/Linux 10 (buster)
  • Java Runtime Environment: Zulu8.40.0.178-CA-linux_aarch32hf) (build 1.8.0_222-b178)
  • openHAB version: openHAB 2.5.4-1 (Release Build)
  • Binding: Xiaomi Mi Smart Home Binding
    Using Paper UI - as I am a beginner :slight_smile:

Issue of the topic: Adding second Xiaomi bridge offline

Please post configurations (if applicable):

New build using SD-card image, 2 Xiaomi lumi-gateway v3 bridges.
Programmed both gateways to open port 8989 - Confirmed and working(but… keep reading) (following community posts)
Configured both gateways with there appropriate unique Developer Keys (from Mi Home App)
Can add 1 gateway/bridge fine, and discover all attached sensors
Adding second gateway/bridge goes from Initializing to Offline

If I disable the working Gateway, and then disable & enable not working gateway, it then comes on line ! and can discover its sensors fine (but the initial one when re-enabled goes offline)


When I tcpdump the traffic to and from the gateways I can see

Enabling first gateway
07:52:52.525755 IP (tos 0x0, ttl 64, id 45570, offset 0, flags [DF], proto UDP (17), length 50)
openhab.fritz.box.9898 > lumi-gateway-v3-miio275201031.fritz.box.9898: UDP, length 22
07:52:52.533254 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has openhab.fritz.box tell lumi-gateway-v3-miio275201031.fritz.box, length 46
07:52:52.533295 ARP, Ethernet (len 6), IPv4 (len 4), Reply openhab.fritz.box is-at dc:a6:32:69:60:6f (oui Unknown), length 28
07:52:52.535021 IP (tos 0x0, ttl 255, id 35329, offset 0, flags [none], proto UDP (17), length 150)
lumi-gateway-v3-miio275201031.fritz.box.9898 > openhab.fritz.box.9898: UDP, length 122
07:52:52.545740 IP (tos 0x0, ttl 64, id 45571, offset 0, flags [DF], proto UDP (17), length 68)
openhab.fritz.box.9898 > lumi-gateway-v3-miio275201031.fritz.box.9898: UDP, length 40
07:52:52.545912 IP (tos 0x0, ttl 64, id 45572, offset 0, flags [DF], proto UDP (17), length 68)
openhab.fritz.box.9898 > lumi-gateway-v3-miio275201031.fritz.box.9898: UDP, length 40
07:52:52.546403 IP (tos 0x0, ttl 64, id 45573, offset 0, flags [DF], proto UDP (17), length 66)
openhab.fritz.box.9898 > lumi-gateway-v3-miio275201031.fritz.box.9898: UDP, length 38
etc…

Enabling 2nd gateway
07:53:24.680219 IP (tos 0x0, ttl 255, id 9073, offset 0, flags [none], proto UDP (17), length 166)
lumi-gateway-v3-miio133028324.fritz.box.4321 > 224.0.0.50.9898: UDP, length 138
07:53:34.664364 IP (tos 0x0, ttl 255, id 9076, offset 0, flags [none], proto UDP (17), length 166)
lumi-gateway-v3-miio133028324.fritz.box.4321 > 224.0.0.50.9898: UDP, length 138
07:53:44.648363 IP (tos 0x0, ttl 255, id 9079, offset 0, flags [none], proto UDP (17), length 166)
lumi-gateway-v3-miio133028324.fritz.box.4321 > 224.0.0.50.9898: UDP, length 138

It looks like the binding is trying to use the same source port 9898 to establish the connection to the gateway on destination port 9898

Logs - showing both come on line - but only ever one at a time!

2020-04-23 12:02:02.401 [hingStatusInfoChangedEvent] - ‘mihome:bridge:04cf8ca14912’ changed from ONLINE to UNINITIALIZED

2020-04-23 12:02:02.444 [hingStatusInfoChangedEvent] - ‘mihome:bridge:04cf8ca14912’ changed from UNINITIALIZED to UNINITIALIZED (DISABLED)

2020-04-23 12:02:03.954 [hingStatusInfoChangedEvent] - ‘mihome:bridge:50ec50c53a76’ changed from UNINITIALIZED (DISABLED) to INITIALIZING

2020-04-23 12:02:05.006 [hingStatusInfoChangedEvent] - ‘mihome:bridge:50ec50c53a76’ changed from INITIALIZING to ONLINE

2020-04-23 12:02:07.871 [hingStatusInfoChangedEvent] - ‘mihome:bridge:50ec50c53a76’ changed from ONLINE to UNINITIALIZED

2020-04-23 12:02:07.915 [hingStatusInfoChangedEvent] - ‘mihome:bridge:50ec50c53a76’ changed from UNINITIALIZED to UNINITIALIZED (DISABLED)

2020-04-23 12:02:09.383 [hingStatusInfoChangedEvent] - ‘mihome:bridge:04cf8ca14912’ changed from UNINITIALIZED (DISABLED) to INITIALIZING

2020-04-23 12:02:10.416 [hingStatusInfoChangedEvent] - ‘mihome:bridge:04cf8ca14912’ changed from INITIALIZING to ONLINE

2020-04-23 12:02:11.955 [hingStatusInfoChangedEvent] - ‘mihome:bridge:50ec50c53a76’ changed from UNINITIALIZED (DISABLED) to INITIALIZING

2020-04-23 12:02:45.193 [hingStatusInfoChangedEvent] - ‘mihome:bridge:04cf8ca14912’ changed from ONLINE to UNINITIALIZED

2020-04-23 12:02:45.236 [hingStatusInfoChangedEvent] - ‘mihome:bridge:04cf8ca14912’ changed from UNINITIALIZED to UNINITIALIZED (DISABLED)

2020-04-23 12:02:46.858 [hingStatusInfoChangedEvent] - ‘mihome:bridge:50ec50c53a76’ changed from INITIALIZING to UNINITIALIZED

2020-04-23 12:02:46.896 [hingStatusInfoChangedEvent] - ‘mihome:bridge:50ec50c53a76’ changed from UNINITIALIZED to UNINITIALIZED (DISABLED)

2020-04-23 12:02:48.253 [hingStatusInfoChangedEvent] - ‘mihome:bridge:50ec50c53a76’ changed from UNINITIALIZED (DISABLED) to INITIALIZING

2020-04-23 12:02:49.291 [hingStatusInfoChangedEvent] - ‘mihome:bridge:50ec50c53a76’ changed from INITIALIZING to ONLINE

2020-04-23 12:02:50.398 [hingStatusInfoChangedEvent] - ‘mihome:bridge:04cf8ca14912’ changed from UNINITIALIZED (DISABLED) to INITIALIZING

Would really appreciate any help or ideas anyone has

Many Thanks

https://github.com/openhab/openhab-addons/issues/7425

1 Like

Thank you,

I searched for hours on the OpenHAB community, and found many similar, but nothing worked, now also following the Github post too.
Glad its not just me
Now to figure out how to downgrade

Same as upgrading, just pick the package you want.

From the doc’s:

sudo apt-get update
sudo apt-get upgrade

You may want to switch to a different repo, or an older (but more stable) version of openHAB. To do this, simply select the repo as in the installation instructions above, then find the version by bringing a list of all versions available to install:

sudo apt-get update
apt-cache showpkg openhab2

Once you know which version you want, you can upgrade/downgrade to it by using the apt-get install openhab2=[version] command, for example:

sudo apt-get install openhab2=2.1.0-1
1 Like

I Have installed the 2.5.5. snapshot version, and deleted the official binding.
For me this solved it for now, and easier than downgrade Openhab as described above.

I have also installed the 2.5.5 snapshot binding into the binding directory, deleted the old 2.4 temporary binding, restarted Openhab2 and confirm it now also works as expected

https://www.maindrain.net/openhab/org.openhab.binding.mihome-2.5.5-SNAPSHOT.jar

Thanks to everyone that helped.

1 Like

Thanks for the new snapshot, the issue is now resolved for me.